Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:CancelKeepUpgrade

From RoR Wiki

UI Lua API · RvR functions
Version: WAR 1.4.8

Asks the server to cancel a keep upgrade (or downgrade) that is in progress.

CancelKeepUpgrade(upgradeId)

Arguments

upgradeId
number – Id of the keep upgrade. Only the low 16 bits are used.

Returns

Nothing.

Details

  • The request is sent as an interaction with the object the player last interacted with. Nothing is sent if there is no such object or if the network connection is not ready.
  • The client does not check whether the upgrade is actually in progress.
  • The function needs at least one argument and only reads the last one.

Errors

None besides the generic Invalid Parameters message when the argument is missing or not a number.

Example

From default/ea_interactionwindow/source/interactionkeepupgrades.lua:

elseif (keepUpgrade.localTargetLevel == keepUpgrade.currentLevel) then
    -- User wants to cancel the in-progress upgrade or downgrade
    CancelKeepUpgrade(keepUpgrade.id)
    keepUpgrade.time = 0
    EA_Window_InteractionKeepUpgrades.RemoveUpgradeFromActiveList(keepUpgrade.id)
end

See also