From c52b1cc950b3e55b27050740fb3f037d45918c09 Mon Sep 17 00:00:00 2001 From: Taxi Service Date: Thu, 18 May 2023 12:46:21 +0200 Subject: [PATCH] reverted to just renaming FRAMES in gui.lua --- library/LuaApi.cpp | 10 ++++---- library/include/modules/Textures.h | 10 ++++---- library/lua/gui.lua | 2 +- library/modules/Textures.cpp | 40 +++++++++++++++--------------- plugins/lua/buildingplan/pens.lua | 4 +-- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index d21ce29e5..08903c7bd 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -1716,11 +1716,11 @@ static const LuaWrapper::FunctionReg dfhack_textures_module[] = { WRAPM(Textures, getIconsTexposStart), WRAPM(Textures, getOnOffTexposStart), WRAPM(Textures, getControlPanelTexposStart), - WRAPM(Textures, getBorderThinTexposStart), - WRAPM(Textures, getBorderMediumTexposStart), - WRAPM(Textures, getBorderBoldTexposStart), - WRAPM(Textures, getBorderPanelTexposStart), - WRAPM(Textures, getBorderWindowTexposStart), + 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 1664f6081..95e628d5a 100644 --- a/library/include/modules/Textures.h +++ b/library/include/modules/Textures.h @@ -54,11 +54,11 @@ DFHACK_EXPORT long getControlPanelTexposStart(); /** * Get the first texpos for the DFHack borders. Each is a 7x3 grid. */ -DFHACK_EXPORT long getBorderThinTexposStart(); -DFHACK_EXPORT long getBorderMediumTexposStart(); -DFHACK_EXPORT long getBorderBoldTexposStart(); -DFHACK_EXPORT long getBorderPanelTexposStart(); -DFHACK_EXPORT long getBorderWindowTexposStart(); +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 311edc1f3..d511cd51f 100644 --- a/library/lua/gui.lua +++ b/library/lua/gui.lua @@ -905,7 +905,7 @@ local BASE_FRAME = { } local function make_frame(name, double_line) - local texpos = dfhack.textures['getBorder'..name..'TexposStart']() + local texpos = dfhack.textures['get'..name..'BordersTexposStart']() local tp = function(offset) if texpos == -1 then return nil end return texpos + offset diff --git a/library/modules/Textures.cpp b/library/modules/Textures.cpp index 40339a616..a30f879a0 100644 --- a/library/modules/Textures.cpp +++ b/library/modules/Textures.cpp @@ -24,11 +24,11 @@ static long g_red_pin_texpos_start = -1; static long g_icons_texpos_start = -1; static long g_on_off_texpos_start = -1; static long g_control_panel_texpos_start = -1; -static long g_border_thin_texpos_start = -1; -static long g_border_medium_texpos_start = -1; -static long g_border_bold_texpos_start = -1; -static long g_border_panel_texpos_start = -1; -static long g_border_window_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; // Converts an arbitrary Surface to something like the display format // (32-bit RGBA), and converts magenta to transparency if convert_magenta is set @@ -132,15 +132,15 @@ void Textures::init(color_ostream &out) { g_num_dfhack_textures += load_textures(out, "hack/data/art/control-panel.png", &g_control_panel_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-thin.png", - &g_border_thin_texpos_start); + &g_thin_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-medium.png", - &g_border_medium_texpos_start); + &g_medium_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-bold.png", - &g_border_bold_texpos_start); + &g_bold_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-panel.png", - &g_border_panel_texpos_start); + &g_panel_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-window.png", - &g_border_window_texpos_start); + &g_window_borders_texpos_start); DEBUG(textures,out).print("loaded %ld textures\n", g_num_dfhack_textures); @@ -197,22 +197,22 @@ long Textures::getControlPanelTexposStart() { return g_control_panel_texpos_start; } -long Textures::getBorderThinTexposStart() { - return g_border_thin_texpos_start; +long Textures::getThinBordersTexposStart() { + return g_thin_borders_texpos_start; } -long Textures::getBorderMediumTexposStart() { - return g_border_medium_texpos_start; +long Textures::getMediumBordersTexposStart() { + return g_medium_borders_texpos_start; } -long Textures::getBorderBoldTexposStart() { - return g_border_bold_texpos_start; +long Textures::getBoldBordersTexposStart() { + return g_bold_borders_texpos_start; } -long Textures::getBorderPanelTexposStart() { - return g_border_panel_texpos_start; +long Textures::getPanelBordersTexposStart() { + return g_panel_borders_texpos_start; } -long Textures::getBorderWindowTexposStart() { - return g_border_window_texpos_start; +long Textures::getWindowBordersTexposStart() { + return g_window_borders_texpos_start; } diff --git a/plugins/lua/buildingplan/pens.lua b/plugins/lua/buildingplan/pens.lua index c68e12eae..e69a4c210 100644 --- a/plugins/lua/buildingplan/pens.lua +++ b/plugins/lua/buildingplan/pens.lua @@ -18,12 +18,12 @@ function reload_pens() GOOD_TILE_PEN = to_pen{ch='o', fg=COLOR_GREEN, tile=dfhack.screen.findGraphicsTile('CURSORS', 1, 2)} BAD_TILE_PEN = to_pen{ch='X', fg=COLOR_RED, tile=dfhack.screen.findGraphicsTile('CURSORS', 3, 0)} - local tb_texpos = dfhack.textures.getBorderThinTexposStart() + 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=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 mb_texpos = dfhack.textures.getBorderMediumTexposStart() + local mb_texpos = dfhack.textures.getMediumBordersTexposStart() HORI_LEFT_PEN = to_pen{tile=tp(mb_texpos, 12), ch=195, fg=COLOR_GREY, bg=COLOR_BLACK} HORI_MID_PEN = to_pen{tile=tp(mb_texpos, 5), ch=196, fg=COLOR_GREY, bg=COLOR_BLACK} HORI_RIGHT_PEN = to_pen{tile=tp(mb_texpos, 13), ch=180, fg=COLOR_GREY, bg=COLOR_BLACK}