@@ -46,30 +46,30 @@ public class NewRacingDialog
46
46
(Player player , EventManager eventManager , AbstractDialog parent , RaceServiceImpl service , Track track )
47
47
{
48
48
PlayerStringSet stringSet = service .getLocalizedStringSet ().getStringSet (player );
49
-
49
+
50
50
RacingManagerImpl racingManager = service .getRacingManager ();
51
51
String racingMode = stringSet .get ((track .getStatus () == TrackStatus .EDITING ) ? "Dialog.NewRacingDialog.RacingTestCaption" : "Dialog.NewRacingDialog.RacingNormalCaption" );
52
-
52
+
53
53
String [] racingName = new String [1 ];
54
54
racingName [0 ] = RacingUtils .getDefaultName (player , track );
55
-
55
+
56
56
RacingSetting setting = new RacingSetting (track );
57
-
57
+
58
58
return WlListDialog .create (player , eventManager )
59
59
.parentDialog (parent )
60
60
.caption (() -> stringSet .format ("Dialog.NewRacingDialog.Caption" , racingMode ))
61
-
61
+
62
62
.item (() -> stringSet .format ("Dialog.NewRacingDialog.Name" , racingName [0 ]), () ->
63
63
{
64
64
if (track .getStatus () == TrackStatus .EDITING ) return false ;
65
65
return true ;
66
66
}, (i ) ->
67
67
{
68
68
player .playSound (1083 );
69
-
69
+
70
70
String caption = stringSet .format ("Dialog.NewRacingEditNameDialog.Caption" , racingMode );
71
71
String message = stringSet .get ("Dialog.NewRacingEditNameDialog.Text" );
72
-
72
+
73
73
WlInputDialog .create (player , eventManager )
74
74
.parentDialog (i .getCurrentDialog ())
75
75
.caption (caption )
@@ -83,18 +83,18 @@ public class NewRacingDialog
83
83
d .show ();
84
84
return ;
85
85
}
86
-
86
+
87
87
racingName [0 ] = name ;
88
88
})
89
89
.build ().show ();
90
90
})
91
-
91
+
92
92
.item (() -> stringSet .format ("Dialog.NewRacingDialog.Track" , track .getName (), track .getCheckpoints ().size (), track .getLength ()/1000.0f ), (i ) ->
93
93
{
94
94
player .playSound (1083 );
95
- TrackDialog .create (player , eventManager , i .getCurrentDialog (), service , track ).show ();
95
+ TrackDialog .create (player , eventManager , i .getCurrentDialog (), service , track ).show ();
96
96
})
97
-
97
+
98
98
.item (() ->
99
99
{
100
100
String trackType = stringSet .get ("Track.Type.Normal" );
@@ -105,43 +105,43 @@ public class NewRacingDialog
105
105
player .playSound (1083 );
106
106
i .getCurrentDialog ().show ();
107
107
})
108
-
108
+
109
109
.item (ListDialogItemRadio .create ()
110
110
.itemText (stringSet .get ("Dialog.NewRacingDialog.RacingType" ))
111
111
.selectedIndex (() -> setting .getRacingType ().ordinal ())
112
- .item (stringSet .get ("Racing.Type.Normal" ), Color .CORNFLOWERBLUE , () -> setting .setRacingType (RacingType .NORMAL ))
113
- .item (stringSet .get ("Racing.Type.Knockout" ), Color .MAGENTA , () -> setting .setRacingType (RacingType .KNOCKOUT ))
112
+ .item (stringSet .get ("Racing.Type.Normal" ), Color .CORNFLOWERBLUE , (dialogItem ) -> setting .setRacingType (RacingType .NORMAL ))
113
+ .item (stringSet .get ("Racing.Type.Knockout" ), Color .MAGENTA , (dialogItem ) -> setting .setRacingType (RacingType .KNOCKOUT ))
114
114
.onSelect ((i ) ->
115
115
{
116
116
player .playSound (1083 );
117
117
i .getCurrentDialog ().show ();
118
118
})
119
119
.build ())
120
-
120
+
121
121
.item (() ->
122
122
{
123
123
String format = stringSet .get ("Dialog.NewRacingDialog.DepartureInterval" );
124
124
int interval = setting .getDepartureInterval ();
125
125
if (interval == 0 ) return String .format (format , stringSet .get ("Common.None" ));
126
- return String .format (format , stringSet .format ("Time.Format.S" , interval ));
126
+ return String .format (format , stringSet .format ("Time.Format.S" , interval ));
127
127
}, (i ) ->
128
128
{
129
129
player .playSound (1083 );
130
130
RacingDepartureSettingDialog .create (player , eventManager , i .getCurrentDialog (), service , setting ).show ();
131
131
})
132
-
132
+
133
133
.item (ListDialogItemRadio .create ()
134
134
.selectedIndex (() -> setting .getDeathRule ().ordinal ())
135
135
.itemText (stringSet .get ("Dialog.NewRacingDialog.DeathRule" ))
136
- .item (stringSet .get ("Racing.DeathRule.WaitAndReturn" ), Color .AQUA , () -> setting .setDeathRule (DeathRule .WAIT_AND_RETURN ))
137
- .item (stringSet .get ("Racing.DeathRule.Knockout" ), Color .FUCHSIA , () -> setting .setDeathRule (DeathRule .KNOCKOUT ))
136
+ .item (stringSet .get ("Racing.DeathRule.WaitAndReturn" ), Color .AQUA , (dialogItem ) -> setting .setDeathRule (DeathRule .WAIT_AND_RETURN ))
137
+ .item (stringSet .get ("Racing.DeathRule.Knockout" ), Color .FUCHSIA , (dialogItem ) -> setting .setDeathRule (DeathRule .KNOCKOUT ))
138
138
.onSelect ((i ) ->
139
139
{
140
140
player .playSound (1083 );
141
141
i .getCurrentDialog ().show ();
142
142
})
143
143
.build ())
144
-
144
+
145
145
.item (ListDialogItemCheck .create ()
146
146
.itemText (stringSet .get ("Dialog.NewRacingDialog.Limit" ))
147
147
.item (stringSet .get ("Racing.Limit.AutoRepair" ), Color .LIME , () -> setting .getLimit ().isAllowAutoRepair ())
@@ -154,19 +154,19 @@ public class NewRacingDialog
154
154
RacingLimitDialog .create (player , eventManager , i .getCurrentDialog (), service , track , setting .getLimit ()).show ();
155
155
})
156
156
.build ())
157
-
157
+
158
158
.item (() ->
159
159
{
160
160
int min = track .getSetting ().getMinPlayers ();
161
161
int max = setting .getMaxPlayers ();
162
162
if (min != 0 && max != 0 ) return stringSet .format ("Dialog.NewRacingDialog.PlayersLimitFormat" , min , max );
163
- return stringSet .get ("Dialog.NewRacingDialog.PlayersLimit" ) + " " + stringSet .get ("Dialog.NewRacingDialog.PlayersLimitNone" );
163
+ return stringSet .get ("Dialog.NewRacingDialog.PlayersLimit" ) + " " + stringSet .get ("Dialog.NewRacingDialog.PlayersLimitNone" );
164
164
}, (i ) ->
165
165
{
166
166
player .playSound (1083 );
167
167
i .getCurrentDialog ().show ();
168
168
})
169
-
169
+
170
170
.item (() ->
171
171
{
172
172
String itemText = stringSet .get ("Dialog.NewRacingDialog.Password" );
@@ -177,7 +177,7 @@ public class NewRacingDialog
177
177
player .playSound (1083 );
178
178
i .getCurrentDialog ().show ();
179
179
})
180
-
180
+
181
181
.item (stringSet .get ("Dialog.NewRacingDialog.Create" ), (i ) ->
182
182
{
183
183
Runnable startNewRacing = () ->
@@ -186,9 +186,9 @@ public class NewRacingDialog
186
186
racing .teleToStartingPoint (player );
187
187
racing .setSetting (setting );
188
188
};
189
-
189
+
190
190
player .playSound (1083 );
191
-
191
+
192
192
if (track .getCheckpoints ().isEmpty ()) return ;
193
193
if (racingManager .isPlayerInRacing (player ))
194
194
{
@@ -197,7 +197,7 @@ public class NewRacingDialog
197
197
}
198
198
else startNewRacing .run ();
199
199
})
200
-
200
+
201
201
.build ();
202
202
}
203
203
}
0 commit comments