File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ namespace home {
1515 {
1616 using namespace gf ::literals;
1717
18- action_group.actions .emplace (" debug" _id, gf::ActionSettings (gf::ActionType::Instantaneous).add_keycode_control (gf::Keycode::P));
19-
2018 map.filename = " map/Map.tmx" ;
2119
2220 main_theme_music.filename = " sounds/main_theme.ogg" ;
Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ namespace home {
1717
1818 gf::ResourceBundle bundle (GameHub* hub);
1919
20- gf::ActionGroupSettings action_group;
21-
2220 gf::RichMapResource map;
2321
2422 gf::AudioSourceResource main_theme_music;
Original file line number Diff line number Diff line change 77
88namespace home {
99
10- using namespace gf ::literals;
11-
1210 WorldScene::WorldScene (GameHub* hub, const WorldData& data)
1311 : m_hub(hub)
14- , m_action_group(data.action_group )
12+ , m_action_group(compute_settings() )
1513 , m_main_theme_music(hub->resource_manager ()->get<gf::Music>(data.main_theme_music.filename))
1614 , m_breath_low_o2_sound(hub->resource_manager ()->get<gf::Sound>(data.breath_low_o2_sound.filename))
1715 , m_victory_sound(hub->resource_manager ()->get<gf::Sound>(data.victory_sound.filename))
@@ -51,6 +49,16 @@ namespace home {
5149 });
5250 }
5351
52+ gf::ActionGroupSettings WorldScene::compute_settings ()
53+ {
54+ using namespace gf ::literals;
55+ gf::ActionGroupSettings settings;
56+
57+ settings.actions .emplace (" debug" _id, gf::ActionSettings (gf::ActionType::Instantaneous).add_keycode_control (gf::Keycode::P));
58+
59+ return settings;
60+ }
61+
5462 void WorldScene::do_update (gf::Time time)
5563 {
5664 update_entities (time);
@@ -69,6 +77,8 @@ namespace home {
6977
7078 void WorldScene::do_handle_actions ()
7179 {
80+ using namespace gf ::literals;
81+
7282 if (m_action_group.active (" debug" _id)) {
7383 m_debug = !m_debug;
7484 m_physics_debug.set_awake (m_debug);
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ namespace home {
3030 }
3131
3232 private:
33+ static gf::ActionGroupSettings compute_settings ();
34+
3335 void do_update (gf::Time time) override ;
3436 void do_process_event (const gf::Event& event) override ;
3537 void do_handle_actions () override ;
You can’t perform that action at this time.
0 commit comments