def create(self, notebook): # Frame - Players player_frame = create_page(self, notebook, 'Players', 100,75) # Table - Player player_table = gtk.Table(rows=2, columns=2, homogeneous=False) player_table.show() player_frame.add(player_table) # Player Window (scrolled) player_window = gtk.ScrolledWindow() player_window.set_border_width(10) player_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) player_window.show() player_table.attach(player_window,0,1,0,2, gtk.SHRINK|gtk.FILL|gtk.EXPAND,gtk.SHRINK|gtk.FILL|gtk.EXPAND,5,5) # Player ListStore # 0 Ready = gtk.gdk.Pixbuf # 1 Name = String # 2 Team = int # 3 RGB -> R = String # 4 RGB -> G = String # 5 RGB -> B = String # 6 Color Image = gtk.gdk.Pixbuf # 7 Side = String # 8 Ally = int # 9 Bonus = int # 10 AI = String # 11 AI Owner = String # 12 AI Location = String self.player_liststore = gtk.ListStore(gtk.gdk.Pixbuf, str, int, str, str, str, gtk.gdk.Pixbuf, str, int, int, str, str, str) self.player_treeview = gtk.TreeView(self.player_liststore) self.player_column_0 = gtk.TreeViewColumn('Ready') self.player_column_1 = gtk.TreeViewColumn('Name') self.player_column_2 = gtk.TreeViewColumn('Army') self.player_column_3 = gtk.TreeViewColumn('Color') self.player_column_4 = gtk.TreeViewColumn('Side') self.player_column_5 = gtk.TreeViewColumn('Ally') self.player_column_6 = gtk.TreeViewColumn('Bonus') self.player_column_7 = gtk.TreeViewColumn('AI') self.player_column_8 = gtk.TreeViewColumn('AI Owner') self.player_treeview.append_column(self.player_column_0) self.player_treeview.append_column(self.player_column_1) self.player_treeview.append_column(self.player_column_2) self.player_treeview.append_column(self.player_column_3) self.player_treeview.append_column(self.player_column_4) self.player_treeview.append_column(self.player_column_5) self.player_treeview.append_column(self.player_column_6) self.player_treeview.append_column(self.player_column_7) self.player_treeview.append_column(self.player_column_8) player_window.add(self.player_treeview) self.player_treeview.show() # Add Mouse Click event to player_treeview self.player_treeview.add_events(gtk.gdk.BUTTON_PRESS_MASK) self.player_treeview.connect('event',self.player_popup_menu) # create a CellRenderers to render the data self.cell0 = gtk.CellRendererPixbuf() self.cell1 = gtk.CellRendererText() self.cell2 = gtk.CellRendererText() self.cell3 = gtk.CellRendererPixbuf() self.cell4 = gtk.CellRendererText() self.cell5 = gtk.CellRendererText() self.cell6 = gtk.CellRendererText() self.cell7 = gtk.CellRendererText() self.cell8 = gtk.CellRendererText() # add the cells to the columns self.player_column_0.pack_start(self.cell0, False) self.player_column_1.pack_start(self.cell1, False) self.player_column_2.pack_start(self.cell2, False) self.player_column_3.pack_start(self.cell3, False) self.player_column_4.pack_start(self.cell4, False) self.player_column_5.pack_start(self.cell5, False) self.player_column_6.pack_start(self.cell6, False) self.player_column_7.pack_start(self.cell7, False) self.player_column_8.pack_start(self.cell8, False) # set the cell attributes to the appropriate liststore column self.player_column_0.set_attributes(self.cell0) self.player_column_1.set_attributes(self.cell1, text=1) self.player_column_2.set_attributes(self.cell2, text=2) self.player_column_4.set_attributes(self.cell4, text=7) self.player_column_5.set_attributes(self.cell5, text=8) self.player_column_6.set_attributes(self.cell6, text=9) self.player_column_7.set_attributes(self.cell7, text=10) self.player_column_8.set_attributes(self.cell8, text=11) # Allow sorting on the column self.player_column_1.set_sort_column_id(1) self.player_column_2.set_sort_column_id(2) self.player_column_3.set_sort_column_id(3) self.player_column_4.set_sort_column_id(4) self.player_column_5.set_sort_column_id(5) self.player_column_6.set_sort_column_id(6) self.player_column_7.set_sort_column_id(7) self.player_column_8.set_sort_column_id(8) # Map Preview 2 self.map_preview_2 = gtk.Image() self.map_preview_2.show() player_table.attach(self.map_preview_2, 1,2,0,1, gtk.FILL, gtk.FILL,0,0) # Options NoteBook options_notebook = gtk.Notebook() options_notebook.set_tab_pos(gtk.POS_TOP) player_table.attach(options_notebook, 1,2,1,2, gtk.FILL,gtk.FILL,10,10) options_notebook.show() # Frame - Options options_frame = create_page(self, options_notebook, 'Options', 350, 50) # Table options_table = gtk.Table(rows=1, columns=1, homogeneous=False) options_table.show() options_frame.add(options_table) # GameMode game_mode_label = label_create("Commander Dies") options_table.attach(game_mode_label,0,2,0,1, 0,0,10,10) self.game_mode = combobox_setup(GLOBAL.GAME_MODES, GLOBAL.GAME_MODES_DEFAULT, True) options_table.attach(self.game_mode, 2,4,0,1, gtk.FILL,gtk.FILL,10,10) # Starting Positions starting_positions_label = label_create("Starting Position") options_table.attach(starting_positions_label,0,2,1,2, gtk.FILL,gtk.FILL,10,10) self.starting_positions = combobox_setup(GLOBAL.STARTING_POSITIONS, GLOBAL.STARTING_POSITIONS_DEFAULT, True) options_table.attach(self.starting_positions, 2,4,1,2, gtk.FILL,gtk.FILL,10,10) # Frame - Resources resources_frame = create_page(self, options_notebook, 'Resources', 100, 50) # Table resources_table = gtk.Table(rows=1, columns=1, homogeneous =False) resources_table.show() resources_frame.add(resources_table) # Start Metal start_metal_label = label_create("Metal") resources_table.attach(start_metal_label, 0,1,0,1, gtk.FILL,gtk.FILL,10,10) start_metal_adjustment = gtk.Adjustment(self.start_metal, lower=0, upper=12000, step_incr=100, page_incr=1000, page_size=0) self.start_metal_spinner = gtk.SpinButton(start_metal_adjustment, 0, 0) self.start_metal_spinner.show() resources_table.attach(self.start_metal_spinner, 1,2,0,1, gtk.FILL,gtk.FILL,10,10) # Start Energy start_energy_label = label_create("Energy") resources_table.attach(start_energy_label, 2,3,0,1, gtk.FILL,gtk.FILL,10,10) start_energy_adjustment = gtk.Adjustment(self.start_energy, lower=0, upper=12000, step_incr=100, page_incr=1000, page_size=0) self.start_energy_spinner = gtk.SpinButton(start_energy_adjustment, 0, 0) self.start_energy_spinner.show() resources_table.attach(self.start_energy_spinner, 3,4,0,1, gtk.FILL,gtk.FILL,10,10) # Max Units max_units_label = label_create("Max Units") resources_table.attach(max_units_label, 0,1,1,2, gtk.FILL,gtk.FILL,10,10) max_units_adjustment = gtk.Adjustment(self.max_units, lower=0, upper=5000, step_incr=100, page_incr=1000, page_size=0) self.max_units_spinner = gtk.SpinButton(max_units_adjustment, 0, 0) self.max_units_spinner.show() resources_table.attach(self.max_units_spinner, 1,2,1,2, gtk.FILL,gtk.FILL,10,10) # Frame - Debug debug_frame = create_page(self, options_notebook, 'Debug', 100, 50) # Table debug_table = gtk.Table(rows=1, columns=1, homogeneous =False) debug_table.show() debug_frame.add(debug_table) # Gdb Backtrace gdb_backtrace_label = label_create("Gdb Backtrace") debug_table.attach(gdb_backtrace_label,0,1,0,1, gtk.FILL,gtk.FILL,10,10) self.gdb_backtrace = combobox_setup(GLOBAL.GDB_BACKTRACE, GLOBAL.GDB_BACKTRACE_DEFAULT, True) debug_table.attach(self.gdb_backtrace, 1,2,0,1, gtk.FILL,gtk.FILL,10,10) # Notebook - Map / Mod map_frame = create_page(self, notebook, 'Map', 100, 75) # Table - Map map_table = gtk.Table(rows=2, columns=2, homogeneous=False) map_table.show() map_frame.add(map_table) # Map Preview self.map_preview_1 = gtk.Image() self.map_preview_1.show() map_table.attach(self.map_preview_1, 0,1,0,1, 0,0,60,10) # FIX # Map Description self.map_description = label_create("") self.map_description.set_line_wrap(1) map_table.attach(self.map_description, 0,1,1,2, gtk.SHRINK,gtk.SHRINK,0,0) # Map # Map Window (scrolled) map_window = gtk.ScrolledWindow() map_window.set_border_width(10) map_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) map_window.show() map_table.attach(map_window, 0,1,2,3, gtk.EXPAND|gtk.FILL,gtk.EXPAND|gtk.FILL,0,0) # FIX # Map ListStore # Name = str # Players = int # Height = int # Width = int # Min Wind = int # Max Wind = int # Tidal = int # Extractor Radius = int # Max Metal = str # Gravity = str self.map_liststore = gtk.ListStore(str, int, int, int, int, int, int, int, str, str) self.map_treeview = gtk.TreeView(self.map_liststore) self.map_column_1 = gtk.TreeViewColumn('Name') self.map_column_2 = gtk.TreeViewColumn('Players') self.map_column_3 = gtk.TreeViewColumn('Height') self.map_column_4 = gtk.TreeViewColumn('Width') self.map_column_5 = gtk.TreeViewColumn('Min Wind') self.map_column_6 = gtk.TreeViewColumn('Max Wind') self.map_column_7 = gtk.TreeViewColumn('Tidal') self.map_column_8 = gtk.TreeViewColumn('Extractor Radius') self.map_column_9 = gtk.TreeViewColumn('Max Metal') self.map_column_10 = gtk.TreeViewColumn('Gravity') self.map_treeview.append_column(self.map_column_1) self.map_treeview.append_column(self.map_column_2) self.map_treeview.append_column(self.map_column_3) self.map_treeview.append_column(self.map_column_4) self.map_treeview.append_column(self.map_column_5) self.map_treeview.append_column(self.map_column_6) self.map_treeview.append_column(self.map_column_7) self.map_treeview.append_column(self.map_column_8) self.map_treeview.append_column(self.map_column_9) self.map_treeview.append_column(self.map_column_10) map_window.add(self.map_treeview) self.map_treeview.show() # Add Mouse Click event to map_treeview self.map_treeview.add_events(gtk.gdk.BUTTON_PRESS_MASK) self.map_treeview.connect('button_press_event', self.map_preview_check) # create CellRenderers to render the data self.map_cell_1 = gtk.CellRendererText() self.map_cell_2 = gtk.CellRendererText() self.map_cell_3 = gtk.CellRendererText() self.map_cell_4 = gtk.CellRendererText() self.map_cell_5 = gtk.CellRendererText() self.map_cell_6 = gtk.CellRendererText() self.map_cell_7 = gtk.CellRendererText() self.map_cell_8 = gtk.CellRendererText() self.map_cell_9 = gtk.CellRendererText() self.map_cell_10 = gtk.CellRendererText() # add the cells to the columns self.map_column_1.pack_start(self.map_cell_1, False) self.map_column_2.pack_start(self.map_cell_2, True) self.map_column_3.pack_start(self.map_cell_3, True) self.map_column_4.pack_start(self.map_cell_4, True) self.map_column_5.pack_start(self.map_cell_5, True) self.map_column_6.pack_start(self.map_cell_6, True) self.map_column_7.pack_start(self.map_cell_7, True) self.map_column_8.pack_start(self.map_cell_8, True) self.map_column_9.pack_start(self.map_cell_9, True) self.map_column_10.pack_start(self.map_cell_10, True) # set the cell attributes to the appropriate liststore column self.map_column_1.set_attributes(self.map_cell_1, text=0) self.map_column_2.set_attributes(self.map_cell_2, text=1) self.map_column_3.set_attributes(self.map_cell_3, text=2) self.map_column_4.set_attributes(self.map_cell_4, text=3) self.map_column_5.set_attributes(self.map_cell_5, text=4) self.map_column_6.set_attributes(self.map_cell_6, text=5) self.map_column_7.set_attributes(self.map_cell_7, text=6) self.map_column_8.set_attributes(self.map_cell_8, text=7) self.map_column_9.set_attributes(self.map_cell_9, text=8) self.map_column_10.set_attributes(self.map_cell_10, text=9) # Allow sorting on the column self.map_column_1.set_sort_column_id(0) self.map_column_2.set_sort_column_id(1) self.map_column_3.set_sort_column_id(2) self.map_column_4.set_sort_column_id(3) self.map_column_5.set_sort_column_id(4) self.map_column_6.set_sort_column_id(5) self.map_column_7.set_sort_column_id(6) self.map_column_8.set_sort_column_id(7) self.map_column_9.set_sort_column_id(8) self.map_column_10.set_sort_column_id(9) self.map_treeview.set_search_column(0) # Map List self.map_index.list_checksums() map_info = self.map_index.all_map_info() for i in range (0,len(map_info)): self.map_liststore.append(map_info[i]) map_treeselection = self.map_treeview.get_selection() map_treeselection.select_iter(self.map_liststore.get_iter_first()) # Frame - Mod mod_frame = create_page(self, notebook, 'Mod', 100, 75) # Table - Mod mod_table = gtk.Table(rows=2, columns=2, homogeneous=False) mod_table.show() mod_frame.add(mod_table) # Mod Window (scrolled) mod_window = gtk.ScrolledWindow() mod_window.set_border_width(10) mod_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) mod_window.show() mod_table.attach(mod_window, 0,1,0,1) # mod ListStore # Mod Name = String # Mod Checksum = String self.mod_liststore = gtk.ListStore(str,str) self.mod_treeview = gtk.TreeView(self.mod_liststore) self.mod_treeview.set_headers_visible(False) self.mod_column_1 = gtk.TreeViewColumn('Mod Name') self.mod_treeview.append_column(self.mod_column_1) mod_window.add(self.mod_treeview) self.mod_treeview.show() # Read Map Index & Add Map List mod_checksum_list = self.mod_index.list_checksums() for i in range(0,len(mod_checksum_list)): self.mod_liststore.append([self.mod_index.mod_archive_name(mod_checksum_list[i]), mod_checksum_list[i]]) mod_treeselection = self.mod_treeview.get_selection() mod_treeselection.select_iter(self.mod_liststore.get_iter_first()) self.mod_treeview.add_events(gtk.gdk.BUTTON_PRESS_MASK) self.mod_treeview.connect('cursor-changed', self.mod_selection) self.old_sides = self.mod_archive_sides() self.cell_1 = gtk.CellRendererText() self.mod_column_1.pack_start(self.cell_1, False) self.mod_column_1.set_attributes(self.cell_1, text=0) self.mod_treeview.set_search_column(0) # Frame - Unit Browser unit_browser_frame = frame_create("Unit Browser") unit_browser_frame.show() mod_table.attach(unit_browser_frame, 0,2,1,2) # Frame - Restricted Units disabled_units_frame = create_page(self, notebook, 'Restricted Units', 100, 75) self.map_preview()
def create(self): # Load Option Values if self.platform == 'win32': spring_options = self.windows_load_spring_options() else: spring_options = self.unix_load_spring_options() # Window self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_icon_list(self.spring_logo_pixbuf) self.window.set_title("Spring Options") self.window.connect("delete-event", self.destroy) # Table table = gtk.Table(rows=2, columns=2, homogeneous=False) table.show() self.window.add(table) # ToolBar self.save_button = gtk.ToolButton(gtk.STOCK_SAVE) # self.save_button.connect("clicked", self.player_update_status, self.my_player_name) self.save_button.show() toolbar = gtk.Toolbar() toolbar.insert(self.save_button, 0) toolbar.set_style(gtk.TOOLBAR_ICONS) toolbar.show() table.attach(toolbar,0,1,0,1, gtk.FILL, gtk.FILL,0,0) # Notebook notebook = gtk.Notebook() notebook.set_tab_pos(gtk.POS_LEFT) notebook.show() table.attach(notebook,0,1,1,2) # Frame - General general_frame = create_page(self, notebook, 'General', 100, 75) # Table general_table = gtk.Table(rows=2,columns=1, homogeneous=False) general_table.show() general_frame.add(general_table) # Name name_label = label_create('Name') self.player_name = gtk.Entry(max=0) self.player_name.set_text(spring_options['name']) self.player_name.set_width_chars(14) self.player_name.show() general_table.attach(name_label, 0,1,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) general_table.attach(self.player_name, 1,2,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Team Nano Spray team_nano_spray_label = label_create('Nano Spray') team_nano_spray_label.set_max_width_chars(10) team_nano_spray_label.set_line_wrap(True) self.team_nano_spray_combobox = combobox_setup(GLOBAL.Nano_Team_Colour, spring_options['team_nano_spray'], True) general_table.attach(team_nano_spray_label, 0,1,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) general_table.attach(self.team_nano_spray_combobox, 1,2,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Frame - Graphics graphics_frame = create_page(self, notebook, 'Graphics', 100, 75) # Table graphics_table = gtk.Table(rows=1,columns=2, homogeneous=False) graphics_table.show() graphics_frame.add(graphics_table) # Resolution resolution_label = label_create("Resolution") self.resolution_combobox = gtk.combo_box_new_text() for i in range (0,len(GLOBAL.Resolution)): self.resolution_combobox.append_text(GLOBAL.Resolution[i]) for i in range (0,len(GLOBAL.Resolution_X)): if GLOBAL.Resolution_X[i] == spring_options['resolution_x']: self.resolution_combobox.set_active(i) break self.resolution_combobox.show() graphics_table.attach(resolution_label, 0,1,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) graphics_table.attach(self.resolution_combobox, 1,2,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Fullscreen fullscreen_label = label_create("Fullscreen") self.fullscreen_combobox = combobox_setup(GLOBAL.Fullscreen, spring_options['fullscreen'], True) graphics_table.attach(fullscreen_label, 0,1,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) graphics_table.attach(self.fullscreen_combobox, 1,2,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Shadows shadows_label = label_create("Shadows") self.shadows_combobox = combobox_setup(GLOBAL.Shadows, spring_options['shadows'], True) graphics_table.attach(shadows_label, 0,1,2,3, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) graphics_table.attach(self.shadows_combobox, 1,2,2,3, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Fullscreen Anti-Aliasing fsaa_label = label_create("FSAA") self.fsaa_spinner = spinner_create(GLOBAL.FSAA_Level, spring_options['fsaa'], True) graphics_table.attach(fsaa_label, 0,1,3,4, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) graphics_table.attach(self.fsaa_spinner, 1,2,3,4, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Frame - Adv Graphics adv_graphics_frame = create_page(self, notebook, 'Adv Graphics', 100,75) # Table adv_graphics_table = gtk.Table(rows=2, columns=4, homogeneous=False) adv_graphics_table.show() adv_graphics_frame.add(adv_graphics_table) # 'Ground Decals' ground_decals_label = label_create("Ground Decals") self.ground_decals_spinner = spinner_create(GLOBAL.Ground_Decals, spring_options['ground_decals'], True) adv_graphics_table.attach(ground_decals_label, 0,1,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) adv_graphics_table.attach(self.ground_decals_spinner, 1,2,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Ground Detail ground_detail_label = label_create("Ground Detail") self.ground_detail_spinner = spinner_create(GLOBAL.Ground_Detail, spring_options['ground_detail'], True) adv_graphics_table.attach(ground_detail_label, 0,1,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) adv_graphics_table.attach(self.ground_detail_spinner, 1,2,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Grass Detail grass_detail_label = label_create("Grass Detail") self.grass_detail_spinner = spinner_create(GLOBAL.Grass_Detail, spring_options['grass_detail'], True) adv_graphics_table.attach(grass_detail_label, 0,1,2,3, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) adv_graphics_table.attach(self.grass_detail_spinner, 1,2,2,3, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Max Particles max_particles_label = label_create("Max Particles") self.max_particles_spinner = spinner_create(GLOBAL.Max_Particles, spring_options['max_particles'], True) adv_graphics_table.attach(max_particles_label, 0,1,3,4, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) adv_graphics_table.attach(self.max_particles_spinner, 1,2,3,4, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Unit Lod Distance unit_lod_distance_label = label_create("Unit Lod Distance") self.unit_lod_distance_spinner = spinner_create(GLOBAL.Unit_Lod_Dist, spring_options['unit_lod_dist'], True) adv_graphics_table.attach(unit_lod_distance_label, 0,1,4,5, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) adv_graphics_table.attach(self.unit_lod_distance_spinner, 1,2,4,5, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Frame - Adv Shaders adv_shaders_frame = create_page(self, notebook, 'Adv Shaders', 100,75) # Table adv_shaders_table = gtk.Table(rows=1, columns=3, homogeneous=False) adv_shaders_table.show() adv_shaders_frame.add(adv_shaders_table) # Advanced Sky adv_sky_label = label_create("Advanced Sky") self.adv_sky_combobox = combobox_setup(GLOBAL.Adv_Sky, spring_options['adv_sky'], True) adv_shaders_table.attach(adv_sky_label, 0,1,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) adv_shaders_table.attach(self.adv_sky_combobox, 1,2,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Dynamic Sky dynamic_sky_label = label_create("Dynamic Sky") self.dynamic_sky_combobox = combobox_setup(GLOBAL.Dynamic_Sky, spring_options['dynamic_sky'], True) adv_shaders_table.attach(dynamic_sky_label, 0,1,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) adv_shaders_table.attach(self.dynamic_sky_combobox, 1,2,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Advanced Unit Shading adv_unit_shading_label = label_create("Adv Unit Shading") self.adv_unit_shading_combobox = combobox_setup(GLOBAL.Adv_Unit_Shading, spring_options['adv_unit_shading'], True) adv_shaders_table.attach(adv_unit_shading_label, 0,1,2,3, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) adv_shaders_table.attach(self.adv_unit_shading_combobox, 1,2,2,3, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Reflective Water reflective_water_label = label_create("Reflective Water") self.reflective_water_combobox = combobox_setup(GLOBAL.Reflective_Water, spring_options['reflective_water'], True) adv_shaders_table.attach(reflective_water_label, 0,1,3,4, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) adv_shaders_table.attach(self.reflective_water_combobox, 1,2,3,4, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Sound sound_frame = create_page(self, notebook, 'Sound', 100,75) # Table sound_table = gtk.Table(rows=1, columns=4, homogeneous=False) sound_table.show() sound_frame.add(sound_table) # Sound Volume sound_volume_label = label_create("Sound Volume") self.sound_volume_spinner = spinner_create(GLOBAL.Sound_Volume, spring_options['sound_volume'], True) sound_table.attach(sound_volume_label, 0,1,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) sound_table.attach(self.sound_volume_spinner, 1,2,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Max Sounds max_sounds_label = label_create("Max Sounds") self.max_sounds_spinner = spinner_create(GLOBAL.Max_Sounds, spring_options['max_sounds'], True) sound_table.attach(max_sounds_label, 0,1,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) sound_table.attach(self.max_sounds_spinner, 1,2,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # Debug debug_frame = create_page(self, notebook, 'Debug', 100,75) # Table debug_table = gtk.Table(rows=1, columns=4, homogeneous=False) debug_table.show() debug_frame.add(debug_table) # VerboseLevel verbose_level_label = label_create("Verbose Level") self.verbose_level_spinner = spinner_create(GLOBAL.Verbose_Level, spring_options['verbose_level'], True) debug_table.attach(verbose_level_label, 0,1,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) debug_table.attach(self.verbose_level_spinner, 1,2,0,1, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) # CatchAIExceptions catch_ai_exceptions_label = label_create("Catch AI Exceptions") self.catch_ai_exceptions_combobox = combobox_setup(GLOBAL.Catch_AI_Exceptions, spring_options['catch_ai_exceptions'], True) debug_table.attach(catch_ai_exceptions_label, 0,1,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5) debug_table.attach(self.catch_ai_exceptions_combobox, 1,2,1,2, xoptions=gtk.SHRINK|gtk.FILL, yoptions=gtk.SHRINK|gtk.FILL, xpadding=5, ypadding=5)
def create(self, notebook): if self.platform == 'win32': spring_options = self.windows_load_spring_options() else: spring_options = self.unix_load_spring_options() # Frame - General general_frame = create_page(self, notebook, 'General', 100, 75) # Table general_table = gtk.Table(rows=2,columns=1, homogeneous=False) general_table.show() general_frame.add(general_table) # Name name_label = label_create('Name') self.player_name = gtk.Entry(max=0) self.player_name.set_text(spring_options['name']) self.player_name.set_width_chars(14) self.player_name.show() general_table.attach(name_label, 0,1,0,1, gtk.FILL,gtk.FILL,10,10) general_table.attach(self.player_name, 1,2,0,1, gtk.FILL,gtk.FILL,10,10) # Team Nano Spray team_nano_spray_label = label_create('Nano Spray') team_nano_spray_label.set_max_width_chars(10) team_nano_spray_label.set_line_wrap(True) self.team_nano_spray_combobox = combobox_setup(GLOBAL.Nano_Team_Colour, spring_options['team_nano_spray'], True) general_table.attach(team_nano_spray_label, 0,1,1,2, gtk.FILL,gtk.FILL,10,10) general_table.attach(self.team_nano_spray_combobox, 1,2,1,2, gtk.FILL,gtk.FILL,10,10) # Frame - Graphics graphics_frame = create_page(self, notebook, 'Graphics', 100, 75) # Table graphics_table = gtk.Table(rows=1,columns=2, homogeneous=False) graphics_table.show() graphics_frame.add(graphics_table) # Resolution resolution_label = label_create("Resolution") self.resolution_combobox = gtk.combo_box_new_text() for i in range (0,len(GLOBAL.Resolution)): self.resolution_combobox.append_text(GLOBAL.Resolution[i]) for i in range (0,len(GLOBAL.Resolution_X)): if GLOBAL.Resolution_X[i] == spring_options['resolution_x']: self.resolution_combobox.set_active(i) break self.resolution_combobox.show() graphics_table.attach(resolution_label, 0,1,0,1, gtk.FILL,gtk.FILL,10,10) graphics_table.attach(self.resolution_combobox, 1,2,0,1, gtk.FILL,gtk.FILL,10,10) # Fullscreen fullscreen_label = label_create("Fullscreen") self.fullscreen_combobox = combobox_setup(GLOBAL.Fullscreen, spring_options['fullscreen'], True) graphics_table.attach(fullscreen_label, 0,1,1,2, gtk.FILL,gtk.FILL,10,10) graphics_table.attach(self.fullscreen_combobox, 1,2,1,2, gtk.FILL,gtk.FILL,10,10) # Shadows shadows_label = label_create("Shadows") self.shadows_combobox = combobox_setup(GLOBAL.Shadows, spring_options['shadows'], True) graphics_table.attach(shadows_label, 0,1,2,3, gtk.FILL,gtk.FILL,10,10) graphics_table.attach(self.shadows_combobox, 1,2,2,3, gtk.FILL,gtk.FILL,10,10) # Fullscreen Anti-Aliasing fsaa_label = label_create("FSAA") self.fsaa_spinner = spinner_create(GLOBAL.FSAA_Level, spring_options['fsaa'], True) graphics_table.attach(fsaa_label, 0,1,3,4, gtk.FILL,gtk.FILL,10,10) graphics_table.attach(self.fsaa_spinner, 1,2,3,4, gtk.FILL,gtk.FILL,10,10) # Frame - Adv Graphics adv_graphics_frame = create_page(self, notebook, 'Adv Graphics', 100,75) # Table adv_graphics_table = gtk.Table(rows=2, columns=4, homogeneous=False) adv_graphics_table.show() adv_graphics_frame.add(adv_graphics_table) # 'Ground Decals' ground_decals_label = label_create("Ground Decals") self.ground_decals_spinner = spinner_create(GLOBAL.Ground_Decals, spring_options['ground_decals'], True) adv_graphics_table.attach(ground_decals_label, 0,1,0,1, gtk.FILL,gtk.FILL,10,10) adv_graphics_table.attach(self.ground_decals_spinner, 1,2,0,1, gtk.FILL,gtk.FILL,10,10) # Ground Detail ground_detail_label = label_create("Ground Detail") self.ground_detail_spinner = spinner_create(GLOBAL.Ground_Detail, spring_options['ground_detail'], True) adv_graphics_table.attach(ground_detail_label, 0,1,1,2, gtk.FILL,gtk.FILL,10,10) adv_graphics_table.attach(self.ground_detail_spinner, 1,2,1,2, gtk.FILL,gtk.FILL,10,10) # Grass Detail grass_detail_label = label_create("Grass Detail") self.grass_detail_spinner = spinner_create(GLOBAL.Grass_Detail, spring_options['grass_detail'], True) adv_graphics_table.attach(grass_detail_label, 0,1,2,3, gtk.FILL,gtk.FILL,10,10) adv_graphics_table.attach(self.grass_detail_spinner, 1,2,2,3, gtk.FILL,gtk.FILL,10,10) # Max Particles max_particles_label = label_create("Max Particles") self.max_particles_spinner = spinner_create(GLOBAL.Max_Particles, spring_options['max_particles'], True) adv_graphics_table.attach(max_particles_label, 0,1,3,4, gtk.FILL,gtk.FILL,10,10) adv_graphics_table.attach(self.max_particles_spinner, 1,2,3,4, gtk.FILL,gtk.FILL,10,10) # Unit Lod Distance unit_lod_distance_label = label_create("Unit Lod Distance") self.unit_lod_distance_spinner = spinner_create(GLOBAL.Unit_Lod_Dist, spring_options['unit_lod_dist'], True) adv_graphics_table.attach(unit_lod_distance_label, 0,1,4,5, gtk.FILL,gtk.FILL,10,10) adv_graphics_table.attach(self.unit_lod_distance_spinner, 1,2,4,5, gtk.FILL,gtk.FILL,10,10) # Frame - Adv Shaders adv_shaders_frame = create_page(self, notebook, 'Adv Shaders', 100,75) # Table adv_shaders_table = gtk.Table(rows=1, columns=3, homogeneous=False) adv_shaders_table.show() adv_shaders_frame.add(adv_shaders_table) # Advanced Sky adv_sky_label = label_create("Advanced Sky") self.adv_sky_combobox = combobox_setup(GLOBAL.Adv_Sky, spring_options['adv_sky'], True) adv_shaders_table.attach(adv_sky_label, 0,1,0,1, gtk.FILL,gtk.FILL,10,10) adv_shaders_table.attach(self.adv_sky_combobox, 1,2,0,1, gtk.FILL,gtk.FILL,10,10) # Dynamic Sky dynamic_sky_label = label_create("Dynamic Sky") self.dynamic_sky_combobox = combobox_setup(GLOBAL.Dynamic_Sky, spring_options['dynamic_sky'], True) adv_shaders_table.attach(dynamic_sky_label, 0,1,1,2, gtk.FILL,gtk.FILL,10,10) adv_shaders_table.attach(self.dynamic_sky_combobox, 1,2,1,2, gtk.FILL,gtk.FILL,10,10) # Advanced Unit Shading adv_unit_shading_label = label_create("Adv Unit Shading") self.adv_unit_shading_combobox = combobox_setup(GLOBAL.Adv_Unit_Shading, spring_options['adv_unit_shading'], True) adv_shaders_table.attach(adv_unit_shading_label, 0,1,2,3, gtk.FILL,gtk.FILL,10,10) adv_shaders_table.attach(self.adv_unit_shading_combobox, 1,2,2,3, gtk.FILL,gtk.FILL,10,10) # Reflective Water reflective_water_label = label_create("Reflective Water") self.reflective_water_combobox = combobox_setup(GLOBAL.Reflective_Water, spring_options['reflective_water'], True) adv_shaders_table.attach(reflective_water_label, 0,1,3,4, gtk.FILL,gtk.FILL,10,10) adv_shaders_table.attach(self.reflective_water_combobox, 1,2,3,4, gtk.FILL,gtk.FILL,10,10) # Sound sound_frame = create_page(self, notebook, 'Sound', 100,75) # Table - Debug sound_table = gtk.Table(rows=1, columns=4, homogeneous=False) sound_table.show() sound_frame.add(sound_table) # Sound Volume sound_volume_label = label_create("Sound Volume") self.sound_volume_spinner = spinner_create(GLOBAL.Sound_Volume, spring_options['sound_volume'], True) sound_table.attach(sound_volume_label, 0,1,0,1, gtk.FILL,gtk.FILL,10,10) sound_table.attach(self.sound_volume_spinner, 1,2,0,1, gtk.FILL,gtk.FILL,10,10) # Max Sounds max_sounds_label = label_create("Max Sounds") self.max_sounds_spinner = spinner_create(GLOBAL.Max_Sounds, spring_options['max_sounds'], True) sound_table.attach(max_sounds_label, 0,1,1,2, gtk.FILL,gtk.FILL,10,10) sound_table.attach(self.max_sounds_spinner, 1,2,1,2, gtk.FILL,gtk.FILL,10,10) # Debug debug_frame = create_page(self, notebook, 'Debug', 100,75) # Table - Debug debug_table = gtk.Table(rows=1, columns=4, homogeneous=False) debug_table.show() debug_frame.add(debug_table) # VerboseLevel verbose_level_label = label_create("Verbose Level") self.verbose_level_spinner = spinner_create(GLOBAL.Verbose_Level, spring_options['verbose_level'], True) debug_table.attach(verbose_level_label, 0,1,0,1, gtk.FILL,gtk.FILL,10,10) debug_table.attach(self.verbose_level_spinner, 1,2,0,1, gtk.FILL,gtk.FILL,10,10) # CatchAIExceptions catch_ai_exceptions_label = label_create("Catch AI Exceptions") self.catch_ai_exceptions_combobox = combobox_setup(GLOBAL.Catch_AI_Exceptions, spring_options['catch_ai_exceptions'], True) debug_table.attach(catch_ai_exceptions_label, 0,1,1,2, gtk.FILL,gtk.FILL,10,10) debug_table.attach(self.catch_ai_exceptions_combobox, 1,2,1,2, gtk.FILL,gtk.FILL,10,10) # Lobby lobby_frame = create_page(self, notebook, 'Lobby', 100,75) # Lobby - Notebook lobby_notebook = gtk.Notebook() lobby_notebook.set_tab_pos(gtk.POS_TOP) lobby_notebook.show() lobby_frame.add(lobby_notebook) # Lobby - Server List lobby_server_list_frame = create_page(self, lobby_notebook, 'Server List', 100,75) # Select Profile Window (scrolled) lobby_server_list_window = gtk.ScrolledWindow() lobby_server_list_window.set_border_width(10) lobby_server_list_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) lobby_server_list_window.show() lobby_server_list_frame.add(lobby_server_list_window) # Select Profile ListStore # Profile Name = String self.lobby_server_list_liststore = gtk.ListStore(str) self.lobby_server_list_treeview = gtk.TreeView(self.lobby_server_list_liststore) self.lobby_server_list_treeview.set_headers_visible(False) lobby_server_list_column_1 = gtk.TreeViewColumn('Server') self.lobby_server_list_treeview.append_column(lobby_server_list_column_1) lobby_server_list_window.add(self.lobby_server_list_treeview) self.lobby_server_list_treeview.show() server_list = self.lobby_ini.sections() for i in range(0,len(server_list)): self.lobby_server_list_liststore.append([server_list[i]]) # Add Mouse Click event to select_profile_treeview self.lobby_server_list_treeview.add_events(gtk.gdk.BUTTON_PRESS_MASK) self.lobby_server_list_treeview.connect('event', self.server_selection) # create a CellRenderers to render the data cell1 = gtk.CellRendererText() # add the cells to the columns lobby_server_list_column_1.pack_start(cell1, False) # set the cell attributes to the appropriate liststore column lobby_server_list_column_1.set_attributes(cell1, text=0) # Lobby - Add Server lobby_add_server_frame = create_page(self, lobby_notebook, 'Add Server', 100,75) # Table lobby_add_server_table = gtk.Table(rows=1,columns=1, homogeneous=False) lobby_add_server_table.show() lobby_add_server_frame.add(lobby_add_server_table) # Server Address server_address_label = label_create("Server") self.server_address_entry = gtk.Entry(max=0) # taspringmaster.clan-sy.com self.server_address_entry.set_text(GLOBAL.Lobby_Server) self.server_address_entry.show() lobby_add_server_table.attach(server_address_label, 0,1,0,1, gtk.FILL,gtk.FILL,5,5) lobby_add_server_table.attach(self.server_address_entry, 1,2,0,1, gtk.FILL,gtk.FILL,5,5) #Server Port server_port_label = label_create("Port") server_port_adjustment = gtk.Adjustment(GLOBAL.Lobby_Server_Port, lower=0, upper=65535, step_incr=100, page_incr=1000, page_size=0) self.server_port_spinner = gtk.SpinButton(server_port_adjustment, 0, 0) self.server_port_spinner.show() lobby_add_server_table.attach(server_port_label, 0,1,1,2, gtk.FILL,gtk.FILL,5,5) lobby_add_server_table.attach(self.server_port_spinner, 1,2,1,2, gtk.FILL,gtk.FILL,5,5) # User Name username_label = label_create("User Name") self.username_entry = gtk.Entry(max=0) self.username_entry.show() lobby_add_server_table.attach(username_label, 0,1,2,3, gtk.FILL,gtk.FILL,5,5) lobby_add_server_table.attach(self.username_entry, 1,2,2,3, gtk.FILL,gtk.FILL,5,5) # Password password_label = label_create("Password") self.password_entry = gtk.Entry(max=0) self.password_entry.set_visibility(False) self.password_entry.show() lobby_add_server_table.attach(password_label, 0,1,3,4, gtk.FILL,gtk.FILL,5,5) lobby_add_server_table.attach(self.password_entry, 1,2,3,4, gtk.FILL,gtk.FILL,5,5) # Button -> Add lobby_add_button = gtk.Button(label=None, stock=gtk.STOCK_ADD) lobby_add_button.connect("clicked", self.add_lobby_server) lobby_add_button.show() lobby_add_server_table.attach(lobby_add_button, 0,1,4,5, gtk.FILL,gtk.FILL,5,5) # Button -> Registry lobby_registry_button = gtk.Button(label="Register Account", stock=None) lobby_registry_button.connect("clicked", self.register_account) lobby_registry_button.show() lobby_add_server_table.attach(lobby_registry_button, 1,2,4,5, gtk.FILL,gtk.FILL,5,5)
def create(self, notebook): if self.platform == 'win32': spring_options = self.windows_load_spring_options() else: spring_options = self.unix_load_spring_options() # Frame - General general_frame = create_page(self, notebook, 'General', 100, 75) # Table general_table = gtk.Table(rows=2, columns=1, homogeneous=False) general_table.show() general_frame.add(general_table) # Name name_label = label_create('Name') self.player_name = gtk.Entry(max=0) self.player_name.set_text(spring_options['name']) self.player_name.set_width_chars(14) self.player_name.show() general_table.attach(name_label, 0, 1, 0, 1, gtk.FILL, gtk.FILL, 10, 10) general_table.attach(self.player_name, 1, 2, 0, 1, gtk.FILL, gtk.FILL, 10, 10) # Team Nano Spray team_nano_spray_label = label_create('Nano Spray') team_nano_spray_label.set_max_width_chars(10) team_nano_spray_label.set_line_wrap(True) self.team_nano_spray_combobox = combobox_setup( GLOBAL.Nano_Team_Colour, spring_options['team_nano_spray'], True) general_table.attach(team_nano_spray_label, 0, 1, 1, 2, gtk.FILL, gtk.FILL, 10, 10) general_table.attach(self.team_nano_spray_combobox, 1, 2, 1, 2, gtk.FILL, gtk.FILL, 10, 10) # Frame - Graphics graphics_frame = create_page(self, notebook, 'Graphics', 100, 75) # Table graphics_table = gtk.Table(rows=1, columns=2, homogeneous=False) graphics_table.show() graphics_frame.add(graphics_table) # Resolution resolution_label = label_create("Resolution") self.resolution_combobox = gtk.combo_box_new_text() for i in range(0, len(GLOBAL.Resolution)): self.resolution_combobox.append_text(GLOBAL.Resolution[i]) for i in range(0, len(GLOBAL.Resolution_X)): if GLOBAL.Resolution_X[i] == spring_options['resolution_x']: self.resolution_combobox.set_active(i) break self.resolution_combobox.show() graphics_table.attach(resolution_label, 0, 1, 0, 1, gtk.FILL, gtk.FILL, 10, 10) graphics_table.attach(self.resolution_combobox, 1, 2, 0, 1, gtk.FILL, gtk.FILL, 10, 10) # Fullscreen fullscreen_label = label_create("Fullscreen") self.fullscreen_combobox = combobox_setup(GLOBAL.Fullscreen, spring_options['fullscreen'], True) graphics_table.attach(fullscreen_label, 0, 1, 1, 2, gtk.FILL, gtk.FILL, 10, 10) graphics_table.attach(self.fullscreen_combobox, 1, 2, 1, 2, gtk.FILL, gtk.FILL, 10, 10) # Shadows shadows_label = label_create("Shadows") self.shadows_combobox = combobox_setup(GLOBAL.Shadows, spring_options['shadows'], True) graphics_table.attach(shadows_label, 0, 1, 2, 3, gtk.FILL, gtk.FILL, 10, 10) graphics_table.attach(self.shadows_combobox, 1, 2, 2, 3, gtk.FILL, gtk.FILL, 10, 10) # Fullscreen Anti-Aliasing fsaa_label = label_create("FSAA") self.fsaa_spinner = spinner_create(GLOBAL.FSAA_Level, spring_options['fsaa'], True) graphics_table.attach(fsaa_label, 0, 1, 3, 4, gtk.FILL, gtk.FILL, 10, 10) graphics_table.attach(self.fsaa_spinner, 1, 2, 3, 4, gtk.FILL, gtk.FILL, 10, 10) # Frame - Adv Graphics adv_graphics_frame = create_page(self, notebook, 'Adv Graphics', 100, 75) # Table adv_graphics_table = gtk.Table(rows=2, columns=4, homogeneous=False) adv_graphics_table.show() adv_graphics_frame.add(adv_graphics_table) # 'Ground Decals' ground_decals_label = label_create("Ground Decals") self.ground_decals_spinner = spinner_create( GLOBAL.Ground_Decals, spring_options['ground_decals'], True) adv_graphics_table.attach(ground_decals_label, 0, 1, 0, 1, gtk.FILL, gtk.FILL, 10, 10) adv_graphics_table.attach(self.ground_decals_spinner, 1, 2, 0, 1, gtk.FILL, gtk.FILL, 10, 10) # Ground Detail ground_detail_label = label_create("Ground Detail") self.ground_detail_spinner = spinner_create( GLOBAL.Ground_Detail, spring_options['ground_detail'], True) adv_graphics_table.attach(ground_detail_label, 0, 1, 1, 2, gtk.FILL, gtk.FILL, 10, 10) adv_graphics_table.attach(self.ground_detail_spinner, 1, 2, 1, 2, gtk.FILL, gtk.FILL, 10, 10) # Grass Detail grass_detail_label = label_create("Grass Detail") self.grass_detail_spinner = spinner_create( GLOBAL.Grass_Detail, spring_options['grass_detail'], True) adv_graphics_table.attach(grass_detail_label, 0, 1, 2, 3, gtk.FILL, gtk.FILL, 10, 10) adv_graphics_table.attach(self.grass_detail_spinner, 1, 2, 2, 3, gtk.FILL, gtk.FILL, 10, 10) # Max Particles max_particles_label = label_create("Max Particles") self.max_particles_spinner = spinner_create( GLOBAL.Max_Particles, spring_options['max_particles'], True) adv_graphics_table.attach(max_particles_label, 0, 1, 3, 4, gtk.FILL, gtk.FILL, 10, 10) adv_graphics_table.attach(self.max_particles_spinner, 1, 2, 3, 4, gtk.FILL, gtk.FILL, 10, 10) # Unit Lod Distance unit_lod_distance_label = label_create("Unit Lod Distance") self.unit_lod_distance_spinner = spinner_create( GLOBAL.Unit_Lod_Dist, spring_options['unit_lod_dist'], True) adv_graphics_table.attach(unit_lod_distance_label, 0, 1, 4, 5, gtk.FILL, gtk.FILL, 10, 10) adv_graphics_table.attach(self.unit_lod_distance_spinner, 1, 2, 4, 5, gtk.FILL, gtk.FILL, 10, 10) # Frame - Adv Shaders adv_shaders_frame = create_page(self, notebook, 'Adv Shaders', 100, 75) # Table adv_shaders_table = gtk.Table(rows=1, columns=3, homogeneous=False) adv_shaders_table.show() adv_shaders_frame.add(adv_shaders_table) # Advanced Sky adv_sky_label = label_create("Advanced Sky") self.adv_sky_combobox = combobox_setup(GLOBAL.Adv_Sky, spring_options['adv_sky'], True) adv_shaders_table.attach(adv_sky_label, 0, 1, 0, 1, gtk.FILL, gtk.FILL, 10, 10) adv_shaders_table.attach(self.adv_sky_combobox, 1, 2, 0, 1, gtk.FILL, gtk.FILL, 10, 10) # Dynamic Sky dynamic_sky_label = label_create("Dynamic Sky") self.dynamic_sky_combobox = combobox_setup( GLOBAL.Dynamic_Sky, spring_options['dynamic_sky'], True) adv_shaders_table.attach(dynamic_sky_label, 0, 1, 1, 2, gtk.FILL, gtk.FILL, 10, 10) adv_shaders_table.attach(self.dynamic_sky_combobox, 1, 2, 1, 2, gtk.FILL, gtk.FILL, 10, 10) # Advanced Unit Shading adv_unit_shading_label = label_create("Adv Unit Shading") self.adv_unit_shading_combobox = combobox_setup( GLOBAL.Adv_Unit_Shading, spring_options['adv_unit_shading'], True) adv_shaders_table.attach(adv_unit_shading_label, 0, 1, 2, 3, gtk.FILL, gtk.FILL, 10, 10) adv_shaders_table.attach(self.adv_unit_shading_combobox, 1, 2, 2, 3, gtk.FILL, gtk.FILL, 10, 10) # Reflective Water reflective_water_label = label_create("Reflective Water") self.reflective_water_combobox = combobox_setup( GLOBAL.Reflective_Water, spring_options['reflective_water'], True) adv_shaders_table.attach(reflective_water_label, 0, 1, 3, 4, gtk.FILL, gtk.FILL, 10, 10) adv_shaders_table.attach(self.reflective_water_combobox, 1, 2, 3, 4, gtk.FILL, gtk.FILL, 10, 10) # Sound sound_frame = create_page(self, notebook, 'Sound', 100, 75) # Table - Debug sound_table = gtk.Table(rows=1, columns=4, homogeneous=False) sound_table.show() sound_frame.add(sound_table) # Sound Volume sound_volume_label = label_create("Sound Volume") self.sound_volume_spinner = spinner_create( GLOBAL.Sound_Volume, spring_options['sound_volume'], True) sound_table.attach(sound_volume_label, 0, 1, 0, 1, gtk.FILL, gtk.FILL, 10, 10) sound_table.attach(self.sound_volume_spinner, 1, 2, 0, 1, gtk.FILL, gtk.FILL, 10, 10) # Max Sounds max_sounds_label = label_create("Max Sounds") self.max_sounds_spinner = spinner_create(GLOBAL.Max_Sounds, spring_options['max_sounds'], True) sound_table.attach(max_sounds_label, 0, 1, 1, 2, gtk.FILL, gtk.FILL, 10, 10) sound_table.attach(self.max_sounds_spinner, 1, 2, 1, 2, gtk.FILL, gtk.FILL, 10, 10) # Debug debug_frame = create_page(self, notebook, 'Debug', 100, 75) # Table - Debug debug_table = gtk.Table(rows=1, columns=4, homogeneous=False) debug_table.show() debug_frame.add(debug_table) # VerboseLevel verbose_level_label = label_create("Verbose Level") self.verbose_level_spinner = spinner_create( GLOBAL.Verbose_Level, spring_options['verbose_level'], True) debug_table.attach(verbose_level_label, 0, 1, 0, 1, gtk.FILL, gtk.FILL, 10, 10) debug_table.attach(self.verbose_level_spinner, 1, 2, 0, 1, gtk.FILL, gtk.FILL, 10, 10) # CatchAIExceptions catch_ai_exceptions_label = label_create("Catch AI Exceptions") self.catch_ai_exceptions_combobox = combobox_setup( GLOBAL.Catch_AI_Exceptions, spring_options['catch_ai_exceptions'], True) debug_table.attach(catch_ai_exceptions_label, 0, 1, 1, 2, gtk.FILL, gtk.FILL, 10, 10) debug_table.attach(self.catch_ai_exceptions_combobox, 1, 2, 1, 2, gtk.FILL, gtk.FILL, 10, 10) # Lobby lobby_frame = create_page(self, notebook, 'Lobby', 100, 75) # Lobby - Notebook lobby_notebook = gtk.Notebook() lobby_notebook.set_tab_pos(gtk.POS_TOP) lobby_notebook.show() lobby_frame.add(lobby_notebook) # Lobby - Server List lobby_server_list_frame = create_page(self, lobby_notebook, 'Server List', 100, 75) # Select Profile Window (scrolled) lobby_server_list_window = gtk.ScrolledWindow() lobby_server_list_window.set_border_width(10) lobby_server_list_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) lobby_server_list_window.show() lobby_server_list_frame.add(lobby_server_list_window) # Select Profile ListStore # Profile Name = String self.lobby_server_list_liststore = gtk.ListStore(str) self.lobby_server_list_treeview = gtk.TreeView( self.lobby_server_list_liststore) self.lobby_server_list_treeview.set_headers_visible(False) lobby_server_list_column_1 = gtk.TreeViewColumn('Server') self.lobby_server_list_treeview.append_column( lobby_server_list_column_1) lobby_server_list_window.add(self.lobby_server_list_treeview) self.lobby_server_list_treeview.show() server_list = self.lobby_ini.sections() for i in range(0, len(server_list)): self.lobby_server_list_liststore.append([server_list[i]]) # Add Mouse Click event to select_profile_treeview self.lobby_server_list_treeview.add_events(gtk.gdk.BUTTON_PRESS_MASK) self.lobby_server_list_treeview.connect('event', self.server_selection) # create a CellRenderers to render the data cell1 = gtk.CellRendererText() # add the cells to the columns lobby_server_list_column_1.pack_start(cell1, False) # set the cell attributes to the appropriate liststore column lobby_server_list_column_1.set_attributes(cell1, text=0) # Lobby - Add Server lobby_add_server_frame = create_page(self, lobby_notebook, 'Add Server', 100, 75) # Table lobby_add_server_table = gtk.Table(rows=1, columns=1, homogeneous=False) lobby_add_server_table.show() lobby_add_server_frame.add(lobby_add_server_table) # Server Address server_address_label = label_create("Server") self.server_address_entry = gtk.Entry( max=0) # taspringmaster.clan-sy.com self.server_address_entry.set_text(GLOBAL.Lobby_Server) self.server_address_entry.show() lobby_add_server_table.attach(server_address_label, 0, 1, 0, 1, gtk.FILL, gtk.FILL, 5, 5) lobby_add_server_table.attach(self.server_address_entry, 1, 2, 0, 1, gtk.FILL, gtk.FILL, 5, 5) #Server Port server_port_label = label_create("Port") server_port_adjustment = gtk.Adjustment(GLOBAL.Lobby_Server_Port, lower=0, upper=65535, step_incr=100, page_incr=1000, page_size=0) self.server_port_spinner = gtk.SpinButton(server_port_adjustment, 0, 0) self.server_port_spinner.show() lobby_add_server_table.attach(server_port_label, 0, 1, 1, 2, gtk.FILL, gtk.FILL, 5, 5) lobby_add_server_table.attach(self.server_port_spinner, 1, 2, 1, 2, gtk.FILL, gtk.FILL, 5, 5) # User Name username_label = label_create("User Name") self.username_entry = gtk.Entry(max=0) self.username_entry.show() lobby_add_server_table.attach(username_label, 0, 1, 2, 3, gtk.FILL, gtk.FILL, 5, 5) lobby_add_server_table.attach(self.username_entry, 1, 2, 2, 3, gtk.FILL, gtk.FILL, 5, 5) # Password password_label = label_create("Password") self.password_entry = gtk.Entry(max=0) self.password_entry.set_visibility(False) self.password_entry.show() lobby_add_server_table.attach(password_label, 0, 1, 3, 4, gtk.FILL, gtk.FILL, 5, 5) lobby_add_server_table.attach(self.password_entry, 1, 2, 3, 4, gtk.FILL, gtk.FILL, 5, 5) # Button -> Add lobby_add_button = gtk.Button(label=None, stock=gtk.STOCK_ADD) lobby_add_button.connect("clicked", self.add_lobby_server) lobby_add_button.show() lobby_add_server_table.attach(lobby_add_button, 0, 1, 4, 5, gtk.FILL, gtk.FILL, 5, 5) # Button -> Registry lobby_registry_button = gtk.Button(label="Register Account", stock=None) lobby_registry_button.connect("clicked", self.register_account) lobby_registry_button.show() lobby_add_server_table.attach(lobby_registry_button, 1, 2, 4, 5, gtk.FILL, gtk.FILL, 5, 5)