From 8e4add25a9d12ac162028197ea5ea7bb7b0c13f1 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Sun, 5 Jan 2025 15:20:20 -0500 Subject: [PATCH] A little more cleanup and then removing any completed bug notes. --- config.cpp | 6 +++++- status.txt | 36 +++++++----------------------------- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/config.cpp b/config.cpp index d5fccb4..b15c336 100644 --- a/config.cpp +++ b/config.cpp @@ -16,13 +16,17 @@ json &Config::operator[](const std::string &key) { } std::wstring Config::wstring(const std::string key) { + dbc::check($config.contains(key), format("ERROR wstring in config, key {} doesn't exist.", key)); std::wstring_convert> $converter; const std::string& str_val = $config[key]; return $converter.from_bytes(str_val); } std::wstring Config::wstring(const std::string main_key, const std::string sub_key) { - std::wstring_convert> $converter; + dbc::check($config.contains(main_key), format("ERROR wstring main/key in config, main_key {} doesn't exist.", main_key)); + dbc::check($config[main_key].contains(sub_key), format("ERROR wstring in config, main_key/key {}/{} doesn't exist.", main_key, sub_key)); + const std::string& str_val = $config[main_key][sub_key]; + std::wstring_convert> $converter; return $converter.from_bytes(str_val); } diff --git a/status.txt b/status.txt index 558b34a..095f43a 100644 --- a/status.txt +++ b/status.txt @@ -3,17 +3,12 @@ TODAY'S GOAL: * Things are still in walls because I +1 the x,y if they're colliding. * Config loader should setup the "id" based on the key to avoid errors. * Colision fails when you place two entities on the same square, but the init_positions adds them and one deletes the other. -* Config needs to do asserts that the key exists * Create a move function for iterators that recalculates their position to make it easy to move them inside the matrix. This can then be used in lighting. Just make an iterator once, and move it around after. -* Components::Tile must also die. -* MapConfig must die. -* Tile component needs to go, use the Tiles from the json. +* Components::Tile must also die and turned into Components::Actor or something like that. * Fire icon \u2034 * Water icon \u224b * Flame pillars icon \u2e3e -* Room should always be found. -* matrix::in_box needs a rectangle alternative -* DinkyECS needs to detect when a requested fact is missing and make a default. +* matrix::in_box needs a rectangle alternative and actually viewport could be a function that just takes a viewport spec and returns a rectangle for it. * Study https://github.com/hirdrac/gx_lib/blob/main/gx/Unicode.hh * Study this https://en.cppreference.com/w/cpp/language/explicit @@ -23,50 +18,33 @@ TODAY'S GOAL: 0. \ua3fd causes the character immediately after to vanish. Make a test and solve it. 1. Why do Sliders only have to be kept around forever and can't go in containers like everything else? +* Enemies stuck in walls after generation. + TODO: * Add a char lookup input to the designer. * Make the light directional. -* Hot key for debug view. - * Refine the event handling to pass most of them to the gui panels and then I can intercept them. -* Resolve fmt::format vs std::format from hirdrac when using clang or gcc latest. - -* Fix " room should always be found" - * Fix BUG markers as much as possible. -* Make room generation have "texture" or state like mossy, flooded, etc. - * A condition map that indicates what each tile's condition is, so it can have "watery", "wet", "mossy", "burned", and that changes the color of the foreground/background but not the actual tile. -* A tile will then denote a kind of surface, so stone, water, lava, etc. -* Lua integration - -* Enemies stuck in walls after generation. * Save file needs work, it's not saving gold and lights. -* Move all keyboard and mouse events into SFMLRender so it's completely abstracted away and can be changed to a different backend if I want. - * When fighting two enemies with lots of attacks it crashes because one dies and isn't there. Test by making enemies immortal. -* LightRender can just use the Dijkstra map paths to calculate light strenght from the point rather than doing the box thing. -* $paths.$paths is annoying. + * Format of pre/post in dbc isn't consistent with the rest of the lib but I also maybe don't need the function version? + * I can do headless windows in renderer for testing. - renderer.$window.setVisible(false); + * Think up an enemy system. * Write a method for renderer that can translate coordinates. * Can std::any be defaulted to a noop in the events? -* Inventory needs to be better, but need some kinds of "weapons" or other loot to get and not just gold. -* Create a few more enemy types to fight. -* Devise a more complete map/world generator that can use the loot and enemies better. * Maybe an LOS system, but the hearing version works pretty well so far. * Probably a system for mapping collision types to sound effects, rather than having the GUI do it. -* Write a test that generates a ton of maps then confirms there's a path from one room to every other room? - -* check out SoLoud. * BUG: When enemies die they can be overlapping another enemy.