19
19
@ Mixin (TitleScreen .class )
20
20
public class MTitleScreen extends Screen {
21
21
22
+ // Valid positions: "top_left" && "bottom_right".
23
+ // DM 8Blits if you would like to have the numbers be in another position, or if you want other texture changes.
24
+ private static final String NUM_LOCATION = "top_left" ;
25
+
22
26
private final Identifier identifier_main = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/df.png" );
23
- private final Identifier identifier_beta = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/beta.png" );
24
- private final Identifier identifier_node1 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/node1.png" );
25
- private final Identifier identifier_node2 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/node2.png" );
26
- private final Identifier identifier_node3 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/node3.png" );
27
- private final Identifier identifier_node4 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/node4-valley.png" );
28
- private final Identifier identifier_node5 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/node5.png" );
27
+ private final Identifier identifier_beta = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/" + NUM_LOCATION + "/beta.png" );
28
+ private final Identifier identifier_node1 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/" + NUM_LOCATION + "/node1.png" );
29
+ private final Identifier identifier_node2 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/" + NUM_LOCATION + "/node2.png" );
30
+ private final Identifier identifier_node3 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/" + NUM_LOCATION + "/node3.png" );
31
+ private final Identifier identifier_node4 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/" + NUM_LOCATION + "/node4.png" );
32
+ private final Identifier identifier_node5 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/" + NUM_LOCATION + "/node5.png" );
33
+ private final Identifier identifier_node6 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/" + NUM_LOCATION + "/node6.png" );
34
+ private final Identifier identifier_node7 = new Identifier (CodeUtilities .MOD_ID + ":textures/gui/" + NUM_LOCATION + "/node7.png" );
29
35
30
36
protected MTitleScreen (LiteralText title ) {
31
37
super (title );
@@ -35,6 +41,7 @@ protected MTitleScreen(LiteralText title) {
35
41
public void drawMenuButton (int y , int spacingY , CallbackInfo info ) {
36
42
if (Config .getBoolean ("dfButton" )) {
37
43
if (!Config .getBoolean ("dfNodeButtons" )) {
44
+ // Default Server Join
38
45
this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 , y + spacingY , 20 , 20 , 0 , 0 , 20 , identifier_main , 20 , 40 ,
39
46
(button ) -> {
40
47
MinecraftClient mc = MinecraftClient .getInstance ();
@@ -50,54 +57,77 @@ public void drawMenuButton(int y, int spacingY, CallbackInfo info) {
50
57
modMenuButtonPresent = io .github .codeutilities .sys .util .ModMenuSupport .isModsButtonPresent ();
51
58
}
52
59
60
+ // Default Server Join
53
61
this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 , y - spacingY , 20 , 20 , 0 , 0 , 20 , identifier_main , 20 , 40 ,
54
62
(button ) -> {
55
63
MinecraftClient mc = MinecraftClient .getInstance ();
56
64
ServerInfo serverInfo = new ServerInfo ("DF" , "mcdiamondfire.com:25565" , false );
57
65
mc .openScreen (new ConnectScreen (mc .currentScreen , mc , serverInfo ));
58
66
}));
59
67
68
+ // Node Beta
60
69
this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 + 22 , y - spacingY , 20 , 20 , 0 , 0 , 20 , identifier_beta , 20 , 40 ,
61
70
(button ) -> {
62
71
MinecraftClient mc = MinecraftClient .getInstance ();
63
72
ServerInfo serverInfo = new ServerInfo ("DF Beta" , "beta.mcdiamondfire.com:25565" , false );
64
73
mc .openScreen (new ConnectScreen (mc .currentScreen , mc , serverInfo ));
65
74
}));
66
75
67
- this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 , y , 20 , 20 , 0 , 0 , 20 , identifier_node1 , 20 , 40 ,
76
+ // Node 1
77
+ this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 + 44 , y - spacingY , 20 , 20 , 0 , 0 , 20 , identifier_node1 , 20 , 40 ,
68
78
(button ) -> {
69
79
MinecraftClient mc = MinecraftClient .getInstance ();
70
80
ServerInfo serverInfo = new ServerInfo ("DF Node1" , "node1.mcdiamondfire.com:25565" , false );
71
81
mc .openScreen (new ConnectScreen (mc .currentScreen , mc , serverInfo ));
72
82
}));
73
83
74
- this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 + 22 , y , 20 , 20 , 0 , 0 , 20 , identifier_node2 , 20 , 40 ,
84
+ // Node 2
85
+ this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 , y , 20 , 20 , 0 , 0 , 20 , identifier_node2 , 20 , 40 ,
75
86
(button ) -> {
76
87
MinecraftClient mc = MinecraftClient .getInstance ();
77
88
ServerInfo serverInfo = new ServerInfo ("DF Node2" , "node2.mcdiamondfire.com:25565" , false );
78
89
mc .openScreen (new ConnectScreen (mc .currentScreen , mc , serverInfo ));
79
90
}));
80
91
81
- this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 , y + spacingY , 20 , 20 , 0 , 0 , 20 , identifier_node3 , 20 , 40 ,
92
+ // Node 3
93
+ this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 + 22 , y , 20 , 20 , 0 , 0 , 20 , identifier_node3 , 20 , 40 ,
82
94
(button ) -> {
83
95
MinecraftClient mc = MinecraftClient .getInstance ();
84
96
ServerInfo serverInfo = new ServerInfo ("DF Node3" , "node3.mcdiamondfire.com:25565" , false );
85
97
mc .openScreen (new ConnectScreen (mc .currentScreen , mc , serverInfo ));
86
98
}));
87
99
88
- this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 + 22 , y + spacingY , 20 , 20 , 0 , 0 , 20 , identifier_node4 , 20 , 40 ,
100
+ // Node 4
101
+ this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 + 44 , y , 20 , 20 , 0 , 0 , 20 , identifier_node4 , 20 , 40 ,
89
102
(button ) -> {
90
103
MinecraftClient mc = MinecraftClient .getInstance ();
91
104
ServerInfo serverInfo = new ServerInfo ("DF Node4" , "node4.mcdiamondfire.com:25565" , false );
92
105
mc .openScreen (new ConnectScreen (mc .currentScreen , mc , serverInfo ));
93
106
}));
94
107
95
- this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 + (modMenuButtonPresent ? 22 : 0 ), y + spacingY + 24 , 20 , 20 , 0 , 0 , 20 , identifier_node5 , 20 , 40 ,
108
+ // Node 5
109
+ this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 , y + spacingY , 20 , 20 , 0 , 0 , 20 , identifier_node5 , 20 , 40 ,
96
110
(button ) -> {
97
111
MinecraftClient mc = MinecraftClient .getInstance ();
98
112
ServerInfo serverInfo = new ServerInfo ("DF Node5" , "node5.mcdiamondfire.com:25565" , false );
99
113
mc .openScreen (new ConnectScreen (mc .currentScreen , mc , serverInfo ));
100
114
}));
115
+
116
+ // Node 6
117
+ this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 + 22 , y + spacingY , 20 , 20 , 0 , 0 , 20 , identifier_node6 , 20 , 40 ,
118
+ (button ) -> {
119
+ MinecraftClient mc = MinecraftClient .getInstance ();
120
+ ServerInfo serverInfo = new ServerInfo ("DF Node6" , "node6.mcdiamondfire.com:25565" , false );
121
+ mc .openScreen (new ConnectScreen (mc .currentScreen , mc , serverInfo ));
122
+ }));
123
+
124
+ // Node 7
125
+ this .addButton (new BlendableTexturedButtonWidget (this .width / 2 + 104 + 44 , y + spacingY , 20 , 20 , 0 , 0 , 20 , identifier_node7 , 20 , 40 ,
126
+ (button ) -> {
127
+ MinecraftClient mc = MinecraftClient .getInstance ();
128
+ ServerInfo serverInfo = new ServerInfo ("DF Node7" , "node7.mcdiamondfire.com:25565" , false );
129
+ mc .openScreen (new ConnectScreen (mc .currentScreen , mc , serverInfo ));
130
+ }));
101
131
}
102
132
}
103
133
0 commit comments