mirror of
https://github.com/quantum5/punyverse.git
synced 2025-04-24 21:21:59 -04:00
Allowed the screenshot to be saved to a file instead of clipboard.
This commit is contained in:
parent
34d316726f
commit
4151622b91
|
@ -208,7 +208,7 @@ class Applet(pyglet.window.Window):
|
||||||
|
|
||||||
def screenshot(self):
|
def screenshot(self):
|
||||||
image = pyglet.image.get_buffer_manager().get_color_buffer()
|
image = pyglet.image.get_buffer_manager().get_color_buffer()
|
||||||
if hasattr(self, '_hwnd'):
|
if hasattr(self, '_hwnd') and not self.modifiers & key.MOD_CTRL:
|
||||||
from ctypes import windll, cdll
|
from ctypes import windll, cdll
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
import tempfile
|
import tempfile
|
||||||
|
@ -247,6 +247,7 @@ class Applet(pyglet.window.Window):
|
||||||
direction=(dx, dy, dz)))
|
direction=(dx, dy, dz)))
|
||||||
|
|
||||||
def on_mouse_press(self, x, y, button, modifiers):
|
def on_mouse_press(self, x, y, button, modifiers):
|
||||||
|
self.modifiers = modifiers
|
||||||
if not self.loaded:
|
if not self.loaded:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -264,6 +265,7 @@ class Applet(pyglet.window.Window):
|
||||||
self.cam.mouse_move(dx * MOUSE_SENSITIVITY, dy * MOUSE_SENSITIVITY)
|
self.cam.mouse_move(dx * MOUSE_SENSITIVITY, dy * MOUSE_SENSITIVITY)
|
||||||
|
|
||||||
def on_key_press(self, symbol, modifiers):
|
def on_key_press(self, symbol, modifiers):
|
||||||
|
self.modifiers = modifiers
|
||||||
if symbol == key.Q:
|
if symbol == key.Q:
|
||||||
self.screenshot()
|
self.screenshot()
|
||||||
if not self.loaded:
|
if not self.loaded:
|
||||||
|
|
Loading…
Reference in a new issue