[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[adonthell-wastesedge-commits] Release_0-3-1 22178ae 058/237: Map gets o
From: |
Kai Sterker |
Subject: |
[adonthell-wastesedge-commits] Release_0-3-1 22178ae 058/237: Map gets only updated if the main_menu or data_screen aren't displayed. |
Date: |
Mon, 25 Jul 2016 18:14:57 +0000 (UTC) |
tag: Release_0-3-1
commit 22178aea156fc672b8482fb6d7fbead9c7e54fb9
Author: adondev <adondev>
Commit: adondev <adondev>
Map gets only updated if the main_menu or data_screen aren't displayed.
---
scripts/init.py | 1 +
scripts/modules/main_menu.py | 15 +++++++++++++--
scripts/modules/schedules.py | 16 +++++++++-------
scripts/schedules/keyboard_control.py | 17 +++++++++++++++--
4 files changed, 38 insertions(+), 11 deletions(-)
diff --git a/scripts/init.py b/scripts/init.py
index c9c4df2..2f4415c 100755
--- a/scripts/init.py
+++ b/scripts/init.py
@@ -570,6 +570,7 @@ if retval < 5:
talan.stand_north ()
talan.set_schedule ("talan")
+ # -- that's a clone for now
alek = characters ["Alek Endhelm"]
alek.set_dialogue ("dialogues/alek_start")
alek.load ("servant2.mchar")
diff --git a/scripts/modules/main_menu.py b/scripts/modules/main_menu.py
index 0402f8e..3786100 100755
--- a/scripts/modules/main_menu.py
+++ b/scripts/modules/main_menu.py
@@ -208,18 +208,24 @@ class main_menu (win_container):
self.lg.thisown = 0
self.lg.set_activate (1)
if self.startup != 0:
- self.quit = 0
+ # In game
+ self.set_visible (0)
+ gamedata_map_engine ().set_should_update_map (0)
+ self.lg.py_signal_connect (self.on_ingame_data_close,
win_event_CLOSE)
else:
+ # Title screen
self.lg.py_signal_connect (self.on_data_close, win_event_CLOSE)
win_manager_add (self.lg)
win_manager_set_focus (self.lg)
# Save Game
elif sel == 3:
- self.quit = 0
self.lg = data_screen (SAVE_SCREEN)
self.lg.thisown = 0
self.lg.set_activate(1)
+ self.set_visible (0)
+ gamedata_map_engine ().set_should_update_map (0)
+ self.lg.py_signal_connect (self.on_ingame_data_close,
win_event_CLOSE)
win_manager_add (self.lg)
win_manager_set_focus (self.lg)
@@ -232,6 +238,11 @@ class main_menu (win_container):
if retval == 1:
self.quit = 0
+ def on_ingame_data_close (self, retval):
+ self.lg = None
+ gamedata_map_engine ().set_should_update_map (1)
+ self.quit = 0
+
# -- Scrolls the different menu options into view
def create_menu (self, moves, goals):
done = len (self.labels)
diff --git a/scripts/modules/schedules.py b/scripts/modules/schedules.py
index 7a71ada..72d9443 100755
--- a/scripts/modules/schedules.py
+++ b/scripts/modules/schedules.py
@@ -177,13 +177,15 @@ class bubble (win_container):
# -- draws the bubble above the character's head
def on_update (self, mychar):
- # -- but only if on the same submap as the player
- if mychar.submap () == gamedata_player ().submap ():
- x, y = self.get_window_pos (mychar)
- self.move (x, y)
- self.remain = self.remain - 1
- else:
- self.remain = 0
+ # -- but only if the map should be updated
+ if gamedata_map_engine ().should_update_map ():
+ # -- and if on the same submap as the player
+ if mychar.submap () == gamedata_player ().submap ():
+ x, y = self.get_window_pos (mychar)
+ self.move (x, y)
+ self.remain = self.remain - 1
+ else:
+ self.remain = 0
# -- center the window above the characters head
def get_window_pos (self, mychar):
diff --git a/scripts/schedules/keyboard_control.py
b/scripts/schedules/keyboard_control.py
index 6b742b1..3c58d4d 100755
--- a/scripts/schedules/keyboard_control.py
+++ b/scripts/schedules/keyboard_control.py
@@ -1,11 +1,15 @@
# -- When the menu is closing, react accordingly
def on_menu_close (retval, player):
- # -- Reactivate the player's schedule
-# player.set_schedule_active (1)
+ # Tells the map engine to update the map
+ map_engine.set_should_update_map (1)
# -- Quit was selected, so that's what we do :)
if retval == 5:
map_engine.quit ()
+# Reactive map update when data_screen closed
+def on_data_screen_close (retval, player):
+ map_engine.set_should_update_map (1)
+
# Opens the gate
def open_gate ():
# Get the mapobjects
@@ -72,6 +76,9 @@ elif input_has_been_pushed (SDLK_ESCAPE):
# -- open main menu without animation, with saving and background enabled
menu = main_menu.main_menu (1, 1, 1)
menu.thisown = C
+
+ # Stop updating the map
+ map_engine.set_should_update_map (0)
# -- this tells us when the main menu is closed
menu.py_signal_connect (on_menu_close, win_event_CLOSE, (myself))
@@ -106,6 +113,9 @@ elif input_has_been_pushed (SDLK_p):
elif input_has_been_pushed (SDLK_l):
s = data_screen (LOAD_SCREEN)
s.thisown = C
+ s.py_signal_connect (on_data_screen_close, win_event_CLOSE, None)
+ # Stop updating the map
+ map_engine.set_should_update_map (0)
s.set_activate (1)
win_manager_add (s)
win_manager_set_focus (s)
@@ -115,6 +125,9 @@ elif input_has_been_pushed (SDLK_l):
elif input_has_been_pushed (SDLK_s):
s = data_screen (SAVE_SCREEN)
s.thisown = C
+ s.py_signal_connect (on_data_screen_close, win_event_CLOSE, None)
+ # Stop updating the map
+ map_engine.set_should_update_map (0)
s.set_activate (1)
win_manager_add (s)
win_manager_set_focus (s)
- [adonthell-wastesedge-commits] Release_0-3-1 d2a86c9 030/237: Added some more characters and dialogues, (continued)
- [adonthell-wastesedge-commits] Release_0-3-1 d2a86c9 030/237: Added some more characters and dialogues, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 de03633 047/237: Commited my own files again! :/, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 fe87ce5 041/237: Stupid kdevelop!!!, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 56fe2ff 046/237: Fixed Oliver's teleport bug., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 edbcb94 007/237: Added autoconf/automake support., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 89ba59b 024/237: Continued map rooms., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 78ff7bc 049/237: More schedules converted to the new pathfinding code, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 a4f92b4 055/237: Ooppps! Fixed an error of my own, sorry., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 c6dcf69 044/237: Using pathfinding methods for Talan schedule., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 9cb9bdd 048/237: Converted Orloth to new pathfinding, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 22178ae 058/237: Map gets only updated if the main_menu or data_screen aren't displayed.,
Kai Sterker <=
- [adonthell-wastesedge-commits] Release_0-3-1 51e5413 051/237: Updated frostbloom and sarin to new pathfinding code, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 d304dc6 069/237: Updated Orloth's and Erek's dialogue, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 842c4b9 076/237: Oops! Forgot this file., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 4bcc0dd 066/237: FIXED bugs in automake, silverhair's room connection script and, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 5719e8c 078/237: Updated Silverhair's bed., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 aad3c95 098/237: Fixed missing installation target, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 feeadbf 099/237: FIXED data installation, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 4330c0d 053/237: Removed in-game imports, which are now done at init time., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 177b48f 060/237: Changed map - it now has a member to prevent NPCs to be accidentally, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 0f70295 082/237: Added some events., Kai Sterker, 2016/07/25