API:SiegeSetWindDirectionImage
From RoR Wiki
UI Lua API · RvR functions
Version: WAR 1.4.8
Tells the client which DynamicImage shows the wind direction while aiming a siege weapon whose fire mode uses wind (the stock scorch fire window).
SiegeSetWindDirectionImage(windowName)
Arguments
- windowName
string– Name of a DynamicImage window, or""to clear the image.
Returns
Nothing.
Details
- The image is only handed over when the active siege weapon's current fire mode is the one type of fire mode that uses it (the stock UI only calls this function from its scorch fire window). For other fire modes, or with no fire mode, the call does nothing apart from the window check below.
- When an image is set, the client immediately updates its rotation.
- If no window has that name (for example
""), the image is cleared. This is how the stock UI detaches it when the fire mode ends. - If the window exists but is not a DynamicImage, the error below is raised and the image is cleared.
- The function takes exactly one argument.
Errors
Error in function call 'SiegeSetWindDirectionImage': Window %s is not a DynamicImage setting to NULL
Example
From default/ea_siegeweaponwindow/source/siegeweaponscorchfirewindow.lua: one arrow image per wind force, only the current one is shown and handed to the client:
for index = 1, 4
do
local show = index == windForce
local windowName = "SiegeWeaponScorchFireWindowWindMeterArrow"..index
WindowSetShowing(windowName, show )
if( show )
then
SiegeSetWindDirectionImage( windowName )
end
end
Clearing it when the fire mode ends (same file):
SiegeSetWindDirectionImage( "" )
