リビジョン | de54eea7e98656c92db0011f9c4843d1ea90612c (tree) |
---|---|
日時 | 2013-11-04 22:01:26 |
作者 | Shyouzou Sugitani <shy@user...> |
コミッター | Shyouzou Sugitani |
fix \[lock/unlock,repaint]
@@ -1,3 +1,7 @@ | ||
1 | +Mon November 4 2013 Shyouzou Sugitani <shy@users.sourceforge.jp> | |
2 | + * \![lock/unlock,repaint]が機能するように修正した. | |
3 | + (SSP同様に実行中のスクリプト内でのみ有効とした.) | |
4 | + | |
1 | 5 | Sun November 3 2013 Shyouzou Sugitani <shy@users.sourceforge.jp> |
2 | 6 | * loggigモジュールへの出力をコンソールにも出すようにした. |
3 | 7 |
@@ -707,6 +707,8 @@ class BalloonWindow: | ||
707 | 707 | return 1 if self.__shown else 0 |
708 | 708 | |
709 | 709 | def show(self): |
710 | + if self.request_parent('GET', 'lock_repaint'): | |
711 | + return | |
710 | 712 | if self.__shown: |
711 | 713 | return |
712 | 714 | self.__shown = 1 |
@@ -828,6 +830,8 @@ class BalloonWindow: | ||
828 | 830 | return text |
829 | 831 | |
830 | 832 | def redraw(self, widget, cr): |
833 | + if self.request_parent('GET', 'lock_repaint'): | |
834 | + return | |
831 | 835 | if not self.__shown: |
832 | 836 | return True |
833 | 837 | assert self.balloon_surface is not None |
@@ -168,6 +168,7 @@ class Sakura: | ||
168 | 168 | def handle_request(self, event_type, event, *arglist, **argdict): |
169 | 169 | assert event_type in ['GET', 'NOTIFY'] |
170 | 170 | handlers = { |
171 | + 'lock_repaint': self.get_lock_repaint | |
171 | 172 | } |
172 | 173 | handler = handlers.get(event, getattr(self, event, None)) |
173 | 174 | if handler is None: |
@@ -178,6 +179,9 @@ class Sakura: | ||
178 | 179 | if event_type == 'GET': |
179 | 180 | return result |
180 | 181 | |
182 | + def get_lock_repaint(self): | |
183 | + return self.lock_repaint | |
184 | + | |
181 | 185 | def attach_observer(self, observer): |
182 | 186 | if observer not in self.__observers: |
183 | 187 | self.__observers[observer] = 1 |
@@ -2275,6 +2279,7 @@ class Sakura: | ||
2275 | 2279 | self.script_position = 0 |
2276 | 2280 | self.time_critical_session = 0 |
2277 | 2281 | self.quick_session = 0 |
2282 | + self.lock_repaint = 0 # SSP compat | |
2278 | 2283 | self.set_synchronized_session(reset=1) |
2279 | 2284 | self.balloon.set_autoscroll(True) |
2280 | 2285 | self.reset_idle_time() |
@@ -910,6 +910,7 @@ class SurfaceWindow: | ||
910 | 910 | "{},{},{},{}".format(self.side, self.surface_id, w, h), |
911 | 911 | "{}".format(prev_id), |
912 | 912 | "{},{},{},{}".format(new_x, new_y, new_x + w, new_y + h)) |
913 | + self.update_frame_buffer() #XXX | |
913 | 914 | |
914 | 915 | def iter_mayuna(self, surface_width, surface_height, mayuna, done): |
915 | 916 | for surface_id, interval, method, args in mayuna.patterns: |
@@ -1046,6 +1047,8 @@ class SurfaceWindow: | ||
1046 | 1047 | return surface |
1047 | 1048 | |
1048 | 1049 | def update_frame_buffer(self): |
1050 | + if self.request_parent('GET', 'lock_repaint'): | |
1051 | + return | |
1049 | 1052 | new_surface = self.create_image_surface(self.seriko.base_id) |
1050 | 1053 | assert new_surface is not None |
1051 | 1054 | # update collision areas |
@@ -1098,6 +1101,8 @@ class SurfaceWindow: | ||
1098 | 1101 | self.seriko.add_overlay(self, actor, surface_id, x, y, method) |
1099 | 1102 | |
1100 | 1103 | def move_surface(self, xoffset, yoffset): |
1104 | + if self.request_parent('GET', 'lock_repaint'): | |
1105 | + return | |
1101 | 1106 | x, y = self.get_position() |
1102 | 1107 | self.window.move(x + xoffset, y + yoffset) |
1103 | 1108 | if self.side < 2: |
@@ -1168,6 +1173,8 @@ class SurfaceWindow: | ||
1168 | 1173 | return centerx, centery |
1169 | 1174 | |
1170 | 1175 | def set_position(self, x, y): |
1176 | + if self.request_parent('GET', 'lock_repaint'): | |
1177 | + return | |
1171 | 1178 | self.position = (x, y) |
1172 | 1179 | new_x, new_y = self.get_position() |
1173 | 1180 | self.window.move(new_x, new_y) |
@@ -1226,6 +1233,8 @@ class SurfaceWindow: | ||
1226 | 1233 | return self.__shown |
1227 | 1234 | |
1228 | 1235 | def show(self): |
1236 | + if self.request_parent('GET', 'lock_repaint'): | |
1237 | + return | |
1229 | 1238 | if self.__shown: |
1230 | 1239 | return |
1231 | 1240 | self.__shown = True |