aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features/text
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-02-12 00:03:42 +0900
committersyeyoung <cyong06@naver.com>2021-02-12 00:03:42 +0900
commit89c82ad1fea9fd0a8e32a5e818c6c01856cdd660 (patch)
treeeb989b2e58b2b18480d41a262b9cabf1a0ba387d /src/main/java/kr/syeyoung/dungeonsguide/features/text
parent505cb6fc92e7d2c7412b43f459796791ca36e5a3 (diff)
downloadSkyblock-Dungeons-Guide-89c82ad1fea9fd0a8e32a5e818c6c01856cdd660.tar.gz
Skyblock-Dungeons-Guide-89c82ad1fea9fd0a8e32a5e818c6c01856cdd660.tar.bz2
Skyblock-Dungeons-Guide-89c82ad1fea9fd0a8e32a5e818c6c01856cdd660.zip
YES
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/text')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java17
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java6
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/text/TextStyle.java1
3 files changed, 21 insertions, 3 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java b/src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java
index 06ac0fca..3a87075c 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/text/PanelTextParameterConfig.java
@@ -13,6 +13,7 @@ import kr.syeyoung.dungeonsguide.gui.MPanel;
import kr.syeyoung.dungeonsguide.gui.elements.MButton;
import kr.syeyoung.dungeonsguide.gui.elements.MColor;
import kr.syeyoung.dungeonsguide.gui.elements.MEditableAColor;
+import kr.syeyoung.dungeonsguide.gui.elements.MToggleButton;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
@@ -35,6 +36,7 @@ public class PanelTextParameterConfig extends MPanel {
private MEditableAColor currentColor;
private MEditableAColor backgroundColor;
+ private MToggleButton shadow;
@Override
public void onBoundsUpdate() {
@@ -77,6 +79,17 @@ public class PanelTextParameterConfig extends MPanel {
}
});
add(backgroundColor);
+ shadow = new MToggleButton();
+ shadow.setSize(new Dimension(20, 10));
+ shadow.setBounds(new Rectangle(275 , 30, 20, 10));
+ shadow.setOnToggle(new Runnable() {
+ @Override
+ public void run() {
+ for (String se:selected)
+ feature.getStylesMap().get(se).setShadow(shadow.isEnabled());
+ }
+ });
+ add(shadow);
}
@@ -132,6 +145,7 @@ public class PanelTextParameterConfig extends MPanel {
GlStateManager.popMatrix();
fr.drawString("Text Color: ", 0, 10, 0xFFFFFFFF);
fr.drawString("Background Color: ", 100, 10, 0xFFFFFFFF);
+ fr.drawString("Shadow: ", 0, 26, 0xFFFFFFFF);
GlStateManager.popMatrix();
}
@@ -177,15 +191,18 @@ public class PanelTextParameterConfig extends MPanel {
if (selected.size() != 0) {
currentColor.setColor(styles.get(selected.iterator().next()).getColor());
backgroundColor.setColor(styles.get(selected.iterator().next()).getBackground());
+ shadow.setEnabled(styles.get(selected.iterator().next()).isShadow());
} else {
currentColor.setColor(new AColor(0xff555555, true));
backgroundColor.setColor(new AColor(0xff555555, true));
+ shadow.setEnabled(false);
}
}
if (selected.size() == 1) {
currentColor.setColor(styles.get(selected.iterator().next()).getColor());
backgroundColor.setColor(styles.get(selected.iterator().next()).getBackground());
+ shadow.setEnabled(styles.get(selected.iterator().next()).isShadow());
}
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java
index 4ab41379..c0e521f0 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextHUDFeature.java
@@ -90,7 +90,7 @@ public abstract class TextHUDFeature extends GuiFeature {
}
for (String str : getUsedTextStyle()) {
if (!res.containsKey(str))
- res.put(str, new TextStyle(str, new AColor(0xffffffff, true), new AColor(0x00777777, true)));
+ res.put(str, new TextStyle(str, new AColor(0xffffffff, true), new AColor(0x00777777, true), false));
}
stylesMap = res;
}
@@ -175,13 +175,13 @@ public abstract class TextHUDFeature extends GuiFeature {
Gui.drawRect(x,y, x+fr.getStringWidth(content), y + fr.FONT_HEIGHT, RenderUtils.getColorAt(x,y, style.getBackground()));
if (!style.getColor().isChroma()) {
- fr.drawString(content, x, y, style.getColor().getRGB());
+ fr.drawString(content, x, y, style.getColor().getRGB(), style.isShadow());
return new Dimension(fr.getStringWidth(content), fr.FONT_HEIGHT);
}else {
char[] charArr = content.toCharArray();
int width = 0;
for (int i = 0; i < charArr.length; i++) {
- fr.drawString(String.valueOf(charArr[i]), x + width, y, RenderUtils.getColorAt(x + width, y, style.getColor()));
+ fr.drawString(String.valueOf(charArr[i]), x + width, y, RenderUtils.getColorAt(x + width, y, style.getColor()), style.isShadow());
width += fr.getCharWidth(charArr[i]);
}
return new Dimension(width, fr.FONT_HEIGHT);
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextStyle.java b/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextStyle.java
index 0df4c9a5..74ee297b 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextStyle.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/text/TextStyle.java
@@ -14,4 +14,5 @@ public class TextStyle {
private String groupName;
private AColor color;
private AColor background;
+ private boolean shadow = false;
}