diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 94bfad310..c305de56c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,11 +20,11 @@ repos: args: ['--fix=lf'] - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.21.0 + rev: 0.22.0 hooks: - id: check-github-workflows - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.4.2 + rev: v1.5.1 hooks: - id: forbid-tabs exclude_types: diff --git a/data/art/border-bold.png b/data/art/border-bold.png new file mode 100644 index 000000000..16423a3a7 Binary files /dev/null and b/data/art/border-bold.png differ diff --git a/docs/changelog.txt b/docs/changelog.txt index b0b86c4cd..ff9d05b0f 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -48,6 +48,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## API ## Lua +- added two new window borders: ``gui.BOLD_FRAME`` for accented elements and ``gui.INTERIOR_MEDIUM_FRAME`` for a signature-less frame that's thicker than the existing ``gui.INTERIOR_FRAME`` ## Removed diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index 2af9e39f1..e63bc8a61 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -4352,11 +4352,22 @@ There are the following predefined frame style tables: A frame suitable for overlay widget panels. +* ``BOLD_FRAME`` + + A frame suitable for a non-draggable panel meant to capture the user's focus, + like an important notification, confirmation dialog or error message. + * ``INTERIOR_FRAME`` - A frame suitable for light interior accent elements. This frame does *not* have - a visible ``DFHack`` signature on it, so it must not be used as the most external - frame for a DFHack-owned UI. + A frame suitable for light interior accent elements. This frame does *not* + have a visible ``DFHack`` signature on it, so it must not be used as the most + external frame for a DFHack-owned UI. + +* ``INTERIOR_MEDIUM_FRAME`` + + A copy of ``MEDIUM_FRAME`` that lacks the ``DFHack`` signature. Suitable for + panels that are part of a larger widget cluster. Must *not* be used as the + most external frame for a DFHack-owned UI. gui.widgets =========== diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index c9bdc3021..5573d3f20 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -1718,6 +1718,7 @@ static const LuaWrapper::FunctionReg dfhack_textures_module[] = { WRAPM(Textures, getControlPanelTexposStart), WRAPM(Textures, getThinBordersTexposStart), WRAPM(Textures, getMediumBordersTexposStart), + WRAPM(Textures, getBoldBordersTexposStart), WRAPM(Textures, getPanelBordersTexposStart), WRAPM(Textures, getWindowBordersTexposStart), { NULL, NULL } diff --git a/library/include/modules/Textures.h b/library/include/modules/Textures.h index a438f01f4..95e628d5a 100644 --- a/library/include/modules/Textures.h +++ b/library/include/modules/Textures.h @@ -56,6 +56,7 @@ DFHACK_EXPORT long getControlPanelTexposStart(); */ DFHACK_EXPORT long getThinBordersTexposStart(); DFHACK_EXPORT long getMediumBordersTexposStart(); +DFHACK_EXPORT long getBoldBordersTexposStart(); DFHACK_EXPORT long getPanelBordersTexposStart(); DFHACK_EXPORT long getWindowBordersTexposStart(); diff --git a/library/lua/gui.lua b/library/lua/gui.lua index 7791f3685..64e203d3c 100644 --- a/library/lua/gui.lua +++ b/library/lua/gui.lua @@ -916,8 +916,11 @@ end WINDOW_FRAME = make_frame('Window', true) PANEL_FRAME = make_frame('Panel', false) MEDIUM_FRAME = make_frame('Medium', false) +BOLD_FRAME = make_frame('Bold', true) INTERIOR_FRAME = make_frame('Thin', false) INTERIOR_FRAME.signature_pen = false +INTERIOR_MEDIUM_FRAME = copyall(MEDIUM_FRAME) +INTERIOR_MEDIUM_FRAME.signature_pen = false -- for compatibility with pre-steam code GREY_LINE_FRAME = WINDOW_FRAME diff --git a/library/modules/Items.cpp b/library/modules/Items.cpp index 303f9771e..03d6cda4a 100644 --- a/library/modules/Items.cpp +++ b/library/modules/Items.cpp @@ -720,13 +720,14 @@ df::coord Items::getPosition(df::item *item) return item->pos; } -// These '\xFF' chars refer to quality markers from curses.png, namely: 250 (≡), 15 (☼), 174 («) and 175 (»). -static const char MARKER_EXCEPTIONAL = '\xF0'; -static const char MARKER_MASTERWORK = '\x0F'; -static const char MARKER_IMPROVED_LEFT = '\xAE'; -static const char MARKER_IMPROVED_RIGHT = '\xAF'; - -static char quality_table[] = { 0, '-', '+', '*', MARKER_EXCEPTIONAL, MARKER_MASTERWORK }; +static const char quality_table[] = { + '\0', // (base) + '-', // well-crafted + '+', // finely-crafted + '*', // superior quality + '\xF0', // (≡) exceptional + '\x0F' // (☼) masterful +}; static void addQuality(std::string &tmp, int quality) { @@ -831,7 +832,7 @@ std::string Items::getDescription(df::item *item, int type, bool decorate) addQuality(tmp, item->getQuality()); if (item->isImproved()) { - tmp = MARKER_IMPROVED_LEFT + tmp + MARKER_IMPROVED_RIGHT; + tmp = '\xAE' + tmp + '\xAF'; // («) + tmp + (») addQuality(tmp, item->getImprovementQuality()); } } diff --git a/library/modules/Textures.cpp b/library/modules/Textures.cpp index 25d44695a..a30f879a0 100644 --- a/library/modules/Textures.cpp +++ b/library/modules/Textures.cpp @@ -26,6 +26,7 @@ static long g_on_off_texpos_start = -1; static long g_control_panel_texpos_start = -1; static long g_thin_borders_texpos_start = -1; static long g_medium_borders_texpos_start = -1; +static long g_bold_borders_texpos_start = -1; static long g_panel_borders_texpos_start = -1; static long g_window_borders_texpos_start = -1; @@ -134,6 +135,8 @@ void Textures::init(color_ostream &out) { &g_thin_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-medium.png", &g_medium_borders_texpos_start); + g_num_dfhack_textures += load_textures(out, "hack/data/art/border-bold.png", + &g_bold_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-panel.png", &g_panel_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-window.png", @@ -202,6 +205,10 @@ long Textures::getMediumBordersTexposStart() { return g_medium_borders_texpos_start; } +long Textures::getBoldBordersTexposStart() { + return g_bold_borders_texpos_start; +} + long Textures::getPanelBordersTexposStart() { return g_panel_borders_texpos_start; } diff --git a/library/xml b/library/xml index 739d17867..d7f07e54b 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 739d1786723bbe912f448064c5705092a7936cc6 +Subproject commit d7f07e54b4ea7832b226f8d8678906c9c366918a diff --git a/plugins/lua/buildingplan.lua b/plugins/lua/buildingplan.lua index a33c1684f..2de467f7c 100644 --- a/plugins/lua/buildingplan.lua +++ b/plugins/lua/buildingplan.lua @@ -103,6 +103,14 @@ function get_desc(filter) desc = 'Mechanism' elseif desc == 'Wood' then desc = 'Log' + elseif desc == 'Any weapon' then + desc = 'Weapon' + elseif desc == 'Any spike' then + desc = 'Spike' + elseif desc == 'Ballistapart' then + desc = 'Ballista part' + elseif desc == 'Catapultpart' then + desc = 'Catapult part' end return desc diff --git a/plugins/lua/buildingplan/pens.lua b/plugins/lua/buildingplan/pens.lua index 973bb7bc6..ed8f393d6 100644 --- a/plugins/lua/buildingplan/pens.lua +++ b/plugins/lua/buildingplan/pens.lua @@ -19,8 +19,8 @@ function reload_pens() local tb_texpos = dfhack.textures.getThinBordersTexposStart() VERT_TOP_PEN = to_pen{tile=tp(tb_texpos, 10), ch=194, fg=COLOR_GREY, bg=COLOR_BLACK} - VERT_MID_PEN = to_pen{tile=tp(tb_texpos, 4), ch=192, fg=COLOR_GREY, bg=COLOR_BLACK} - VERT_BOT_PEN = to_pen{tile=tp(tb_texpos, 11), ch=179, fg=COLOR_GREY, bg=COLOR_BLACK} + VERT_MID_PEN = to_pen{tile=tp(tb_texpos, 4), ch=179, fg=COLOR_GREY, bg=COLOR_BLACK} + VERT_BOT_PEN = to_pen{tile=tp(tb_texpos, 11), ch=193, fg=COLOR_GREY, bg=COLOR_BLACK} local cp_texpos = dfhack.textures.getControlPanelTexposStart() BUTTON_START_PEN = to_pen{tile=tp(cp_texpos, 13), ch='[', fg=COLOR_YELLOW} diff --git a/scripts b/scripts index d2dad272e..53f0aedf9 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit d2dad272e4b24c043ca62f843511c763fb1f67b5 +Subproject commit 53f0aedf9f7df33a4f79246ba46de02794619d09