wasdplugin: Show Ironman Icons when chat is locked (#6347)
This commit is contained in:
@@ -39,6 +39,7 @@ import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Experience;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.IconID;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
@@ -811,15 +812,15 @@ public class ChatCommandsPlugin extends Plugin implements ChatboxInputListener
|
||||
*/
|
||||
private static HiscoreEndpoint getHiscoreEndpointByName(final String name)
|
||||
{
|
||||
if (name.contains("<img=2>"))
|
||||
if (name.contains(IconID.IRONMAN.toString()))
|
||||
{
|
||||
return toEndPoint(AccountType.IRONMAN);
|
||||
}
|
||||
else if (name.contains("<img=3>"))
|
||||
else if (name.contains(IconID.ULTIMATE_IRONMAN.toString()))
|
||||
{
|
||||
return toEndPoint(AccountType.ULTIMATE_IRONMAN);
|
||||
}
|
||||
else if (name.contains("<img=10>"))
|
||||
else if (name.contains(IconID.HARDCORE_IRONMAN.toString()))
|
||||
{
|
||||
return toEndPoint(AccountType.HARDCORE_IRONMAN);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.IconID;
|
||||
import net.runelite.api.VarClientInt;
|
||||
import net.runelite.api.VarClientStr;
|
||||
import net.runelite.api.Varbits;
|
||||
@@ -141,7 +142,7 @@ public class WASDCameraPlugin extends Plugin
|
||||
{
|
||||
if (chatboxFocused() && !typing)
|
||||
{
|
||||
chatboxInput.setText(client.getLocalPlayer().getName() + ": " + PRESS_ENTER_TO_CHAT);
|
||||
chatboxInput.setText(getPlayerNameWithIcon() + ": " + PRESS_ENTER_TO_CHAT);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -164,7 +165,7 @@ public class WASDCameraPlugin extends Plugin
|
||||
Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT);
|
||||
if (chatboxInput != null)
|
||||
{
|
||||
chatboxInput.setText(client.getLocalPlayer().getName() + ": " + PRESS_ENTER_TO_CHAT);
|
||||
chatboxInput.setText(getPlayerNameWithIcon() + ": " + PRESS_ENTER_TO_CHAT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,9 +182,29 @@ public class WASDCameraPlugin extends Plugin
|
||||
{
|
||||
final boolean isChatboxTransparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1;
|
||||
final Color textColor = isChatboxTransparent ? JagexColors.CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND : JagexColors.CHAT_TYPED_TEXT_OPAQUE_BACKGROUND;
|
||||
chatboxInput.setText(client.getLocalPlayer().getName() + ": " + ColorUtil.wrapWithColorTag(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT) + "*", textColor));
|
||||
chatboxInput.setText(getPlayerNameWithIcon() + ": " + ColorUtil.wrapWithColorTag(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT) + "*", textColor));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getPlayerNameWithIcon()
|
||||
{
|
||||
IconID icon;
|
||||
switch (client.getAccountType())
|
||||
{
|
||||
case IRONMAN:
|
||||
icon = IconID.IRONMAN;
|
||||
break;
|
||||
case ULTIMATE_IRONMAN:
|
||||
icon = IconID.ULTIMATE_IRONMAN;
|
||||
break;
|
||||
case HARDCORE_IRONMAN:
|
||||
icon = IconID.HARDCORE_IRONMAN;
|
||||
break;
|
||||
default:
|
||||
return client.getLocalPlayer().getName();
|
||||
}
|
||||
return icon + client.getLocalPlayer().getName();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user