API:SetGroupNeedMode
From RoR Wiki
UI Lua API · Loot functions
Version: WAR 1.4.8
Asks the server to change the group's "need on use" loot setting.
SetGroupNeedMode(enabled)
Arguments
- enabled
boolean– The new value of the setting.
Returns
Nothing.
Details
- The client sends the value to the server as a group command. It does not check whether the player is the group leader; the server decides. The stock UI disables the button for players who are not the leader.
- The stock UI shows the current setting from
GameData.Player.Group.Settings.noNeedOnGreed. enabledmust be a real boolean. Passingnilor a number raises an Invalid Parameters error.- Exactly one argument must be passed.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a boolean.
Example
From default/ea_openpartywindow/source/openpartywindowtabmanage.lua:
function EA_Window_OpenPartyManage.ToggleNeedOnUse()
if( not ButtonGetDisabledFlag( PARENT_WINDOW.."NeedOnUseButtonButton" ) )
then
local isPressed = ButtonGetPressedFlag( PARENT_WINDOW.."NeedOnUseButtonButton" )
SetGroupNeedMode( not isPressed )
ButtonSetPressedFlag( PARENT_WINDOW.."NeedOnUseButtonButton", not isPressed )
end
end
