mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 21:32:19 +00:00
Enhance ability selection and display: add toggleable ability handling, improve ability name color coding, and update ability selection messaging
This commit is contained in:
1 parent
45d05b9157
commit
ce24c0a4ff
7 files changed
+86
-16
No files matched your search
@@ -63,7 +63,9 @@ public class ClientTickHandler {
|
||||
if (event.phase == Phase.START) {
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
if (player != null) {
|
||||
boolean specialKeyDown = ClientProxy.SpecialKey != null && Keyboard.isKeyDown(ClientProxy.SpecialKey.getKeyCode());
|
||||
// Only process special key when no GUI screen is open
|
||||
boolean specialKeyDown = mc.currentScreen == null
|
||||
&& ClientProxy.SpecialKey != null && Keyboard.isKeyDown(ClientProxy.SpecialKey.getKeyCode());
|
||||
if (specialKeyDown != lastSpecialKeyDown) {
|
||||
PlayerData data = CustomNpcs.proxy.getPlayerData(player);
|
||||
if (data != null) {
|
||||
|
||||
@@ -317,9 +317,11 @@ public class GuiNPCAbilities extends GuiNPCInterface2 implements IScrollData, IC
|
||||
// Toggle selected ability on/off
|
||||
if (id == 77) {
|
||||
if (selectedAbilityIndex >= 0 && selectedAbilityIndex < npcSlots.size()) {
|
||||
Ability ability = npcSlots.get(selectedAbilityIndex).getAbility();
|
||||
AbilitySlot slot = npcSlots.get(selectedAbilityIndex);
|
||||
Ability ability = slot.getAbility();
|
||||
if (ability != null) {
|
||||
ability.setEnabled(((GuiNpcButton) guibutton).getValue() == 1);
|
||||
boolean enabled = ((GuiNpcButton) guibutton).getValue() == 1;
|
||||
slot.setEnabled(enabled);
|
||||
updateNpcAbilitiesList();
|
||||
selectAbilityByIndex(selectedAbilityIndex);
|
||||
initGui();
|
||||
|
||||
Reference in new issue
Block a user