aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rwxr-xr-xmod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonAddSet.java21
-rwxr-xr-xmod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonParameterEdit.java23
-rwxr-xr-xmod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonRoomEdit.java12
-rwxr-xr-xmod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonValueEdit.java18
4 files changed, 53 insertions, 21 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonAddSet.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonAddSet.java
index 325d6b24..969c5b1e 100755
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonAddSet.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonAddSet.java
@@ -23,10 +23,12 @@ import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.EditingContext;
import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.valueedit.ValueEditOffsetPointSet;
import kr.syeyoung.dungeonsguide.mod.gui.MGui;
import kr.syeyoung.dungeonsguide.mod.gui.elements.MButton;
+import kr.syeyoung.dungeonsguide.mod.gui.elements.MPanelScaledGUI;
import kr.syeyoung.dungeonsguide.mod.gui.elements.MValue;
import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils;
import lombok.Getter;
import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.ScaledResolution;
import java.awt.*;
import java.util.ArrayList;
@@ -78,8 +80,13 @@ public class GuiDungeonAddSet extends MGui {
}
public GuiDungeonAddSet(final ValueEditOffsetPointSet processorParameterEditPane) {
+ MPanelScaledGUI scaledGUI = new MPanelScaledGUI();
+ scaledGUI.setScale(new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor());
+ getMainPanel().add(scaledGUI);
+
+
this.valueEditOffsetPointSet = processorParameterEditPane;
- getMainPanel().setBackgroundColor(new Color(17, 17, 17, 179));
+ scaledGUI.setBackgroundColor(new Color(17, 17, 17, 179));
{
start = new OffsetPoint(EditingContext.getEditingContext().getRoom(), Minecraft.getMinecraft().thePlayer.getPosition());
end = new OffsetPoint(EditingContext.getEditingContext().getRoom(), Minecraft.getMinecraft().thePlayer.getPosition());
@@ -87,10 +94,10 @@ public class GuiDungeonAddSet extends MGui {
{
MValue mValue = new MValue(start, Collections.emptyList());
mValue.setBounds(new Rectangle(0,0,150,20));
- getMainPanel().add(mValue);
+ scaledGUI.add(mValue);
MValue mValue2 = new MValue(end,Collections.emptyList());
mValue2.setBounds(new Rectangle(0,20,150,20));
- getMainPanel().add(mValue2);
+ scaledGUI.add(mValue2);
}
{
add = new MButton() {
@@ -123,8 +130,8 @@ public class GuiDungeonAddSet extends MGui {
EditingContext.getEditingContext().goBack();
}
});
- getMainPanel().add(add);
- getMainPanel().add(back);
+ scaledGUI.add(add);
+ scaledGUI.add(back);
}
}
@@ -132,6 +139,8 @@ public class GuiDungeonAddSet extends MGui {
public void initGui() {
super.initGui();
// update bounds
- getMainPanel().setBounds(new Rectangle(10, Math.min((Minecraft.getMinecraft().displayHeight - 300) / 2, Minecraft.getMinecraft().displayHeight),200,300));
+ int w = 200 * new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor(),
+ h = 300 * new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor();
+ getMainPanel().getChildComponents().get(0).setBounds(new Rectangle(10, Math.min((Minecraft.getMinecraft().displayHeight - h) / 2, Minecraft.getMinecraft().displayHeight),w,h));
}
}
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonParameterEdit.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonParameterEdit.java
index 0608e74c..24d68806 100755
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonParameterEdit.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonParameterEdit.java
@@ -31,6 +31,7 @@ import kr.syeyoung.dungeonsguide.mod.gui.MPanel;
import kr.syeyoung.dungeonsguide.mod.gui.elements.*;
import lombok.Getter;
import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.ScaledResolution;
import java.awt.*;
@@ -50,8 +51,13 @@ public class GuiDungeonParameterEdit extends MGui {
private ValueEdit valueEdit;
public GuiDungeonParameterEdit(final MParameter parameter2, final DynamicEditor processorParameterEditPane) {
+ MPanelScaledGUI scaledGUI = new MPanelScaledGUI();
+ scaledGUI.setScale(new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor());
+ getMainPanel().add(scaledGUI);
+
+
dungeonRoom = EditingContext.getEditingContext().getRoom();
- getMainPanel().setBackgroundColor(new Color(17, 17, 17, 179));
+ scaledGUI.setBackgroundColor(new Color(17, 17, 17, 179));
this.parameter = parameter2.getParameter();
{
MTextField mTextField = new MTextField() {
@@ -64,7 +70,7 @@ public class GuiDungeonParameterEdit extends MGui {
mTextField.setText(parameter.getName());
mLabelAndElement.setBounds(new Rectangle(0,0,200, 20));
- getMainPanel().add(mLabelAndElement);
+ scaledGUI.add(mLabelAndElement);
}
{
classSelection = parameter.getNewData() == null ?"null" : parameter.getNewData().getClass().getName();
@@ -89,7 +95,7 @@ public class GuiDungeonParameterEdit extends MGui {
}
});
mStringSelectionButton.setBounds(new Rectangle(0,20,150,20));
- getMainPanel().add(mStringSelectionButton);
+ scaledGUI.add(mStringSelectionButton);
}
{
currentValueEdit = new MPanel(){
@@ -98,7 +104,7 @@ public class GuiDungeonParameterEdit extends MGui {
setBounds(new Rectangle(0, 40, parentWidth,parentHeight - 60));
}
};
- getMainPanel().add(currentValueEdit);
+ scaledGUI.add(currentValueEdit);
}
{
delete = new MButton() {
@@ -131,8 +137,8 @@ public class GuiDungeonParameterEdit extends MGui {
EditingContext.getEditingContext().goBack();
}
});
- getMainPanel().add(delete);
- getMainPanel().add(save);
+ scaledGUI.add(delete);
+ scaledGUI.add(save);
}
updateClassSelection();
}
@@ -169,6 +175,9 @@ public class GuiDungeonParameterEdit extends MGui {
public void initGui() {
super.initGui();
// update bounds
- getMainPanel().setBounds(new Rectangle(10, Math.min((Minecraft.getMinecraft().displayHeight - 300) / 2, Minecraft.getMinecraft().displayHeight),200,300));
+
+ int w = 200 * new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor(),
+ h = 300 * new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor();
+ getMainPanel().getChildComponents().get(0).setBounds(new Rectangle(10, Math.min((Minecraft.getMinecraft().displayHeight - h) / 2, Minecraft.getMinecraft().displayHeight),w,h));
}
}
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonRoomEdit.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonRoomEdit.java
index 229f0631..35e3884e 100755
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonRoomEdit.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonRoomEdit.java
@@ -22,9 +22,11 @@ package kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.gui;
import kr.syeyoung.dungeonsguide.mod.dungeon.roomedit.panes.*;
import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom;
import kr.syeyoung.dungeonsguide.mod.gui.MGui;
+import kr.syeyoung.dungeonsguide.mod.gui.elements.MPanelScaledGUI;
import kr.syeyoung.dungeonsguide.mod.gui.elements.MTabbedPane;
import lombok.Getter;
import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.ScaledResolution;
import java.awt.*;
@@ -38,9 +40,12 @@ public class GuiDungeonRoomEdit extends MGui {
public GuiDungeonRoomEdit(DungeonRoom room) {
this.room = room;
+ MPanelScaledGUI scaledGUI = new MPanelScaledGUI();
+ scaledGUI.setScale(new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor());
+ getMainPanel().add(scaledGUI);
MTabbedPane tabbedPane = new MTabbedPane();
- getMainPanel().add(tabbedPane);
+ scaledGUI.add(tabbedPane);
tabbedPane.setBackground2(new Color(17, 17, 17, 179));
@@ -63,7 +68,8 @@ public class GuiDungeonRoomEdit extends MGui {
@Override
public void initGui() {
super.initGui();
- // update bounds
- getMainPanel().setBounds(new Rectangle(Math.min((Minecraft.getMinecraft().displayWidth - 500) / 2, Minecraft.getMinecraft().displayWidth), Math.min((Minecraft.getMinecraft().displayHeight - 300) / 2, Minecraft.getMinecraft().displayHeight),500,300));
+ int w = 500 * new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor();
+ int h = 300 * new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor();
+ getMainPanel().getChildComponents().get(0).setBounds(new Rectangle(Math.min((Minecraft.getMinecraft().displayWidth - w) / 2, Minecraft.getMinecraft().displayWidth), Math.min((Minecraft.getMinecraft().displayHeight - h) / 2, Minecraft.getMinecraft().displayHeight),w,h));
}
}
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonValueEdit.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonValueEdit.java
index 08b36b17..4ca104c0 100755
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonValueEdit.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/gui/GuiDungeonValueEdit.java
@@ -29,8 +29,10 @@ import kr.syeyoung.dungeonsguide.mod.gui.MGui;
import kr.syeyoung.dungeonsguide.mod.gui.MPanel;
import kr.syeyoung.dungeonsguide.mod.gui.elements.MButton;
import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabel;
+import kr.syeyoung.dungeonsguide.mod.gui.elements.MPanelScaledGUI;
import lombok.Getter;
import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.ScaledResolution;
import java.awt.*;
import java.util.List;
@@ -52,10 +54,14 @@ public class GuiDungeonValueEdit extends MGui {
public GuiDungeonValueEdit(final Object object, final List<MPanel> addons) {
try {
+ MPanelScaledGUI scaledGUI = new MPanelScaledGUI();
+ scaledGUI.setScale(new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor());
+ getMainPanel().add(scaledGUI);
+
dungeonRoom = EditingContext.getEditingContext().getRoom();
this.addons = addons;
this.editingObj = object;
- getMainPanel().setBackgroundColor(new Color(17, 17, 17, 179));
+ scaledGUI.setBackgroundColor(new Color(17, 17, 17, 179));
{
currentValueEdit = new MPanel() {
@Override
@@ -63,11 +69,11 @@ public class GuiDungeonValueEdit extends MGui {
setBounds(new Rectangle(0, 0, parentWidth, parentHeight - 20 - addons.size() * 20));
}
};
- getMainPanel().add(currentValueEdit);
+ scaledGUI.add(currentValueEdit);
}
for (MPanel addon : addons) {
- getMainPanel().add(addon);
+ scaledGUI.add(addon);
}
{
save = new MButton() {
@@ -84,7 +90,7 @@ public class GuiDungeonValueEdit extends MGui {
EditingContext.getEditingContext().goBack();
}
});
- getMainPanel().add(save);
+ scaledGUI.add(save);
}
updateClassSelection();
} catch (Exception e){}
@@ -117,7 +123,9 @@ public class GuiDungeonValueEdit extends MGui {
public void initGui() {
super.initGui();
// update bounds
- getMainPanel().setBounds(new Rectangle(10, Math.min((Minecraft.getMinecraft().displayHeight - 300) / 2, Minecraft.getMinecraft().displayHeight),200,300));
+ int w = 200 * new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor(),
+ h = 300 * new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor();
+ getMainPanel().getChildComponents().get(0).setBounds(new Rectangle(10, Math.min((Minecraft.getMinecraft().displayHeight - h) / 2, Minecraft.getMinecraft().displayHeight),w,h));
for (int i = 0; i < addons.size(); i++) {