[gnome-nibbles/arnaudb/wip/gtk4: 178/188] Improve end-of-level look.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles/arnaudb/wip/gtk4: 178/188] Improve end-of-level look.
- Date: Fri, 2 Oct 2020 15:55:22 +0000 (UTC)
commit 939e787d540a4e0e8d4c7736f5465bf4e1cd1c41
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Wed Jun 17 17:34:01 2020 +0200
Improve end-of-level look.
src/nibbles-view.vala | 14 +++++++++++---
src/nibbles-window.vala | 4 ++--
2 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/src/nibbles-view.vala b/src/nibbles-view.vala
index 8c8b61b..0c3a5ed 100644
--- a/src/nibbles-view.vala
+++ b/src/nibbles-view.vala
@@ -136,6 +136,17 @@ private class NibblesView : Widget
load_pixmap ();
}
+ internal void hide_content ()
+ {
+ foreach (var actor in bonus_actors.values)
+ {
+ actor.hide ();
+ actor.unparent ();
+ actor.destroy ();
+ }
+ bonus_actors.clear ();
+ }
+
// protected override bool configure_event (Gdk.EventConfigure event)
// {
// int new_tile_size, ts_x, ts_y;
@@ -494,9 +505,6 @@ private class NibblesView : Widget
foreach (var worm in game.worms)
worm_actors.@get (worm).hide ();
- foreach (var actor in warp_actors)
- actor.hide ();
-
// level.save_easing_state ();
// level.set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
// level.set_easing_duration (GAMEDELAY * 20);
diff --git a/src/nibbles-window.vala b/src/nibbles-window.vala
index 6f0a0a4..5e02903 100644
--- a/src/nibbles-window.vala
+++ b/src/nibbles-window.vala
@@ -869,7 +869,7 @@ private class NibblesWindow : ApplicationWindow
if (game.current_level == NibblesGame.MAX_LEVEL)
return;
- view.hide ();
+ view.hide_content ();
new_game_action.set_enabled (false);
pause_action.set_enabled (false);
@@ -1006,7 +1006,7 @@ private class NibblesWindow : ApplicationWindow
play_again_button.grab_focus ();
- view.hide ();
+ view.hide_content ();
end_of_game = true;
new_game_action.set_enabled (true);
pause_action.set_enabled (false);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]