def on_mouse_press(self, x, y, button, modifiers): super(TexturesView, self).on_mouse_press(x, y, button, modifiers) for button in self.texture_buttons: if button.toggled: G.config.set("Graphics", "texture_pack", button.id) G.TEXTURE_PACK = button.id for block in G.BLOCKS_DIR.values(): block.__init__() #Reload textures G.save_config() button.toggled = False
def on_button_toggle(self): for button in self.texture_buttons: if button != self.current_toggled and button.toggled: self.current_toggled.toggled = False self.current_toggled = button G.config.set("Graphics", "texture_pack", button.id) G.TEXTURE_PACK = button.id for block in G.BLOCKS_DIR.values(): block.update_texture() #Reload textures G.save_config()
def on_key_press(self, symbol, modifiers): active_button = None for button in self.buttons: if isinstance(button, ToggleButton) and button.toggled: active_button = button break if not active_button: return active_button.caption = pyglet.window.key.symbol_string(symbol) active_button.toggled = False G.config.set("Controls", active_button.id, pyglet.window.key.symbol_string(symbol)) G.save_config()
def on_close(self): G.save_config() self.world.packetreceiver.stop( ) # Disconnect from the server so the process can close
def on_close(self): G.save_config() self.world.packetreceiver.stop() # Disconnect from the server so the process can close
def multisampling_callback(self): G.MULTISAMPLING = self.button.toggled G.config.set("Multisampling", "multisampling", str(self.button.toggled)) G.save_config()