Yong Min Administrator
Gender : Posts : 144 Points : 409 Reputation : 27 Join date : 2011-11-11
| Subject: Right Click Rank Displaying Mon Jan 16, 2012 12:10 pm | |
| If you want to add an option when you right click a member of staff to display that staff members rank, then you will need to make a few minor additions to the mudclient class. Firstly, open up your mudclient class in your client source, and find: - Code:
-
if (selectedSpell >= 0) { if (EntityHandler.getSpellDef(selectedSpell).getSpellType() == 1 || EntityHandler.getSpellDef(selectedSpell).getSpellType() == 2) { menuText1[menuLength] = "Cast " + EntityHandler.getSpellDef(selectedSpell).getName() + " on"; menuText2[menuLength] = "@whi@" + playerArray[i2].name + s; menuID[menuLength] = 800; menuActionX[menuLength] = playerArray[i2].currentX; menuActionY[menuLength] = playerArray[i2].currentY; menuActionType[menuLength] = playerArray[i2].serverIndex; menuActionVariable[menuLength] = selectedSpell; menuLength++; } }
Above this, add: - Code:
-
/** * Staff Rank Displayer * @author Yong Min */ String staffRank = ""; boolean displayRank = false; if((playerArray[i2].admin == 1) || (playerArray[i2].admin == 2) || (playerArray[i2].admin == 3)) { displayRank = true; } if(playerArray[i2].admin == 1) { // Player Moderator staffRank = "#pmd#@gre@ Player Mod"; } else if(playerArray[i2].admin == 2) { // Moderator staffRank = "#mod#@gry@ Mod"; } else if(playerArray[i2].admin == 3) { // Administrator staffRank = "#adm#@yel@ Admin"; } if(displayRank) { menuText1[menuLength] = "Rank: "; menuText2[menuLength] = staffRank; menuID[menuLength] = 3000; menuLength++; }
Now open up your GameImage class which is also client sided, and find: - Code:
-
else if (string.substring(offset + 1, offset + 4).equalsIgnoreCase("gr3")) colour = 0x40ff00;
Under this, add: - Code:
-
else if (string.substring(offset +1, offset + 4).equalsIgnoreCase("gry")) colour = -2302756;
This is how this feature will appear in game: | |
|