diff --git a/data/art/on-off.png b/data/art/on-off.png new file mode 100644 index 000000000..2b731e1c6 Binary files /dev/null and b/data/art/on-off.png differ diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index 421821c05..764557499 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -1693,6 +1693,7 @@ static const LuaWrapper::FunctionReg dfhack_textures_module[] = { WRAPM(Textures, getGreenPinTexposStart), WRAPM(Textures, getRedPinTexposStart), WRAPM(Textures, getIconsTexposStart), + WRAPM(Textures, getOnOffTexposStart), WRAPM(Textures, getThinBordersTexposStart), WRAPM(Textures, getMediumBordersTexposStart), WRAPM(Textures, getPanelBordersTexposStart), diff --git a/library/include/modules/Textures.h b/library/include/modules/Textures.h index e01003704..446bd1962 100644 --- a/library/include/modules/Textures.h +++ b/library/include/modules/Textures.h @@ -41,6 +41,11 @@ DFHACK_EXPORT long getRedPinTexposStart(); */ DFHACK_EXPORT long getIconsTexposStart(); +/** + * Get the first texpos for the on and off icons. It's a 2x1 grid. + */ +DFHACK_EXPORT long getOnOffTexposStart(); + /** * Get the first texpos for the DFHack borders. Each is a 7x3 grid. */ diff --git a/library/modules/Textures.cpp b/library/modules/Textures.cpp index 2975dc4d8..7781bfc10 100644 --- a/library/modules/Textures.cpp +++ b/library/modules/Textures.cpp @@ -22,6 +22,7 @@ static long g_dfhack_logo_texpos_start = -1; static long g_green_pin_texpos_start = -1; 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_thin_borders_texpos_start = -1; static long g_medium_borders_texpos_start = -1; static long g_panel_borders_texpos_start = -1; @@ -124,6 +125,8 @@ void Textures::init(color_ostream &out) { &g_red_pin_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/icons.png", &g_icons_texpos_start); + g_num_dfhack_textures += load_textures(out, "hack/data/art/on-off.png", + &g_on_off_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-thin.png", &g_thin_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-medium.png", @@ -180,6 +183,10 @@ long Textures::getIconsTexposStart() { return g_icons_texpos_start; } +long Textures::getOnOffTexposStart() { + return g_on_off_texpos_start; +} + long Textures::getThinBordersTexposStart() { return g_thin_borders_texpos_start; }