Skip to main content

Actionbars

Actionbars are grid containers that contain buttons. Spells can be assigned to the buttons, which allows clicking or using the appropriate hotkey to trigger the spell.

Layout
By default, there are two actionbars with 12 slots each. The number of columns is set to 12, making both actionbars horizontal. A menu option to resize, reposition, and to change the number of columns is planned, but not in active development at the moment.

Cooldown Swipes
When a spell is on cooldown, this needs to be reflected in the actionbar, such that the player knows the cooldown status. Therefore, a progressbar is used to display the cooldown as a swipe animation. A number display to state the cooldown in seconds is planned, but not in active development at the moment.

The cooldown swipe does not use the cooldown information of the spell on the server. Instead, the player has a cd_timer_container node, in which a cooldown timer is instantiated for every spell that the player knows. The trigger_cd function in the BaseSpell class, which triggers the spell cooldown on the server, also triggers the local cd timers in the player's cd_timer_container. The actionbar buttons use this local timer to display the current remaining cooldown on every frame.

As the wait_time of a cooldown timer can change in some circumstances, e.g. when using a spell reduces the cooldown of another spell, this is not used to normalize the cooldown swipe value. Doing so would lead the swipe to be reset every time a change to the cooldown is made. Instead, a cd_full_duration variable is set, which is equal to the duration given by the cooldown key in the current_spell dictionary of the spell. This way, the cooldown swipe is always relative to the full cooldown that a player expects from the spell.