Skip to content

Commit e2b3401

Browse files
committed
feat: Teammate Class Color can now be customized as RGB
feat: Teammate Name Overlay now compatible with Text Style However, the Fade Chroma option has been removed. Fade Chroma is not stable because it is affected by scaling and therefore appears as an eye-straining color. Also, All The Same Chroma also works in sync with the outline color.
1 parent 84f8893 commit e2b3401

File tree

4 files changed

+40
-30
lines changed

4 files changed

+40
-30
lines changed

src/main/java/codes/biscuit/skyblockaddons/config/ConfigValuesManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,11 @@ private void firstLoadChecks(Feature feature, FeatureData<?> featureData) {
505505
if (!settings.containsKey(defaultSetting)) {
506506
// New sub-setting entry
507507
settings.put(defaultSetting, defaultValue);
508+
LOGGER.info("New '{}' FeatureSetting loaded for '{}' Feature.", defaultSetting, feature);
508509
} else if (defaultValue.getClass() != settings.get(defaultSetting).getClass()) {
509510
// The sub-setting value is overridden by different type
510511
settings.put(defaultSetting, defaultValue);
512+
LOGGER.warn("'{}' FeatureSetting for '{}' Feature has been updated with new defaults!", defaultSetting, feature);
511513
}
512514
}
513515
}

src/main/java/codes/biscuit/skyblockaddons/features/dungeon/DungeonClass.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,25 @@ public static DungeonClass fromDisplayName(String name) {
4747
return null;
4848
}
4949

50-
public ColorCode getColor() {
50+
public int getColor() {
5151
Feature feature = Feature.SHOW_DUNGEON_TEAMMATE_NAME_OVERLAY;
5252
if (feature.isEnabled()) {
5353
switch (this) {
5454
case HEALER:
55-
return (ColorCode) feature.get(FeatureSetting.HEALER_COLOR);
55+
return feature.getAsNumber(FeatureSetting.HEALER_COLOR).intValue();
5656
case MAGE:
57-
return (ColorCode) feature.get(FeatureSetting.MAGE_COLOR);
57+
return feature.getAsNumber(FeatureSetting.MAGE_COLOR).intValue();
5858
case BERSERK:
59-
return (ColorCode) feature.get(FeatureSetting.BERSERK_COLOR);
59+
return feature.getAsNumber(FeatureSetting.BERSERK_COLOR).intValue();
6060
case ARCHER:
61-
return (ColorCode) feature.get(FeatureSetting.ARCHER_COLOR);
61+
return feature.getAsNumber(FeatureSetting.ARCHER_COLOR).intValue();
6262
case TANK:
63-
return (ColorCode) feature.get(FeatureSetting.TANK_COLOR);
63+
return feature.getAsNumber(FeatureSetting.TANK_COLOR).intValue();
6464
default:
65-
return this.defaultColor;
65+
return this.defaultColor.getColor();
6666
}
6767
} else {
68-
return this.defaultColor;
68+
return this.defaultColor.getColor();
6969
}
7070
}
7171
}

src/main/java/codes/biscuit/skyblockaddons/features/dungeon/DungeonManager.java

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import codes.biscuit.skyblockaddons.SkyblockAddons;
44
import codes.biscuit.skyblockaddons.core.EssenceType;
5+
import codes.biscuit.skyblockaddons.core.chroma.ManualChromaManager;
56
import codes.biscuit.skyblockaddons.core.feature.Feature;
67
import codes.biscuit.skyblockaddons.core.feature.FeatureSetting;
78
import codes.biscuit.skyblockaddons.events.RenderEntityOutlineEvent;
@@ -106,8 +107,8 @@ public class DungeonManager {
106107
if (e instanceof EntityOtherPlayerMP) {
107108
String profileName = ((EntityOtherPlayerMP) e).getGameProfile().getName();
108109
DungeonPlayer teammate = SkyblockAddons.getInstance().getDungeonManager().getDungeonPlayerByName(profileName);
109-
if (teammate != null) {
110-
return teammate.getDungeonClass().getColor().getColor();
110+
if (teammate != null && teammate.getDungeonClass() != null) {
111+
return teammate.getDungeonClass().getColor();
111112
}
112113
// NPCs don't have a color on their team. Don't show them on outlines.
113114
return null;
@@ -385,17 +386,18 @@ public void onRenderLivingName(RenderLivingEvent.Specials.Pre<EntityLivingBase>
385386
return;
386387
}
387388

388-
if (main.getUtils().isOnSkyblock() && main.getUtils().isInDungeon()
389-
&& (Feature.SHOW_CRITICAL_DUNGEONS_TEAMMATES.isEnabled() || Feature.SHOW_DUNGEON_TEAMMATE_NAME_OVERLAY.isEnabled())
390-
) {
389+
boolean nameOverlayEnabled = Feature.SHOW_DUNGEON_TEAMMATE_NAME_OVERLAY.isEnabled();
390+
boolean criticalOverlayEnabled = Feature.SHOW_CRITICAL_DUNGEONS_TEAMMATES.isEnabled();
391+
392+
if (main.getUtils().isOnSkyblock() && main.getUtils().isInDungeon() && (criticalOverlayEnabled || nameOverlayEnabled)) {
391393
final Entity renderViewEntity = MC.getRenderViewEntity();
392394
String profileName = player.getName();
393395
DungeonPlayer dungeonPlayer = main.getDungeonManager().getTeammates().getOrDefault(profileName, null);
394396

395397
if (renderViewEntity != player && dungeonPlayer != null) {
396398
double newY = e.y + player.height;
397399

398-
if (Feature.SHOW_DUNGEON_TEAMMATE_NAME_OVERLAY.isEnabled()) {
400+
if (nameOverlayEnabled) {
399401
newY += 0.35F;
400402
}
401403

@@ -422,7 +424,7 @@ public void onRenderLivingName(RenderLivingEvent.Specials.Pre<EntityLivingBase>
422424
GlStateManager.enableTexture2D();
423425
GlStateManager.color(1, 1, 1, 1);
424426

425-
if (Feature.SHOW_CRITICAL_DUNGEONS_TEAMMATES.isEnabled() && !dungeonPlayer.isGhost()
427+
if (criticalOverlayEnabled && !dungeonPlayer.isGhost()
426428
&& (dungeonPlayer.isCritical() || dungeonPlayer.isLow())) {
427429
MC.getTextureManager().bindTexture(CRITICAL);
428430
DrawUtils.drawModalRectWithCustomSizedTexture(-CRITICAL_ICON_SIZE / 2F, -CRITICAL_ICON_SIZE, 0, 0, CRITICAL_ICON_SIZE, CRITICAL_ICON_SIZE, CRITICAL_ICON_SIZE, CRITICAL_ICON_SIZE);
@@ -448,16 +450,22 @@ public void onRenderLivingName(RenderLivingEvent.Specials.Pre<EntityLivingBase>
448450
e.setCanceled(true);
449451
}
450452

451-
if (!dungeonPlayer.isGhost() && Feature.SHOW_DUNGEON_TEAMMATE_NAME_OVERLAY.isEnabled()) {
452-
String nameOverlay =
453-
ColorCode.YELLOW + "[" + dungeonPlayer.getDungeonClass().getFirstLetter() + "] "
454-
+ dungeonPlayer.getDungeonClass().getColor() + profileName;
455-
MC.fontRendererObj.drawString(
456-
nameOverlay,
457-
-MC.fontRendererObj.getStringWidth(nameOverlay) / 2F,
458-
CRITICAL_ICON_SIZE / 2F + 2,
459-
-1,
460-
true
453+
if (!dungeonPlayer.isGhost() && dungeonPlayer.getDungeonClass() != null && nameOverlayEnabled) {
454+
String dungeonClass = ColorCode.YELLOW + "[" + dungeonPlayer.getDungeonClass().getFirstLetter() + "] ";
455+
float nameX = MC.fontRendererObj.getStringWidth(dungeonClass.concat(profileName)) / 2F;
456+
float nameY = CRITICAL_ICON_SIZE / 2F + 2;
457+
458+
DrawUtils.drawText(dungeonClass, -nameX, nameY, -1);
459+
460+
int classColor = dungeonPlayer.getDungeonClass().getColor();
461+
if (classColor == ColorCode.CHROMA.getColor()) {
462+
classColor = ManualChromaManager.getChromaColor(0, 0, 255);
463+
}
464+
DrawUtils.drawText(
465+
profileName,
466+
-nameX + MC.fontRendererObj.getStringWidth(dungeonClass),
467+
nameY,
468+
classColor
461469
);
462470

463471
String health = dungeonPlayer.getHealth() + (ColorCode.RED + "❤");

src/main/resources/defaults.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,11 @@
594594
"value": true,
595595
"settings": {
596596
"CLASS_COLORED_TEAMMATE": true,
597-
"HEALER_COLOR": "LIGHT_PURPLE",
598-
"MAGE_COLOR": "AQUA",
599-
"BERSERK_COLOR": "DARK_RED",
600-
"ARCHER_COLOR": "GOLD",
601-
"TANK_COLOR": "DARK_GREEN"
597+
"HEALER_COLOR": -43521,
598+
"MAGE_COLOR": -11141121,
599+
"BERSERK_COLOR": -5636096,
600+
"ARCHER_COLOR": -22016,
601+
"TANK_COLOR": -16733696
602602
}
603603
},
604604
"SHOW_STACKING_ENCHANT_PROGRESS": {

0 commit comments

Comments
 (0)