예제 #1
0
파일: views.py 프로젝트: embatbr/Minecraft
    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
예제 #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()
예제 #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()
예제 #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()
예제 #5
0
파일: views.py 프로젝트: embatbr/Minecraft
    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()
예제 #6
0
 def on_close(self):
     G.save_config()
     self.world.packetreceiver.stop(
     )  # Disconnect from the server so the process can close
예제 #7
0
 def on_close(self):
     G.save_config()
     self.world.packetreceiver.stop()  # Disconnect from the server so the process can close
예제 #8
0
 def multisampling_callback(self):
     G.MULTISAMPLING = self.button.toggled
     G.config.set("Multisampling", "multisampling",
                  str(self.button.toggled))
     G.save_config()