To create the role bar, in addition to the basics described in the introduction post, I needed to make a click bar. Click bars are easy (3 cheers for Lax!). I wanted specialty behavior between the buttons. For example, I wanted the tank button (the first one) to switch the tank to "tank mode" or "dps mode" on a left click, and reset EVERYBODY on a right click. (NOTE: I am not talking about "switching roles" as Rift defines them in the souls mechanic. I am talking about specific behavioral roles -- like be a bard healer, do dps, throw sab charges, etc. -- these are all accomplished with the same 3 souls -- the same "role" in Rift-speak). Here's what I did for the first button:
I wanted the rogues to be able to change roles per rogue, to be able to change ALL the rogues roles, and to be able to reset the roles of the rogues only. Here's how I did it:
For the default setup (everyone in Role 1), I wanted the tank to be in tank mode, all three rogues to be in RDPS mode, and the cleric to be in healzor mode. Translating this into the information discussed above, that meant I wanted tank-specific abilities, RDPS-specific abilities and heal-specific abilities on the main bar (ability bar 1). I wanted Role 2 defined as: MDPS for the tank, bard mode for the rogues, and DPS for the cleric. Only the rogues have Role 3, which is sab mode. Here are various example combinations as shown on the role bar:
Warrior: Tank
Rogue1: RDPS
Rogue2: RDPS
Rogue3: RDPS
Cleric: Healzor
Warrior: Tank
Rogue1: Bard
Rogue2: RDPS
Rogue3: RDPS
Cleric: Healzor
Warrior: Tank
Rogue1: Sab
Rogue2: RDPS
Rogue3: RDPS
Cleric: Healzor
Warrior: Tank
Rogue1: Bard
Rogue2: Bard
Rogue3: RDPS
Cleric: Healzor
Warrior: Tank
Rogue1: Bard
Rogue2: Bard
Rogue3: Bard
Cleric: Healzor
Warrior: MDPS
Rogue1: RDPS
Rogue2: RDPS
Rogue3: RDPS
Cleric: Healzor
Warrior: Tank
Rogue1: RDPS
Rogue2: RDPS
Rogue3: RDPS
Cleric: DPS
Note that all combinations are possible -- these are just a few examples.
The first bit of coding that is necessary is to set the default modes. To accomplish this, I created a key map named RoleControl and added this mapped key:
Yeah, it just wraps a function call for each role. Each, role-specific function call looks like this, with the appropriate name and key maps:
Note the target for each key map state -- Window:Current (self). It MUST be this target.
Next, I needed something to call the initializer. In Always On, I created the following mapped key:
Next, It needs to be called with the character set is initialized or reset. To do that, do this on the main character set page:
Great! Now let's talk about changing a role. Basically, you need a key map for each TAG, and it must have a step for each role. Here's an example of a three role mapped key for my rogues (all of my TAGs cloned this and changed the names appropriately -- e.g. CombatR1 (n to n) becomes CombatT1 (n to n), etc.).
The first line of each step updates the button image. The second line toggles the n to n key map off and on, the next controls n to alt+n, the next n to ctrl+n. The next line maintains the state persistently (so I can swap to a different tune and have everyone still in the same roles). The final line moves everyone else to the same step (so that when I change to another character and click a role button, it is on the correct step in the mapped key).
To reset everyone, I just call the initialize step. To reset just the rogues, however, I needed another mapped key:
(no big surprises there).
Finally, I alluded to it above, but to maintain the state persistently, I need something that performs a context switch when I swap to a new character. Remember that the key maps are specific to the CHARACTER who is HOT, so if I swap characters, I need to update the key maps appropriately. Here's how I do that.
First, I created another mapped key in the Always On key map:
Then, for each character in the set, I made it call that mapped key when I swapped:
Finally, I just need a mapped key for each TAG, that mimics the state setting parts of the ChangeRole mapped keys. Here is an example from Rogue1 again. Note that I clicked the box that stops these steps from advancing. I control the steps in the ChangeRoles mapped keys, and DO NOT want this one to advance unless I've changed roles. Here are the three steps:
Whew. I think that's it