diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2022-07-03 11:24:05 -0400 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2022-07-03 11:24:05 -0400 |
commit | 7d71827c25ff1ab47c03aaa26f63a9a754b3d549 (patch) | |
tree | 896eb9b61a3bc3be90d068b12ac38f07b99ffce5 /src/game.cpp | |
parent | 3d101c5638ef573993f387a2cecbb794e6e056e6 (diff) | |
download | systemviewer-7d71827c25ff1ab47c03aaa26f63a9a754b3d549.tar.gz systemviewer-7d71827c25ff1ab47c03aaa26f63a9a754b3d549.tar.bz2 systemviewer-7d71827c25ff1ab47c03aaa26f63a9a754b3d549.zip |
Condensed solar system csv files into one.
Add argument parser for help and different systems
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp index b1d0b00..d992a99 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -21,7 +21,7 @@ Game::State Game::m_state = State::RUNNING; Game::WindowContexts Game::contexts; void -Game::setup(unsigned w, unsigned h) +Game::setup(unsigned w, unsigned h, const std::string &sysname) { KeyMan::loadKeybindsFrom("keybinds.csv"); @@ -32,22 +32,21 @@ Game::setup(unsigned w, unsigned h) unsigned int viewh = h - 1; unsigned int infow = 24; unsigned int infoh = 12; - unsigned int timeh = 10; + unsigned int timeh = h - infoh; TimeMan::init(); m_contexts.emplace(WINCTX_GAME, WindowContext()); + m_contexts.emplace(WINCTX_TITLE, WindowContext()); WindowContext *gameContext = &m_contexts[WINCTX_GAME]; gameContext->registerWindow(WINDOW_SYSTEMVIEW_ID, "System View", infow, 0, w - infow, viewh); gameContext->registerWindow(WINDOW_BODYINFO_ID, "Body Info", 0, 0, infow, infoh); - gameContext->registerWindow(WINDOW_EVENTS_ID, "Events", 0, infoh, infow, viewh - infoh - timeh); gameContext->registerWindow(WINDOW_TIMEMAN_ID, "Time", 0, viewh - timeh, infow, timeh); - gameContext->registerWindow(WINDOW_SYSTEMVIEW_SEARCH_ID, "Search", infow, 0, (w - infow) / 4, viewh, true); m_currentContext = WINCTX_GAME; m_camera = std::make_unique<Camera>((*gameContext)[WINDOW_SYSTEMVIEW_ID].screen()); - m_system = std::make_unique<System>(); + m_system = std::make_unique<System>(sysname); m_systemView.view(m_system.get()); KeyMan::registerBind('\x1B', BIND_G_ESCAPE, CTX_GLOBAL, "Escape from focused searchbox / window"); |