Merge branch 'develop' into myk_autoclothing

develop
Myk 2023-04-24 14:16:42 -07:00 committed by GitHub
commit 359df08803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 70 additions and 16 deletions

@ -144,4 +144,4 @@ enable \
alias add autounsuspend suspendmanager alias add autounsuspend suspendmanager
alias add gui/dig gui/design alias add gui/dig gui/design
alias add toggle-kbd-cursor lua "local flags4 = df.global.d_init.flags4 if flags4.KEYBOARD_CURSOR then flags4.KEYBOARD_CURSOR = false else local guidm = require('gui.dwarfmode') guidm.setCursorPos(guidm.Viewport.get():getCenter()) flags4.KEYBOARD_CURSOR = true end" alias add version help

@ -37,14 +37,18 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## Fixes ## Fixes
- `autoclothing`: eliminate game lag when there are many inventory items in the fort - `autoclothing`: eliminate game lag when there are many inventory items in the fort
- `buildingplan`: fixed size limit calculations for rollers
- `dig-now`: properly detect and complete smoothing designations that have been converted into active jobs
## Misc Improvements ## Misc Improvements
- `buildingplan`: planner panel is minimized by default and now remembers minimized state - `buildingplan`: planner panel is minimized by default and now remembers minimized state
- `buildingplan`: can now filter by gems (for gem windows) and yarn (for ropes in wells) - `buildingplan`: can now filter by gems (for gem windows) and yarn (for ropes in wells)
- ``toggle-kbd-cursor``: add hotkey for toggling the keyboard cursor (Alt-K) - ``toggle-kbd-cursor``: add hotkey for toggling the keyboard cursor (Alt-K)
- ``version``: add alias to display the DFHack help (including the version number) so something happens when players try to run "version"
- `gui/control-panel`: add preference option for hiding the terminal console on startup - `gui/control-panel`: add preference option for hiding the terminal console on startup
- `gui/control-panel`: add preference option for hiding "armok" tools in command lists - `gui/control-panel`: add preference option for hiding "armok" tools in command lists
- ``Dwarf Therapist``: add a warning to the Labors screen when Dwarf Therapist is active so players know that changes they make to that screen will have no effect. If you're starting a new embark and nobody seems to be doing anything, check your Labors tab for this warning to see if Dwarf Therapist thinks it is in control (even if it's not running). - ``Dwarf Therapist``: add a warning to the Labors screen when Dwarf Therapist is active so players know that changes they make to that screen will have no effect. If you're starting a new embark and nobody seems to be doing anything, check your Labors tab for this warning to see if Dwarf Therapist thinks it is in control (even if it's not running).
- `overlay`: add the DFHack version string to the DF title screen
## Documentation ## Documentation

@ -273,7 +273,7 @@ static std::string dfhack_version_desc()
if (Version::is_release()) if (Version::is_release())
s << "(release)"; s << "(release)";
else else
s << "(development build " << Version::git_description() << ")"; s << "(git: " << Version::git_commit(true) << ")";
s << " on " << (sizeof(void*) == 8 ? "x86_64" : "x86"); s << " on " << (sizeof(void*) == 8 ? "x86_64" : "x86");
if (strlen(Version::dfhack_build_id())) if (strlen(Version::dfhack_build_id()))
s << " [build ID: " << Version::dfhack_build_id() << "]"; s << " [build ID: " << Version::dfhack_build_id() << "]";

@ -1,6 +1,8 @@
#define NO_DFHACK_VERSION_MACROS #define NO_DFHACK_VERSION_MACROS
#include "DFHackVersion.h" #include "DFHackVersion.h"
#include "git-describe.h" #include "git-describe.h"
#include <string>
namespace DFHack { namespace DFHack {
namespace Version { namespace Version {
int dfhack_abi_version() int dfhack_abi_version()
@ -27,9 +29,10 @@ namespace DFHack {
{ {
return DFHACK_GIT_DESCRIPTION; return DFHACK_GIT_DESCRIPTION;
} }
const char *git_commit() const char* git_commit(bool short_hash)
{ {
return DFHACK_GIT_COMMIT; static std::string shorty(DFHACK_GIT_COMMIT, 0, 7);
return short_hash ? shorty.c_str() : DFHACK_GIT_COMMIT;
} }
const char *git_xml_commit() const char *git_xml_commit()
{ {

@ -8,7 +8,7 @@ namespace DFHack {
int dfhack_abi_version(); int dfhack_abi_version();
const char *git_description(); const char *git_description();
const char *git_commit(); const char* git_commit(bool short_hash = false);
const char *git_xml_commit(); const char *git_xml_commit();
const char *git_xml_expected_commit(); const char *git_xml_expected_commit();
bool git_xml_match(); bool git_xml_match();

@ -84,6 +84,7 @@ using namespace DFHack;
#include "df/unit.h" #include "df/unit.h"
#include "df/unit_inventory_item.h" #include "df/unit_inventory_item.h"
#include "df/viewscreen_dwarfmodest.h" #include "df/viewscreen_dwarfmodest.h"
#include "df/viewscreen_titlest.h"
#include "df/world.h" #include "df/world.h"
const size_t MAX_REPORTS_SIZE = 3000; // DF clears old reports to maintain this vector size const size_t MAX_REPORTS_SIZE = 3000; // DF clears old reports to maintain this vector size
@ -144,6 +145,17 @@ static std::map<virtual_identity*, getFocusStringsHandler> getFocusStringsHandle
); \ ); \
static void getFocusStrings_##screen_type(std::string &baseFocus, std::vector<std::string> &focusStrings, VIEWSCREEN(screen_type) *screen) static void getFocusStrings_##screen_type(std::string &baseFocus, std::vector<std::string> &focusStrings, VIEWSCREEN(screen_type) *screen)
DEFINE_GET_FOCUS_STRING_HANDLER(title)
{
if (screen->managing_mods)
focusStrings.push_back(baseFocus + "/Mods");
else if (game->main_interface.settings.open)
focusStrings.push_back(baseFocus + "/Settings");
if (focusStrings.empty())
focusStrings.push_back(baseFocus + "/Default");
}
DEFINE_GET_FOCUS_STRING_HANDLER(dwarfmode) DEFINE_GET_FOCUS_STRING_HANDLER(dwarfmode)
{ {
std::string newFocusString; std::string newFocusString;

@ -113,14 +113,10 @@ public:
case job_type::CarveUpDownStaircase: case job_type::CarveUpDownStaircase:
td.bits.dig = tile_dig_designation::UpDownStair; td.bits.dig = tile_dig_designation::UpDownStair;
break; break;
case job_type::DetailWall: case job_type::SmoothWall:
case job_type::DetailFloor: { case job_type::SmoothFloor:
df::tiletype tt = map.tiletypeAt(job->pos); td.bits.smooth = 1;
if (tileSpecial(tt) != df::tiletype_special::SMOOTH) {
td.bits.smooth = 1;
}
break; break;
}
case job_type::CarveTrack: case job_type::CarveTrack:
to.bits.carve_track_north = (job->item_category.whole >> 18) & 1; to.bits.carve_track_north = (job->item_category.whole >> 18) & 1;
to.bits.carve_track_south = (job->item_category.whole >> 19) & 1; to.bits.carve_track_south = (job->item_category.whole >> 19) & 1;

@ -34,9 +34,10 @@ local function get_selection_size_limits()
or btype == df.building_type.RoadPaved or btype == df.building_type.RoadPaved
or btype == df.building_type.RoadDirt then or btype == df.building_type.RoadDirt then
return {w=31, h=31} return {w=31, h=31}
elseif btype == df.building_type.AxleHorizontal elseif btype == df.building_type.AxleHorizontal then
or btype == df.building_type.Rollers then
return uibs.direction == 1 and {w=1, h=31} or {w=31, h=1} return uibs.direction == 1 and {w=1, h=31} or {w=31, h=1}
elseif btype == df.building_type.Rollers then
return (uibs.direction == 1 or uibs.direction == 3) and {w=31, h=1} or {w=1, h=31}
end end
end end

@ -39,7 +39,7 @@ HotspotMenuWidget.ATTRS{
-- 'new_region', -- conflicts with vanilla panel layouts -- 'new_region', -- conflicts with vanilla panel layouts
'savegame', 'savegame',
'setupdwarfgame', 'setupdwarfgame',
'title', 'title/Default',
'update_region', 'update_region',
'world' 'world'
}, },

@ -562,4 +562,42 @@ function OverlayWidget:init()
self.frame.h = self.frame.h or 1 self.frame.h = self.frame.h or 1
end end
-- ------------------- --
-- TitleVersionOverlay --
-- ------------------- --
TitleVersionOverlay = defclass(TitleVersionOverlay, OverlayWidget)
TitleVersionOverlay.ATTRS{
default_pos={x=50, y=-2},
default_enabled=true,
viewscreens='title/Default',
frame={w=35, h=3},
}
function TitleVersionOverlay:init()
local text = {}
table.insert(text, 'DFHack ' .. dfhack.getDFHackVersion() ..
(dfhack.isPrerelease() and (' (git: %s)'):format(dfhack.getGitCommit(true)) or ''))
if #dfhack.getDFHackBuildID() > 0 then
table.insert(text, NEWLINE)
table.insert(text, 'Build ID: ' .. dfhack.getDFHackBuildID())
end
if dfhack.isPrerelease() then
table.insert(text, NEWLINE)
table.insert(text, {text='Pre-release build', pen=COLOR_LIGHTRED})
end
self:addviews{
widgets.Label{
frame={t=0, l=0},
text=text,
text_pen=COLOR_WHITE,
},
}
end
OVERLAY_WIDGETS = {
title_version = TitleVersionOverlay,
}
return _ENV return _ENV

@ -1 +1 @@
Subproject commit 5da969fce69a5b9330f183cc0629798bf9907b69 Subproject commit 68f6d354b0d815ad0985dbe9b5faa140c980af14