aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-24 16:15:00 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-24 16:15:00 +0900
commit8c45dda66cf5f37066f02c22ceb36509d0ac35c2 (patch)
tree9d0bb9f80653b39f3529790d5f9bfa2b9658f60b /src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java
parent0593c1b6390ddf7c92c6a5ddab3e31c5f6e59e7d (diff)
downloadSkyblock-Dungeons-Guide-8c45dda66cf5f37066f02c22ceb36509d0ac35c2.tar.gz
Skyblock-Dungeons-Guide-8c45dda66cf5f37066f02c22ceb36509d0ac35c2.tar.bz2
Skyblock-Dungeons-Guide-8c45dda66cf5f37066f02c22ceb36509d0ac35c2.zip
save and edit generic roomdata
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java
new file mode 100644
index 00000000..d8345eb6
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/GeneralEditPane.java
@@ -0,0 +1,94 @@
+package kr.syeyoung.dungeonsguide.roomedit.panes;
+
+import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
+import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry;
+import kr.syeyoung.dungeonsguide.roomedit.MPanel;
+import kr.syeyoung.dungeonsguide.roomedit.elements.*;
+
+import java.awt.*;
+
+public class GeneralEditPane extends MPanel {
+ private DungeonRoom dungeonRoom;
+
+ private MLabelAndElement uuid;
+ private MLabelAndElement name;
+
+ private MLabelAndElement shape;
+ private MLabelAndElement rotation;
+ private MLabelAndElement shape2;
+
+ private MButton save;
+
+ public GeneralEditPane(final DungeonRoom dungeonRoom) {
+ this.dungeonRoom = dungeonRoom;
+System.out.println("building");
+ {
+ MLabel la;
+ uuid = new MLabelAndElement("Room UUID: ", la = new MLabel());
+ la.setText(dungeonRoom.getDungeonRoomInfo().getUuid().toString());
+ uuid.setBounds(new Rectangle(0,0,bounds.width, 20));
+ add(uuid);
+ }
+ {
+ MTextField la = new MTextField() {
+ @Override
+ public void edit(String str) {
+ System.out.println(str);
+ dungeonRoom.getDungeonRoomInfo().setName(str);
+ }
+ };
+ name = new MLabelAndElement("Room Name: ", la);
+ la.setText(dungeonRoom.getDungeonRoomInfo().getName());
+ name.setBounds(new Rectangle(0,20,bounds.width, 20));
+ add(name);
+ }
+
+ {
+ MLabel la;
+ shape = new MLabelAndElement("Room Shape: ", la = new MLabel());
+ la.setText(dungeonRoom.getDungeonRoomInfo().getShape()+"");
+ shape.setBounds(new Rectangle(0,40,bounds.width, 20));
+ add(shape);
+ }
+
+ {
+ MLabel la;
+ rotation = new MLabelAndElement("Found Room Rotation: ", la = new MLabel());
+ la.setText(dungeonRoom.getRoomMatcher().getRotation()+"");
+ rotation.setBounds(new Rectangle(0,60,bounds.width, 20));
+ add(rotation);
+ }
+ {
+ MLabel la;
+ shape2 = new MLabelAndElement("Found Room Shape: ", la = new MLabel());
+ la.setText(dungeonRoom.getShape()+"");
+ shape2.setBounds(new Rectangle(0,80,bounds.width, 20));
+ add(shape2);
+ }
+ {
+ System.out.println("roomdata");
+ if (dungeonRoom.getDungeonRoomInfo().isRegistered()) return;
+ System.out.println("roomdata");
+ save = new MButton();
+ save.setText("Save RoomData");
+ save.setOnActionPerformed(new Runnable() {
+ @Override
+ public void run() {
+ DungeonRoomInfoRegistry.register(dungeonRoom.getDungeonRoomInfo());
+ remove(save);
+ }
+ });
+ save.setBackgroundColor(Color.green);
+ save.setBounds(new Rectangle(1,100,bounds.width-2, 20));
+ System.out.println("roomdata");
+ add(save);
+ System.out.println(save.getBounds());
+ }
+ }
+
+ @Override
+ public void resize(int parentWidth, int parentHeight) {
+ save.setBounds(new Rectangle(0,100,bounds.width, 20));
+ this.setBounds(new Rectangle(5,5,parentWidth-10,parentHeight-10));
+ }
+}