Mercurial > parpg-source
comparison gamescenecontroller.py @ 167:b3b82c2aebee
Using fife settings module again instead of our own.
author | Beliar <KarstenBock@gmx.net> |
---|---|
date | Mon, 20 Feb 2012 16:50:10 +0100 |
parents | d224bbce512a |
children | 62aed6388159 |
comparison
equal
deleted
inserted
replaced
166:a6bbb732b27b | 167:b3b82c2aebee |
---|---|
98 | 98 |
99 #this is temporary until we can set the native cursor | 99 #this is temporary until we can set the native cursor |
100 self.resetMouseCursor() | 100 self.resetMouseCursor() |
101 self.paused = False | 101 self.paused = False |
102 | 102 |
103 if model.settings.fife.EnableSound: | 103 if model.settings.get("fife", "PlaySounds"): |
104 if not self.view.sounds.music_init: | 104 if not self.view.sounds.music_init: |
105 music_path = 'music' | 105 music_path = 'music' |
106 music_file = random.choice( | 106 music_file = random.choice( |
107 glob.glob('/'.join([music_path, '*.ogg'])) | 107 glob.glob('/'.join([music_path, '*.ogg'])) |
108 ) | 108 ) |
307 direction = self.scroll_data["mouse"] = [] | 307 direction = self.scroll_data["mouse"] = [] |
308 | 308 |
309 #up | 309 #up |
310 if mouse_y <= pixle_edge: | 310 if mouse_y <= pixle_edge: |
311 direction.append("up") | 311 direction.append("up") |
312 image = '/'.join(['gui/cursors', settings.parpg.CursorUp]) | 312 image = '/'.join(['gui/cursors', settings.get("parpg", "CursorUp")]) |
313 | 313 |
314 #right | 314 #right |
315 if mouse_x >= screen_width - pixle_edge: | 315 if mouse_x >= screen_width - pixle_edge: |
316 direction.append("right") | 316 direction.append("right") |
317 image = '/'.join(['gui/cursors', settings.parpg.CursorRight]) | 317 image = '/'.join(['gui/cursors', settings.get("parpg", "CursorRight")]) |
318 | 318 |
319 #down | 319 #down |
320 if mouse_y >= screen_height - pixle_edge: | 320 if mouse_y >= screen_height - pixle_edge: |
321 direction.append("down") | 321 direction.append("down") |
322 image = '/'.join(['gui/cursors', settings.parpg.CursorDown]) | 322 image = '/'.join(['gui/cursors', settings.get("parpg", "CursorDown")]) |
323 | 323 |
324 #left | 324 #left |
325 if mouse_x <= pixle_edge: | 325 if mouse_x <= pixle_edge: |
326 direction.append("left") | 326 direction.append("left") |
327 image = '/'.join(['gui/cursors', settings.parpg.CursorLeft]) | 327 image = '/'.join(['gui/cursors', settings.get("parpg", "CursorLeft")]) |
328 | 328 |
329 if image is not None and not data_drag.dragging: | 329 if image is not None and not data_drag.dragging: |
330 self.setMouseCursor(image, image) | 330 self.setMouseCursor(image, image) |
331 | 331 |
332 | 332 |
385 #this is how many pxls the camera is moved in one time frame | 385 #this is how many pxls the camera is moved in one time frame |
386 scroll_offset = self.scroll_data["offset"] = [0,0] | 386 scroll_offset = self.scroll_data["offset"] = [0,0] |
387 | 387 |
388 mouse = self.scroll_data["mouse"] | 388 mouse = self.scroll_data["mouse"] |
389 keyboard = self.scroll_data["kb"] | 389 keyboard = self.scroll_data["kb"] |
390 speed = self.model.settings.parpg.ScrollSpeed | 390 speed = self.model.settings.get("parpg", "ScrollSpeed") |
391 | 391 |
392 #adds a value to the offset depending on the contents of each | 392 #adds a value to the offset depending on the contents of each |
393 # of the controllers: set() removes doubles | 393 # of the controllers: set() removes doubles |
394 scroll_direction = set(mouse+keyboard) | 394 scroll_direction = set(mouse+keyboard) |
395 for direction in scroll_direction: | 395 for direction in scroll_direction: |