API:SetGroupAutoLootInRvR
From RoR Wiki
UI Lua API · Loot functions
Version: WAR 1.4.8
Asks the server to change the group's "auto loot in RvR" setting.
SetGroupAutoLootInRvR(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.autoLootInRvR, and disables the loot threshold control while it is on. 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.ToggleAutoLootRvR()
if( not ButtonGetDisabledFlag( PARENT_WINDOW.."AutoLootRvRButton" ) )
then
local isPressed = ButtonGetPressedFlag( PARENT_WINDOW.."AutoLootRvRButton" )
SetGroupAutoLootInRvR( not isPressed )
ButtonSetPressedFlag( PARENT_WINDOW.."AutoLootRvRButton", not isPressed )
end
end
