@@ -181,12 +181,15 @@ TAB(Multiplayer, "Multiplayer", "Save", multiplayer_cb, {
181181 }
182182
183183 ip_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 0 );
184- ip_label = gtk_label_new ("IP Address: " );
184+ ip_label = gtk_label_new ("IP Address" );
185185 ip_entry = gtk_entry_new_with_buffer (gtk_entry_buffer_new (default_ip , strlen (default_ip )));
186+ gtk_entry_set_width_chars (GTK_ENTRY (ip_entry ), 25 );
186187
187188 port_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 0 );
188- port_label = gtk_label_new ("Port: " );
189+ port_label = gtk_label_new ("Port" );
189190 port_entry = gtk_entry_new_with_buffer (gtk_entry_buffer_new (default_port , strlen (default_port )));
191+ gtk_entry_set_width_chars (GTK_ENTRY (port_entry ), 25 );
192+ gtk_entry_set_input_purpose (GTK_ENTRY (port_entry ), GTK_INPUT_PURPOSE_DIGITS );
190193
191194 gtk_box_pack_start (GTK_BOX (ip_hbox ), ip_label , FALSE, FALSE, 10 );
192195 gtk_box_pack_end (GTK_BOX (ip_hbox ), ip_entry , FALSE, FALSE, 10 );
@@ -203,8 +206,8 @@ TAB(Multiplayer, "Multiplayer", "Save", multiplayer_cb, {
203206 gtk_box_pack_start (GTK_BOX (tab ), port_hbox , FALSE, FALSE, 0 );
204207 gtk_box_pack_start (GTK_BOX (tab ), notice_label , FALSE, FALSE, 10 );
205208
206- settings_box .ip_entry = ip_entry ;
207- settings_box .port_entry = port_entry ;
209+ settings_box .ip_entry = GTK_ENTRY ( ip_entry ) ;
210+ settings_box .port_entry = GTK_ENTRY ( port_entry ) ;
208211 setenv ("GMCPIL_SERVER_IP" , default_ip , 1 );
209212 setenv ("GMCPIL_SERVER_PORT" , default_port , 1 );
210213});
@@ -214,15 +217,20 @@ TAB(Settings, "Settings", "Save", settings_cb, {
214217 int distance_int ;
215218 char * default_username ;
216219 char * default_distance ;
220+ char * default_hud ;
217221 GtkWidget * username_hbox ;
218222 GtkWidget * username_label ;
219223 GtkWidget * username_entry ;
220224 GtkWidget * distance_hbox ;
221225 GtkWidget * distance_label ;
222226 GtkWidget * distance_combo ;
227+ GtkWidget * hud_hbox ;
228+ GtkWidget * hud_label ;
229+ GtkWidget * hud_entry ;
223230
224231 default_distance = mcpil_config_get_distance (config );
225232 default_username = mcpil_config_get_username (config );
233+ default_hud = mcpil_config_get_hud (config );
226234 if (default_distance == NULL )
227235 {
228236 default_distance = "Normal" ;
@@ -233,40 +241,54 @@ TAB(Settings, "Settings", "Save", settings_cb, {
233241 default_username = "StevePi" ;
234242 mcpil_config_set_username (config , default_username );
235243 }
244+ if (default_hud == NULL )
245+ {
246+ default_hud = "simple,fps" ;
247+ mcpil_config_set_username (config , default_hud );
248+ }
236249
237250 distance_int = get_distance (default_distance );
238251
239252 username_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 0 );
240- username_label = gtk_label_new ("Username:" );
241-
253+ username_label = gtk_label_new ("Username" );
242254 username_entry = gtk_entry_new_with_buffer (gtk_entry_buffer_new (default_username , strlen (default_username )));
255+ gtk_entry_set_width_chars (GTK_ENTRY (username_entry ), 25 );
243256
244257 distance_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 0 );
245- distance_label = gtk_label_new ("Rendering distance:" );
246-
258+ distance_label = gtk_label_new ("Rendering distance" );
247259 distance_combo = gtk_combo_box_text_new ();
248-
249260 while (i < 4 )
250261 {
251262 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (distance_combo ), distances [i ]);
252263 i ++ ;
253264 }
254265 gtk_combo_box_set_active (GTK_COMBO_BOX (distance_combo ), distance_int );
255266
267+ hud_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 0 );
268+ hud_label = gtk_label_new ("Gallium HUD options" );
269+ hud_entry = gtk_entry_new_with_buffer (gtk_entry_buffer_new (default_hud , strlen (default_hud )));
270+ gtk_entry_set_width_chars (GTK_ENTRY (hud_entry ), 25 );
271+
256272 gtk_box_pack_start (GTK_BOX (username_hbox ), username_label , FALSE, FALSE, 10 );
257- gtk_box_pack_start (GTK_BOX (username_hbox ), username_entry , TRUE, TRUE , 10 );
273+ gtk_box_pack_end (GTK_BOX (username_hbox ), username_entry , FALSE, FALSE , 10 );
258274
259275 gtk_box_pack_start (GTK_BOX (distance_hbox ), distance_label , FALSE, FALSE, 10 );
260- gtk_box_pack_start (GTK_BOX (distance_hbox ), distance_combo , TRUE, TRUE, 10 );
276+ gtk_box_pack_end (GTK_BOX (distance_hbox ), distance_combo , FALSE, FALSE, 10 );
277+
278+ gtk_box_pack_start (GTK_BOX (hud_hbox ), hud_label , FALSE, FALSE, 10 );
279+ gtk_box_pack_end (GTK_BOX (hud_hbox ), hud_entry , FALSE, FALSE, 10 );
261280
262281 gtk_box_pack_start (GTK_BOX (tab ), username_hbox , FALSE, FALSE, 0 );
263282 gtk_box_pack_start (GTK_BOX (tab ), distance_hbox , FALSE, FALSE, 0 );
283+ gtk_box_pack_start (GTK_BOX (tab ), hud_hbox , FALSE, FALSE, 0 );
264284
265285 settings_box .username_entry = GTK_ENTRY (username_entry );
266286 settings_box .distance_combo = GTK_COMBO_BOX_TEXT (distance_combo );
287+ settings_box .hud_entry = GTK_ENTRY (hud_entry );
267288
268289 setenv ("MCPI_USERNAME" , default_username , 1 );
269290 setenv ("MCPI_RENDER_DISTANCE" , distances [distance_int ], 1 );
291+ setenv ("GALLIUM_HUD" , default_hud , 1 );
270292});
271293
272294TAB (About , "Minecraft Pi Launcher" , "Help" , about_cb , {
@@ -293,7 +315,7 @@ TAB(About, "Minecraft Pi Launcher", "Help", about_cb, {
293315 }
294316
295317 info_label = gtk_label_new (NULL );
296- gtk_label_set_markup (GTK_LABEL (info_label ), "<b>" MCPIL_VERSION "</b>\nby all its contributors" );
318+ gtk_label_set_markup (GTK_LABEL (info_label ), "<b>" GMCPIL_VERSION "</b>\nby all its contributors" );
297319 gtk_label_set_justify (GTK_LABEL (info_label ), GTK_JUSTIFY_CENTER );
298320
299321 link = gtk_link_button_new_with_label (MCPIL_REPO_URL , MCPIL_REPO_URL );
0 commit comments