Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/bensch/orxonox_gui_exec.c @ 1821

Last change on this file since 1821 was 1821, checked in by bensch, 20 years ago

orxonox/branches/bensch: volume sliders implemented

File size: 2.9 KB
Line 
1#include "orxonox_gui_exec.h"
2GtkWidget *exec_flags_label;
3struct settings *exec_orxonox_settings;
4GtkWidget *orxonox_gui_exec_frame (struct settings *orxonox_settings)
5{
6  GtkWidget *frame;
7  GtkWidget *save_settings_button;
8  GtkWidget *show_menu_button;
9  GtkWidget *start_button;
10  GtkWidget *quit_button;
11  GtkWidget *flags_frame;
12
13
14  frame = gtk_frame_new ( "Execute-Tags:");
15  gtk_container_set_border_width (GTK_CONTAINER (frame), 5);
16  {
17    GtkWidget *orxonox_gui_exec_vbox;
18    orxonox_gui_exec_vbox = gtk_vbox_new (FALSE, 5);
19    {
20
21        start_button = gtk_button_new_with_label ("Start");
22        gtk_box_pack_start(GTK_BOX (orxonox_gui_exec_vbox), start_button, TRUE, TRUE, 5);
23
24        save_settings_button = gtk_check_button_new_with_label ("Save Settings");
25        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (save_settings_button), orxonox_settings->exec_save_settings);
26        gtk_box_pack_start(GTK_BOX (orxonox_gui_exec_vbox), save_settings_button, TRUE, TRUE, 0);
27
28        show_menu_button = gtk_check_button_new_with_label ("Always show this Menu");
29        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show_menu_button), orxonox_settings->exec_show_menu);
30        gtk_box_pack_start(GTK_BOX (orxonox_gui_exec_vbox), show_menu_button, TRUE, TRUE, 0);
31       
32
33        quit_button = gtk_button_new_with_label ("quit");
34        g_signal_connect(GTK_BUTTON(quit_button), "clicked", G_CALLBACK(gtk_main_quit), NULL);
35        gtk_box_pack_start(GTK_BOX (orxonox_gui_exec_vbox), quit_button, FALSE, FALSE, 5);
36
37
38        flags_frame = gtk_frame_new("Orxonox's starting Flags");
39        {
40          exec_flags_label = gtk_label_new("test");
41          exec_orxonox_settings = orxonox_settings;
42          orxonox_flags_update();
43          gtk_container_add (GTK_CONTAINER(flags_frame), exec_flags_label);
44
45        }
46        gtk_box_pack_start(GTK_BOX (orxonox_gui_exec_vbox), flags_frame, FALSE, FALSE, 5);
47    }
48    gtk_container_add(GTK_CONTAINER(frame), orxonox_gui_exec_vbox);
49  }
50
51  return frame;
52
53}
54
55
56char * orxonox_flags_text (struct settings *orxonox_settings, char *exec_flags_text)
57{
58  char temp [50];
59  bzero(exec_flags_text, 1);
60  strcat(exec_flags_text, "orxonox ");
61
62  if(!orxonox_settings->video_fullscreen)
63    strcat(exec_flags_text, "--windowed ");
64  if(orxonox_settings->video_wireframe)
65    strcat(exec_flags_text, "--wireframe ");
66 
67  if(!orxonox_settings->audio_enable_sound)
68    strcat(exec_flags_text, "--disable_audio ");
69  if(orxonox_settings->audio_music_volume != 80)
70    {
71      strcat(exec_flags_text, "--music_volume=");
72      sprintf(temp, "%i ", (int) orxonox_settings->audio_music_volume);
73      strcat(exec_flags_text, temp);
74    }
75  if(orxonox_settings->audio_effects_volume != 80)
76    {
77      strcat(exec_flags_text, "--effects_volume= ");
78      sprintf(temp, "%i ", (int) orxonox_settings->audio_effects_volume);
79      strcat(exec_flags_text, temp);
80    }
81  return (exec_flags_text);
82}
83
84void orxonox_flags_update (void)
85{
86  char exec_flags_text[1024];
87  gtk_label_set_text (GTK_LABEL(exec_flags_label), orxonox_flags_text (exec_orxonox_settings, exec_flags_text));
88  return;
89}
Note: See TracBrowser for help on using the repository browser.