Example #1
0
    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
Example #2
0
    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()
Example #3
0
    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()
Example #4
0
    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()
Example #5
0
    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()
Example #6
0
 def on_close(self):
     G.save_config()
     self.world.packetreceiver.stop(
     )  # Disconnect from the server so the process can close
Example #7
0
 def on_close(self):
     G.save_config()
     self.world.packetreceiver.stop()  # Disconnect from the server so the process can close
Example #8
0
 def multisampling_callback(self):
     G.MULTISAMPLING = self.button.toggled
     G.config.set("Multisampling", "multisampling",
                  str(self.button.toggled))
     G.save_config()