diff --git a/changelog.txt b/changelog.txt index 50fd5b0c3..3e3f53ac1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -39,13 +39,14 @@ Template for new versions: - `gui/mod-manager`: warn when loading a preset that doesn't include vanilla mods that were added to the game after the preset was saved ## Fixes -- `combine`: dyes are combined again, but only when their ``dye_profile`` matches, so mixed dyes no longer revert to a component dye - `bodyswap`: fix "invalid argument count" when the target unit has no nemesis record - `caravan`: fix doubled "total value of items marked for trade" after toggling filter options, and keep item marks when switching between filter views in the ``Bring goods to depot`` overlay +- `combine`: dyes are combined again, but only when their ``dye_profile`` matches, so mixed dyes no longer revert to a component dye - `fix/loyaltycascade`: guard against citizens that are not historical figures and emit a warning. - `gui/settings-manager`: preserve built-in work details added after saved settings were created - `gui/siegemanager`: fix nil index if there are no siege engines on the map - `item`: the ``reachable``/``unreachable`` filters no longer count installed building parts, and now treat loose contents of unwalkable buildings (like bolts loaded in a bolt thrower) as reachable when a citizen can stand next to the building +- `hide-tutorials`: also suppress the adventure mode start tutorial (defaults its checkbox to off and dismisses the popups) ## Misc Improvements - `caravan`: the ``Bring goods to depot``, ``Trade``, and ``Assign items for display`` overlays now allow searching for items with non-ASCII characters in their description diff --git a/docs/hide-tutorials.rst b/docs/hide-tutorials.rst index 94b2a27a2..b36707460 100644 --- a/docs/hide-tutorials.rst +++ b/docs/hide-tutorials.rst @@ -18,6 +18,9 @@ Specifically, this tool hides: other similar screens in a new fort - Popups displayed when you perform certain actions for the first time in an adventure +- The tutorial checkbox when creating an adventurer (it will default to + unchecked, but you can still enable it if you want the tutorial) and the + tutorial popups it would otherwise show at the start of the game Note that only unsolicited tutorial popups are hidden. If you directly request a tutorial page from the help, then it will still function normally. diff --git a/hide-tutorials.lua b/hide-tutorials.lua index e6124de0d..44d9ad6b6 100644 --- a/hide-tutorials.lua +++ b/hide-tutorials.lua @@ -39,6 +39,22 @@ function skip_tutorial_prompt() end end +local ADVENTURE_TUTORIAL_CONTEXTS = utils.invert{ + 'ADVENTURE_START_MESSAGE', + 'ADVENTURE_START_TUTORIAL_CAMERA_CONTROLS', + 'ADVENTURE_START_TUTORIAL_MOVEMENT', + 'ADVENTURE_START_TUTORIAL_MENU_OVERVIEW', + 'ADVENTURE_DONE_WITH_FIRST_STEPS_MESSAGE', +} + +function skip_adventure_tutorial() + if not dfhack.world.isAdventureMode() then return end + df.global.plotinfo.flags.need_to_do_tutorial = false + if help.open and ADVENTURE_TUTORIAL_CONTEXTS[df.help_context_type[help.context]] then + close_help() + end +end + local function get_prefix() if dfhack.world.isFortressMode() then return 'POPUP_' @@ -81,9 +97,19 @@ dfhack.onStateChange[GLOBAL_KEY] = function(sc) dfhack.timeout(10, 'frames', skip_tutorial_prompt) dfhack.timeout(100, 'frames', skip_tutorial_prompt) dfhack.timeout(1000, 'frames', skip_tutorial_prompt) + elseif df.viewscreen_setupadventurest:is_instance(scr) then + -- default the "tutorial" checkbox to off; the player can still + -- check it if they want the tutorial + scr.want_tutorial = false + elseif df.viewscreen_dungeonmodest:is_instance(scr) then + -- the start tutorial can pop up shortly after the screen appears + skip_adventure_tutorial() + dfhack.timeout(10, 'frames', skip_adventure_tutorial) + dfhack.timeout(100, 'frames', skip_adventure_tutorial) end elseif sc == SC_MAP_LOADED then hide_all_popups() + skip_adventure_tutorial() end end @@ -100,6 +126,7 @@ if args[1] == "enable" then enabled = true if dfhack.isMapLoaded() then hide_all_popups() + skip_adventure_tutorial() end elseif args[1] == "disable" then enabled = false @@ -107,6 +134,7 @@ elseif args[1] == "reset" then show_all_popups() elseif dfhack.isMapLoaded() then hide_all_popups() + skip_adventure_tutorial() else qerror('hide-tutorials needs a loaded fortress or adventure map to work') end