From 57e9df4c85c9eda783e331ac75cf6a1742449f25 Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:09:03 -0600 Subject: [PATCH 01/13] Adds various new configs and keybind options to stonesense Addresses https://github.com/DFHack/stonesense/issues/87 and partially helps https://github.com/DFHack/stonesense/issues/90 --- Config.cpp | 17 +++++++++++++++++ GUI.cpp | 6 +++++- Keybinds.cpp | 3 +++ UserInput.cpp | 14 ++++++++++++++ UserInput.h | 3 +++ commonTypes.h | 2 ++ configs/init.txt | 12 ++++++++++-- 7 files changed, 54 insertions(+), 3 deletions(-) diff --git a/Config.cpp b/Config.cpp index 446f4997..0368580d 100644 --- a/Config.cpp +++ b/Config.cpp @@ -70,6 +70,11 @@ namespace { return; } + if (line.find("[CLOSEONESC") != string::npos) { + string result = parseStrFromLine("CLOSEONESC", line); + ssConfig.closeOnEsc = (result == "YES"); + } + if (line.find("[WIDTH") != string::npos) { int width = parseIntFromLine("WIDTH", line); ssState.ScreenW = width; @@ -167,6 +172,18 @@ namespace { string result = parseStrFromLine("SHOW_CREATURE_NAMES", line); ssConfig.show_creature_names = (result == "YES"); } + if (line.find("[SHOW_CREATURE_MOODS") != string::npos) { + string result = parseStrFromLine("SHOW_CREATURE_MOODS", line); + ssConfig.show_creature_moods = (result == "YES"); + } + if (line.find("[SHOW_CREATURE_JOBS") != string::npos) { + string result = parseStrFromLine("SHOW_CREATURE_JOBS", line); + ssConfig.show_creature_jobs = (result == "YES"); + } + if (line.find("[SHOW_CREATURE_PROFESSIONS") != string::npos) { + int value = parseIntFromLine("SHOW_CREATURE_PROFESSIONS", line); + ssConfig.show_creature_professions = value; + } if (line.find("[NAMES_USE_NICKNAME") != string::npos) { string result = parseStrFromLine("NAMES_USE_NICKNAME", line); ssConfig.names_use_nick = (result == "YES"); diff --git a/GUI.cpp b/GUI.cpp index c0c0123a..fe83b3c0 100644 --- a/GUI.cpp +++ b/GUI.cpp @@ -1161,6 +1161,11 @@ void paintboard() ssTimers.frame_total = (donetime - ssTimers.prev_frame_time)*0.1 + ssTimers.frame_total*0.9; ssTimers.prev_frame_time = donetime; + if (ssConfig.show_announcements) { + al_hold_bitmap_drawing(true); + draw_announcements(font, ssState.ScreenW, ssState.ScreenH - 20, ALLEGRO_ALIGN_RIGHT, df::global::world->status.announcements); + al_hold_bitmap_drawing(false); + } if(ssConfig.show_keybinds){ string *keyname, *actionname; keyname = actionname = NULL; @@ -1184,7 +1189,6 @@ void paintboard() drawDebugCursor(segment); - draw_announcements(font, ssState.ScreenW, ssState.ScreenH - 20, ALLEGRO_ALIGN_RIGHT, df::global::world->status.announcements); drawAdvmodeMenuTalk(font, 5, ssState.ScreenH - 5); if(ssConfig.debug_mode) { diff --git a/Keybinds.cpp b/Keybinds.cpp index 338e2910..fb3998a9 100644 --- a/Keybinds.cpp +++ b/Keybinds.cpp @@ -186,6 +186,7 @@ action_name_mapper actionnamemap[] = { {"TOGGLE_STOCKS", action_togglestockpiles}, {"TOGGLE_ZONES", action_togglezones}, {"TOGGLE_OCCLUSION", action_toggleocclusion}, + {"TOGGLE_FOG",action_togglefog}, {"TOGGLE_CREATURE_MOODS", action_togglecreaturemood}, {"TOGGLE_CREATURE_PROFS", action_togglecreatureprof}, {"TOGGLE_CREATURE_JOBS", action_togglecreaturejob}, @@ -198,6 +199,8 @@ action_name_mapper actionnamemap[] = { {"TOGGLE_SHOW_HIDDEN_TILES", action_toggleshowhidden}, {"TOGGLE_OSD", action_toggleosd}, {"TOGGLE_KEYBINDS", action_togglekeybinds}, + {"TOGGLE_ANNOUNCEMENTS", action_toggleannouncements}, + {"TOGGLE_DEBUG", action_toggledebug}, {"INCR_ZOOM", action_incrzoom}, {"DECR_ZOOM", action_decrzoom}, {"SCREENSHOT", action_screenshot}, diff --git a/UserInput.cpp b/UserInput.cpp index 333f8bdd..8878a491 100644 --- a/UserInput.cpp +++ b/UserInput.cpp @@ -240,6 +240,11 @@ void action_toggleocclusion(uint32_t keymod) timeToReloadSegment = true; } +void action_togglefog(uint32_t keymod) +{ + ssConfig.fogenable = !ssConfig.fogenable; +} + void action_togglecreaturemood(uint32_t keymod) { ssConfig.show_creature_moods = !ssConfig.show_creature_moods; @@ -382,6 +387,15 @@ void action_togglekeybinds(uint32_t keymod){ ssConfig.show_keybinds = !ssConfig.show_keybinds; } +void action_toggleannouncements(uint32_t keymod) { + ssConfig.show_announcements = !ssConfig.show_announcements; +} + +void action_toggledebug(uint32_t keymod) +{ + ssConfig.debug_mode = !ssConfig.debug_mode; +} + void action_incrzoom(uint32_t keymod) { ssConfig.zoom++; diff --git a/UserInput.h b/UserInput.h index c49f538e..5a5e3cfe 100644 --- a/UserInput.h +++ b/UserInput.h @@ -7,6 +7,7 @@ void action_toggledesignations(uint32_t keymod); void action_togglestockpiles(uint32_t keymod); void action_togglezones(uint32_t keymod); void action_toggleocclusion(uint32_t keymod); +void action_togglefog(uint32_t keymod); void action_togglecreaturemood(uint32_t keymod); void action_togglecreatureprof(uint32_t keymod); void action_togglecreaturejob(uint32_t keymod); @@ -24,7 +25,9 @@ void action_toggleshadehidden(uint32_t keymod); void action_toggleshowhidden(uint32_t keymod); void action_togglecreaturenames(uint32_t keymod); void action_toggleosd(uint32_t keymod); +void action_toggledebug(uint32_t keymod); void action_togglekeybinds(uint32_t keymod); +void action_toggleannouncements(uint32_t keymod); void action_incrzoom(uint32_t keymod); void action_decrzoom(uint32_t keymod); void action_screenshot(uint32_t keymod); diff --git a/commonTypes.h b/commonTypes.h index d655ade5..f3ebe284 100644 --- a/commonTypes.h +++ b/commonTypes.h @@ -145,7 +145,9 @@ struct GameConfiguration { bool show_stockpiles; bool show_designations; bool show_osd; + bool show_announcements; bool show_keybinds; + bool closeOnEsc; bool single_layer_view; bool shade_hidden_tiles; bool show_hidden_tiles; diff --git a/configs/init.txt b/configs/init.txt index 65f3c28a..d42975ff 100644 --- a/configs/init.txt +++ b/configs/init.txt @@ -2,6 +2,9 @@ Please note, these keywords are case sensitive for now. --Interface-- +Sets whether hitting Esc will close the window. (YES or NO) +[CLOSEONESC:NO] + Sets the width and height of the application in pixels. [WIDTH:800] [HEIGHT:600] @@ -92,8 +95,13 @@ Sets Stonesense in debug mode. Adds additional information to displays. Sets the debug cursor to follow the cursor from DF when it is there. [FOLLOW_DF_CURSOR:YES] -Shows creatures names floating above their sprites. (Toggle with 'n') -[SHOW_CREATURE_NAMES:YES] +Shows creatures info floating above their sprites. +[SHOW_CREATURE_NAMES:NO] +[SHOW_CREATURE_MOODS:NO] +[SHOW_CREATURE_JOBS:NO] + +Show creatures professions. (0-3, 0 is off) +[SHOW_CREATURE_PROFESSIONS:0] Options to control how names are displayed (if SHOW_CREATURE_NAMES is set) [NAMES_USE_NICKNAME:YES] From ee2662ed16d7eb520d62b6ef71e1891ba2773a30 Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Tue, 14 Jan 2025 20:28:55 -0600 Subject: [PATCH 02/13] add new default keys --- resources/keybinds.txt | 305 +++++++++++++++++++++-------------------- 1 file changed, 157 insertions(+), 148 deletions(-) diff --git a/resources/keybinds.txt b/resources/keybinds.txt index cfebb283..242c278b 100644 --- a/resources/keybinds.txt +++ b/resources/keybinds.txt @@ -29,6 +29,7 @@ KEYBINDINGS: [TOGGLE_STOCKS:KEY_I] [TOGGLE_ZONES:KEY_U] [TOGGLE_OCCLUSION:KEY_O] +[TOGGLE_FOG:KEYS_TILDE] [TOGGLE_CREATURE_MOODS:KEY_M] [TOGGLE_CREATURE_PROFS:KEY_P] [TOGGLE_CREATURE_JOBS:KEY_J] @@ -36,13 +37,19 @@ KEYBINDINGS: [CHOP_WALLS:KEY_C] [CYCLE_TRACKING_MODE:KEY_F] [RESET_VIEW_OFFSET:KEY_Z] -[DECR_SEGMENT_Z:KEY_1] -[INCR_SEGMENT_Z:KEY_2] +[DECR_SEGMENT_Z:KEYPAD_3] +[INCR_SEGMENT_Z:KEYPAD_9] +[DECR_SEGMENT_X:KEYPAD_4] +[INCR_SEGMENT_X:KEYPAD_6] +[DECR_SEGMENT_Y:KEYPAD_2] +[INCR_SEGMENT_Y:KEYPAD_8] [TOGGLE_SINGLE_LAYER:KEY_S] [TOGGLE_SHADE_HIDDEN_TILES:KEY_B] [TOGGLE_SHOW_HIDDEN_TILES:KEY_H] [TOGGLE_OSD:KEYF_2] [TOGGLE_KEYBINDS:KEYS_SLASH] +[TOGGLE_ANNOUNCEMENTS:KEY_A] +[TOGGLE_DEBUG:KEYS_SEMICOLON] [INCR_ZOOM:KEYS_FULLSTOP] [DECR_ZOOM:KEYS_COMMA] [SCREENSHOT:KEYF_5] @@ -61,41 +68,43 @@ VALID ACTIONS: Actions: Explanation: - NOOP do nothing (default) - ROTATE rotate the displayed map segment - RELOAD_SEGMENT reload the segment (meaningless when auto-reload enabled) - PAINT draw the loaded segment (meaningless when auto-reload enabled) - TOGGLE_DESIGNATIONS toggle display of designations - TOGGLE_STOCKS toggle display of stockpiles - TOGGLE_ZONES toggle display of activity zones - TOGGLE_OCCLUSION toggle the occlusion culling - TOGGLE_CREATURE_MOODS toggle display of creature mood icons - TOGGLE_CREATURE_PROFS cycle through display of profession indicators (disabled/icons/colored names) - TOGGLE_CREATURE_JOBS cycle through display of job indicators (disabled/icons/text descriptions) - TOGGLE_CREATURE_NAMES toggle the display of creature names - CHOP_WALLS cycle through wall sprite chopping options - CYCLE_TRACKING_MODE cycle through modes for following DF - RESET_VIEW_OFFSET reset the view offset - TOGGLE_SINGLE_LAYER toggle single layer mode - TOGGLE_SHADE_HIDDEN_TILES toggle shading hidden tiles - TOGGLE_SHOW_HIDDEN_TILES toggle showing hidden tiles - TOGGLE_OSD toggle the onscreen display (currently this is just minimal text info) - TOGGLE_KEYBINDS toggle display of keybind information - INCR_ZOOM increase the zoom - DECR_ZOOM decrease the zoom - SCREENSHOT take a screenshot (alt: volumetric screenshot / ctrl: megashot / shift+ctrl: full-depth megashot) - INCR_RELOAD_TIME increase the reload timer - DECR_RELOAD_TIME decrease the reload timer - CREDITS show credits - - DECR_SEGMENT_X decrease/increase the corresponding displayed segment size coordinate + NOOP | do nothing (default) + ROTATE | rotate the displayed map segment + RELOAD_SEGMENT | reload the segment (meaningless when auto-reload enabled) + PAINT | draw the loaded segment (meaningless when auto-reload enabled) + TOGGLE_DESIGNATIONS | toggle display of designations + TOGGLE_STOCKS | toggle display of stockpiles + TOGGLE_ZONES | toggle display of activity zones + TOGGLE_OCCLUSION | toggle the occlusion culling + TOGGLE_CREATURE_MOODS | toggle display of creature mood icons + TOGGLE_CREATURE_PROFS | cycle through display of profession indicators (disabled/icons/colored names) + TOGGLE_CREATURE_JOBS | cycle through display of job indicators (disabled/icons/text descriptions) + TOGGLE_CREATURE_NAMES | toggle the display of creature names + CHOP_WALLS | cycle through wall sprite chopping options + CYCLE_TRACKING_MODE | cycle through modes for following DF + RESET_VIEW_OFFSET | reset the view offset + TOGGLE_SINGLE_LAYER | toggle single layer mode + TOGGLE_SHADE_HIDDEN_TILES | toggle shading hidden tiles + TOGGLE_SHOW_HIDDEN_TILES | toggle showing hidden tiles + TOGGLE_OSD | toggle the onscreen display (currently this is just minimal text info) + TOGGLE_KEYBINDS | toggle display of keybind information + INCR_ZOOM | increase the zoom + DECR_ZOOM | decrease the zoom + INCR_UISCALE | increase the font size + DECR_UISCALE | decrease the font size + SCREENSHOT | take a screenshot (alt: volumetric screenshot / ctrl: megashot / shift+ctrl: full-depth megashot) + INCR_RELOAD_TIME | increase the reload timer + DECR_RELOAD_TIME | decrease the reload timer + CREDITS | show credits + + DECR_SEGMENT_X | decrease/increase the corresponding displayed segment size coordinate INCR_SEGMENT_X DECR_SEGMENT_Y INCR_SEGMENT_Y DECR_SEGMENT_Z INCR_SEGMENT_Z - DECR_X decrease/increase the corresponding segment position coordinate (alt: continue following DF / ctrl: DECR_SEGMENT_*) + DECR_X | decrease/increase the corresponding segment position coordinate (alt: continue following DF / ctrl: DECR_SEGMENT_*) INCR_X DECR_Y INCR_Y @@ -106,120 +115,120 @@ VALID KEYS: Key Names: Explanation: - INVALID nokey (default) - - KEY_A a - KEY_B b - KEY_C c - KEY_D d - KEY_E e - KEY_F f - KEY_G g - KEY_H h - KEY_I i - KEY_J j - KEY_K k - KEY_L l - KEY_M m - KEY_N n - KEY_O o - KEY_P p - KEY_Q q - KEY_R r - KEY_S s - KEY_T t - KEY_U u - KEY_V v - KEY_W w - KEY_X x - KEY_Y y - KEY_Z z - - KEY_0 0 - KEY_1 1 - KEY_2 2 - KEY_3 3 - KEY_4 4 - KEY_5 5 - KEY_6 6 - KEY_7 7 - KEY_8 8 - KEY_9 9 - - KEYPAD_0 0 (keypad) - KEYPAD_1 1 (keypad) - KEYPAD_2 2 (keypad) - KEYPAD_3 3 (keypad) - KEYPAD_4 4 (keypad) - KEYPAD_5 5 (keypad) - KEYPAD_6 6 (keypad) - KEYPAD_7 7 (keypad) - KEYPAD_8 8 (keypad) - KEYPAD_9 8 (keypad) - - KEYF_1 F1 - KEYF_2 F2 - KEYF_3 F3 - KEYF_4 F4 - KEYF_5 F5 - KEYF_6 F6 - KEYF_7 F7 - KEYF_8 F8 - KEYF_9 F9 - KEYF_10 F10 - KEYF_11 F11 - KEYF_12 F12 - - KEYS_ESCAPE escape key (overridden by hardcoded commands) - KEYS_TILDE ~ - KEYS_MINUS - - KEYS_EQUALS = - KEYS_BACKSPACE (backspace) - KEYS_TAB (tab) - KEYS_OPENBRACE [ - KEYS_CLOSEBRACE ] - KEYS_ENTER (enter) - KEYS_SEMICOLON ; - KEYS_QUOTE '' - KEYS_BACKSLASH \ - KEYS_BACKSLASH2 (only on german keyboards or something) - KEYS_COMMA , - KEYS_FULLSTOP . - KEYS_SLASH / - KEYS_SPACE (spacebar) - - KEYS_INSERT (insert) - KEYS_DELETE (delete) - KEYS_HOME (home) - KEYS_END (end) - KEYS_PGUP (page up) - KEYS_PGDN (page down) - KEYS_LEFT (left arrow) - KEYS_RIGHT (right arrow) - KEYS_UP (up arrow) - KEYS_DOWN (down arrow) - - KEYPAD_SLASH / (keypad) - KEYPAD_ASTERISK * (keypad) - KEYPAD_MINUS - (keypad) - KEYPAD_PLUS + (keypad) - KEYPAD_DELETE (keypad delete) - KEYPAD_ENTER (keypad enter) - - KEYS_PRINTSCREEN (print screen) - KEYS_PAUSE (pause) - - KEYS_ABNT_C1 (???) - KEYS_YEN (???) - KEYS_KANA (???) - KEYS_CONVERT (???) - KEYS_NOCONVERT (???) - KEYS_AT (???) - KEYS_CIRCUMFLEX (???) - KEYS_COLON2 (???) - KEYS_KANJI (???) - - KEYPAD_EQUALS (MacOS X only) - KEYS_BACKQUOTE (MacOS X only) - KEYS_SEMICOLON2 (MacOS X only) - KEYS_COMMAND (MacOS X only) + INVALID | nokey (default) + + KEY_A | a + KEY_B | b + KEY_C | c + KEY_D | d + KEY_E | e + KEY_F | f + KEY_G | g + KEY_H | h + KEY_I | i + KEY_J | j + KEY_K | k + KEY_L | l + KEY_M | m + KEY_N | n + KEY_O | o + KEY_P | p + KEY_Q | q + KEY_R | r + KEY_S | s + KEY_T | t + KEY_U | u + KEY_V | v + KEY_W | w + KEY_X | x + KEY_Y | y + KEY_Z | z + + KEY_0 | 0 + KEY_1 | 1 + KEY_2 | 2 + KEY_3 | 3 + KEY_4 | 4 + KEY_5 | 5 + KEY_6 | 6 + KEY_7 | 7 + KEY_8 | 8 + KEY_9 | 9 + + KEYPAD_0 | 0 (keypad) + KEYPAD_1 | 1 (keypad) + KEYPAD_2 | 2 (keypad) + KEYPAD_3 | 3 (keypad) + KEYPAD_4 | 4 (keypad) + KEYPAD_5 | 5 (keypad) + KEYPAD_6 | 6 (keypad) + KEYPAD_7 | 7 (keypad) + KEYPAD_8 | 8 (keypad) + KEYPAD_9 | 9 (keypad) + + KEYF_1 | F1 + KEYF_2 | F2 + KEYF_3 | F3 + KEYF_4 | F4 + KEYF_5 | F5 + KEYF_6 | F6 + KEYF_7 | F7 + KEYF_8 | F8 + KEYF_9 | F9 + KEYF_10 | F10 + KEYF_11 | F11 + KEYF_12 | F12 + + KEYS_ESCAPE | escape key (overridden by hardcoded commands) + KEYS_TILDE | ~ + KEYS_MINUS | - + KEYS_EQUALS | = + KEYS_BACKSPACE | (backspace) + KEYS_TAB | (tab) + KEYS_OPENBRACE | [ + KEYS_CLOSEBRACE | ] + KEYS_ENTER | (enter) + KEYS_SEMICOLON | ; + KEYS_QUOTE | '' + KEYS_BACKSLASH | \ + KEYS_BACKSLASH2 | (only on german keyboards or something) + KEYS_COMMA | , + KEYS_FULLSTOP | . + KEYS_SLASH | / + KEYS_SPACE | (spacebar) + + KEYS_INSERT | (insert) + KEYS_DELETE | (delete) + KEYS_HOME | (home) + KEYS_END | (end) + KEYS_PGUP | (page up) + KEYS_PGDN | (page down) + KEYS_LEFT | (left arrow) + KEYS_RIGHT | (right arrow) + KEYS_UP | (up arrow) + KEYS_DOWN | (down arrow) + + KEYPAD_SLASH | / (keypad) + KEYPAD_ASTERISK | * (keypad) + KEYPAD_MINUS | - (keypad) + KEYPAD_PLUS | + (keypad) + KEYPAD_DELETE | (keypad delete) + KEYPAD_ENTER | (keypad enter) + + KEYS_PRINTSCREEN | (print screen) + KEYS_PAUSE | (pause) + + KEYS_ABNT_C1 | (???) + KEYS_YEN | (???) + KEYS_KANA | (???) + KEYS_CONVERT | (???) + KEYS_NOCONVERT | (???) + KEYS_AT | (???) + KEYS_CIRCUMFLEX | (???) + KEYS_COLON2 | (???) + KEYS_KANJI | (???) + + KEYPAD_EQUALS | (MacOS X only) + KEYS_BACKQUOTE | (MacOS X only) + KEYS_SEMICOLON2 | (MacOS X only) + KEYS_COMMAND | (MacOS X only) \ No newline at end of file From 85c3b7156b85ff5afedd299cf7338a0dffa91772 Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Tue, 14 Jan 2025 20:29:47 -0600 Subject: [PATCH 03/13] Close on esc will be On by default --- configs/init.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configs/init.txt b/configs/init.txt index d42975ff..40378f3a 100644 --- a/configs/init.txt +++ b/configs/init.txt @@ -2,8 +2,9 @@ Please note, these keywords are case sensitive for now. --Interface-- -Sets whether hitting Esc will close the window. (YES or NO) -[CLOSEONESC:NO] +Sets whether hitting Esc will close the window, in addition to being able +to use the close window button. (YES or NO) +[CLOSEONESC:YES] Sets the width and height of the application in pixels. [WIDTH:800] From 6d7cf4b7ef929c86a380d4c1f325f431e90f3165 Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Tue, 14 Jan 2025 20:31:55 -0600 Subject: [PATCH 04/13] EOF fix --- resources/keybinds.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/keybinds.txt b/resources/keybinds.txt index 242c278b..0dfbcf70 100644 --- a/resources/keybinds.txt +++ b/resources/keybinds.txt @@ -231,4 +231,5 @@ VALID KEYS: KEYPAD_EQUALS | (MacOS X only) KEYS_BACKQUOTE | (MacOS X only) KEYS_SEMICOLON2 | (MacOS X only) - KEYS_COMMAND | (MacOS X only) \ No newline at end of file + KEYS_COMMAND | (MacOS X only) + \ No newline at end of file From 9576fba27169f96bab2e694b56bbaf678ed58aa5 Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Tue, 14 Jan 2025 20:35:04 -0600 Subject: [PATCH 05/13] whitespace fix from fixing the EOF --- resources/keybinds.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/keybinds.txt b/resources/keybinds.txt index 0dfbcf70..3c56294a 100644 --- a/resources/keybinds.txt +++ b/resources/keybinds.txt @@ -232,4 +232,3 @@ VALID KEYS: KEYS_BACKQUOTE | (MacOS X only) KEYS_SEMICOLON2 | (MacOS X only) KEYS_COMMAND | (MacOS X only) - \ No newline at end of file From d49365fba48ee75d6d169137b657578b3ebd513a Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Wed, 15 Jan 2025 08:22:00 -0600 Subject: [PATCH 06/13] Fix extra keys (they wern't supposed to be in this PR) --- resources/keybinds.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/resources/keybinds.txt b/resources/keybinds.txt index 3c56294a..9659634f 100644 --- a/resources/keybinds.txt +++ b/resources/keybinds.txt @@ -39,10 +39,6 @@ KEYBINDINGS: [RESET_VIEW_OFFSET:KEY_Z] [DECR_SEGMENT_Z:KEYPAD_3] [INCR_SEGMENT_Z:KEYPAD_9] -[DECR_SEGMENT_X:KEYPAD_4] -[INCR_SEGMENT_X:KEYPAD_6] -[DECR_SEGMENT_Y:KEYPAD_2] -[INCR_SEGMENT_Y:KEYPAD_8] [TOGGLE_SINGLE_LAYER:KEY_S] [TOGGLE_SHADE_HIDDEN_TILES:KEY_B] [TOGGLE_SHOW_HIDDEN_TILES:KEY_H] From 6f8d95f4760e4daaf2cf53eaa1c23fc24d4e7d36 Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Wed, 15 Jan 2025 08:26:15 -0600 Subject: [PATCH 07/13] Init closeOnEsc to be safe --- main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/main.cpp b/main.cpp index 34a40835..cd2e3d15 100644 --- a/main.cpp +++ b/main.cpp @@ -404,6 +404,7 @@ static void * stonesense_thread(ALLEGRO_THREAD * main_thread, void * parms) color_ostream_proxy out(Core::getInstance().getConsole()); out.print("Stonesense launched\n"); + ssConfig.closeOnEsc = true; ssConfig.debug_mode = false; ssConfig.hide_outer_tiles = false; ssConfig.shade_hidden_tiles = true; From 5e984ccef05ab75a8b6338038d2484b0654ec20a Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Wed, 15 Jan 2025 08:26:39 -0600 Subject: [PATCH 08/13] swap fog and debug mode to make more sense as default --- resources/keybinds.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/keybinds.txt b/resources/keybinds.txt index 9659634f..4cc2155d 100644 --- a/resources/keybinds.txt +++ b/resources/keybinds.txt @@ -29,7 +29,7 @@ KEYBINDINGS: [TOGGLE_STOCKS:KEY_I] [TOGGLE_ZONES:KEY_U] [TOGGLE_OCCLUSION:KEY_O] -[TOGGLE_FOG:KEYS_TILDE] +[TOGGLE_FOG:KEYS_SEMICOLON] [TOGGLE_CREATURE_MOODS:KEY_M] [TOGGLE_CREATURE_PROFS:KEY_P] [TOGGLE_CREATURE_JOBS:KEY_J] @@ -45,7 +45,7 @@ KEYBINDINGS: [TOGGLE_OSD:KEYF_2] [TOGGLE_KEYBINDS:KEYS_SLASH] [TOGGLE_ANNOUNCEMENTS:KEY_A] -[TOGGLE_DEBUG:KEYS_SEMICOLON] +[TOGGLE_DEBUG:KEYS_TILDE] [INCR_ZOOM:KEYS_FULLSTOP] [DECR_ZOOM:KEYS_COMMA] [SCREENSHOT:KEYF_5] From f53e94c254bbcbbf4d5cc571dfdfe1567ec892f1 Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Wed, 15 Jan 2025 08:28:01 -0600 Subject: [PATCH 09/13] Remove the professions in init. It's funky --- configs/init.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/configs/init.txt b/configs/init.txt index 40378f3a..af36c0dd 100644 --- a/configs/init.txt +++ b/configs/init.txt @@ -101,9 +101,6 @@ Shows creatures info floating above their sprites. [SHOW_CREATURE_MOODS:NO] [SHOW_CREATURE_JOBS:NO] -Show creatures professions. (0-3, 0 is off) -[SHOW_CREATURE_PROFESSIONS:0] - Options to control how names are displayed (if SHOW_CREATURE_NAMES is set) [NAMES_USE_NICKNAME:YES] [NAMES_USE_SPECIES:YES] From 91f33e4d668f15f07f7f3b6fbeb5eb53c5f62411 Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:32:39 -0600 Subject: [PATCH 10/13] Revert keys and update changelog --- docs/changelog.txt | 4 ++++ resources/keybinds.txt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 4774c019..dff70934 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -38,6 +38,10 @@ Template for new versions: # Future ## New Features +- `stonesense`: added config for closeOnEsc to disable closing stonesense with the escape key +- `stonesense`: added configs to show creature moods and jobs by default +- `stonesense`: added config to show announcements, on by default, toggle with ``a`` (default keybinding) while stonsense window is active +- `stonesense`: ``~`` is now the key to toggle debug mode while stonesense window is active and ``;`` is the default key for toggling fog ## Fixes diff --git a/resources/keybinds.txt b/resources/keybinds.txt index 4cc2155d..4c506ee2 100644 --- a/resources/keybinds.txt +++ b/resources/keybinds.txt @@ -37,8 +37,8 @@ KEYBINDINGS: [CHOP_WALLS:KEY_C] [CYCLE_TRACKING_MODE:KEY_F] [RESET_VIEW_OFFSET:KEY_Z] -[DECR_SEGMENT_Z:KEYPAD_3] -[INCR_SEGMENT_Z:KEYPAD_9] +[DECR_SEGMENT_Z:KEY_1] +[INCR_SEGMENT_Z:KEY_2] [TOGGLE_SINGLE_LAYER:KEY_S] [TOGGLE_SHADE_HIDDEN_TILES:KEY_B] [TOGGLE_SHOW_HIDDEN_TILES:KEY_H] From 8b2284ff67c08fc01ed0c01e966f3e434d043de0 Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:33:39 -0600 Subject: [PATCH 11/13] Init show_announcement --- main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/main.cpp b/main.cpp index cd2e3d15..c8e65853 100644 --- a/main.cpp +++ b/main.cpp @@ -405,6 +405,7 @@ static void * stonesense_thread(ALLEGRO_THREAD * main_thread, void * parms) out.print("Stonesense launched\n"); ssConfig.closeOnEsc = true; + ssConfig.show_announcements = true; ssConfig.debug_mode = false; ssConfig.hide_outer_tiles = false; ssConfig.shade_hidden_tiles = true; From fd268fc07aa84764ad15ec8782d81470d2cc444d Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:28:32 -0600 Subject: [PATCH 12/13] Update docs/changelog.txt Co-authored-by: Myk --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index dff70934..97bcda7b 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -39,7 +39,7 @@ Template for new versions: ## New Features - `stonesense`: added config for closeOnEsc to disable closing stonesense with the escape key -- `stonesense`: added configs to show creature moods and jobs by default +- `stonesense`: added configs for whether creature moods and jobs are displayed - `stonesense`: added config to show announcements, on by default, toggle with ``a`` (default keybinding) while stonsense window is active - `stonesense`: ``~`` is now the key to toggle debug mode while stonesense window is active and ``;`` is the default key for toggling fog From e31eb357817f22202bd109d2ce5a1ba0648065a1 Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:31:36 -0600 Subject: [PATCH 13/13] Make closeOnEsc actually do something --- main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index c8e65853..917d0072 100644 --- a/main.cpp +++ b/main.cpp @@ -367,7 +367,8 @@ static void main_loop(ALLEGRO_DISPLAY * display, ALLEGRO_EVENT_QUEUE *queue, ALL } if(event.keyboard.display != display) { break; - } else if (event.keyboard.keycode == ALLEGRO_KEY_ESCAPE) { + } + else if (event.keyboard.keycode == ALLEGRO_KEY_ESCAPE && ssConfig.closeOnEsc) { return; } else { doKeys(event.keyboard.keycode, event.keyboard.modifiers);