SetWindowFlashing: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0160|1.6|7653|This function allows the to flash in the Windows taskbar.}} == Syntax == <syntaxhighlight lang="lua"> bool setWindowFlashing...") |
No edit summary |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{New feature/item|3. | {{New feature/item|3.0152|1.5.2||This function allows the window to flash in the Windows taskbar.}} | ||
== Syntax == | == Syntax == | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setWindowFlashing ( bool shouldFlash[, int count= 10] ) | bool setWindowFlashing ( bool shouldFlash [, int count = 10 ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Arguments === | === Required Arguments === | ||
* '''shouldFlash:''' whether the window should flash | * '''shouldFlash:''' whether the window should flash | ||
* '''count | |||
=== Optional Arguments === | |||
* '''count:''' the number of times the window should flash, defaults to '''10 times''' | |||
=== Returns === | === Returns === | ||
Line 16: | Line 18: | ||
* the window is already in focus | * the window is already in focus | ||
* the client has disabled this feature | * the client has disabled this feature | ||
Returns '''true'' otherwise | Returns '''true''' otherwise | ||
== Example == | == Example == | ||
A command that allows the player to flash their window three times after one second. | A command that allows the player to flash their window three times after one second. | ||
<syntaxhighlight lang="lua"> | |||
addCommandHandler("flash", | |||
function() | |||
setTimer(setWindowFlashing, 1000, 1, true, 3) | |||
end | |||
) | |||
</syntaxhighlight> | |||
A command that allows the player to flash their window after a certain period of time for a certain count. | A command that allows the player to flash their window after a certain period of time for a certain count. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> |
Latest revision as of 18:37, 24 January 2016
This function allows the window to flash in the Windows taskbar.
Syntax
bool setWindowFlashing ( bool shouldFlash [, int count = 10 ] )
Required Arguments
- shouldFlash: whether the window should flash
Optional Arguments
- count: the number of times the window should flash, defaults to 10 times
Returns
Returns false if:
- the window is already in focus
- the client has disabled this feature
Returns true otherwise
Example
A command that allows the player to flash their window three times after one second.
addCommandHandler("flash", function() setTimer(setWindowFlashing, 1000, 1, true, 3) end )
A command that allows the player to flash their window after a certain period of time for a certain count.
addCommandHandler("flash", function(_, wait, count) wait = tonumber(wait) -- makes "wait" a number, this will be false if it can't be converted shouldFlash = type(wait) == "number" -- if wait is given, we should flash, otherwise we shouldn't wait = wait or 5-- make wait default to 1 second if it isn't a number count = tonumber(count) or 5 -- makes "count" a number, 5 if it can't be converted setTimer(setWindowFlashing, wait*1000, 1, shouldFlash, count) end )
See also
- createTrayNotification
- downloadFile
- getDevelopmentMode
- getKeyboardLayout
- getLocalization
- isShowCollisionsEnabled
- isShowSoundEnabled
- isTransferBoxAlwaysVisible
- isTransferBoxVisible
- isTrayNotificationEnabled
- setClipboard
- setDevelopmentMode
- setTransferBoxVisible
- setWindowFlashing
- showCol
- showSound
- Shared
- addDebugHook
- base64Decode
- base64Encode
- debugSleep
- decodeString
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimerDetails
- getTimers
- getFPSLimit
- getUserdataType
- getVersion
- gettok
- isTransferBoxVisible
- setTransferBoxVisible
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setTimer
- ref
- deref
- sha256
- split
- teaDecode
- teaEncode
- toJSON
- tocolor
- getProcessMemoryStats
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace