Conversation
* Update World.cpp - Fix getAdventurer in arena * Update createitem.cpp - Simplify adventurer check * Update dwarfmode.lua - Fix adventure arena look cursor * Update Lua API.rst - Improve isAdventureMode doc * Update changelog.txt
* Update Lua API.rst * Update dwarfmode.lua
SilasD
left a comment
There was a problem hiding this comment.
I'm generally OK with this.
there is one thing I'd like added, but I don't consider it mandatory.
| local u = dfhack.world.getAdventurer() | ||
| if u and u.pos:isValid() then | ||
| if u and u.pos:isValid() then -- recenter on adventurer | ||
| a_look.cursor = copyall(u.pos) |
There was a problem hiding this comment.
"recenter on adventurer". does that move the main map or just the cursor? does this work if the Z level is different?
presumably dfhack.gui.revealInDwarfmodeMap() doesn't work; both because "Dwarfmode" is in the name and because it's in the "Fortress mode" section.
this module has some functions with names suggesting they might zoom, but the whole thing looks bitrotted to me. it needs fumigated.
a problem for another day though.
There was a problem hiding this comment.
It just moves the cursor. If you nudge the cursor without closing the menu, the view should snap to it.
IIRC, the reveal function actually works in adv mode? But we aren't moving the view for dwarf mode, either. These are strictly cursor functions, and DF uses the global cursor for internal stuff sometimes.
I've switched to using units.getPosition instead of using the raw pos, just in case the adventurer is mounted, etc.
Make
getAdventurerapply to adventure arena by checking for adventuregamemodeinstead ofisAdventureMode. Also makedwarfmode.luarespect the adventure look cursor for arena.Tidied up an unnecessary check in
createitem.ccp.Units::getProfessionNamemisbehavior is fixed as a result of thegetAdventurechange. No visible change toWorld::GetCurrentSiteIdbecause arena mode always contains 0 sites.Update docs to clarify that
isAdventureModedoesn't cover arena mode.reveal.cppremains unavailable in arena mode, as swapping back to dwarf arena doesn't triggerSC_WORLD_UNLOADEDto reset state.