add on/off light textures and expose to lua

develop
Myk Taylor 2023-01-28 23:59:36 -08:00
parent 6dc74f201d
commit c2d6debcd8
No known key found for this signature in database
4 changed files with 13 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

@ -1693,6 +1693,7 @@ static const LuaWrapper::FunctionReg dfhack_textures_module[] = {
WRAPM(Textures, getGreenPinTexposStart), WRAPM(Textures, getGreenPinTexposStart),
WRAPM(Textures, getRedPinTexposStart), WRAPM(Textures, getRedPinTexposStart),
WRAPM(Textures, getIconsTexposStart), WRAPM(Textures, getIconsTexposStart),
WRAPM(Textures, getOnOffTexposStart),
WRAPM(Textures, getThinBordersTexposStart), WRAPM(Textures, getThinBordersTexposStart),
WRAPM(Textures, getMediumBordersTexposStart), WRAPM(Textures, getMediumBordersTexposStart),
WRAPM(Textures, getPanelBordersTexposStart), WRAPM(Textures, getPanelBordersTexposStart),

@ -41,6 +41,11 @@ DFHACK_EXPORT long getRedPinTexposStart();
*/ */
DFHACK_EXPORT long getIconsTexposStart(); 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. * Get the first texpos for the DFHack borders. Each is a 7x3 grid.
*/ */

@ -22,6 +22,7 @@ static long g_dfhack_logo_texpos_start = -1;
static long g_green_pin_texpos_start = -1; static long g_green_pin_texpos_start = -1;
static long g_red_pin_texpos_start = -1; static long g_red_pin_texpos_start = -1;
static long g_icons_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_thin_borders_texpos_start = -1;
static long g_medium_borders_texpos_start = -1; static long g_medium_borders_texpos_start = -1;
static long g_panel_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_red_pin_texpos_start);
g_num_dfhack_textures += load_textures(out, "hack/data/art/icons.png", g_num_dfhack_textures += load_textures(out, "hack/data/art/icons.png",
&g_icons_texpos_start); &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_num_dfhack_textures += load_textures(out, "hack/data/art/border-thin.png",
&g_thin_borders_texpos_start); &g_thin_borders_texpos_start);
g_num_dfhack_textures += load_textures(out, "hack/data/art/border-medium.png", 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; return g_icons_texpos_start;
} }
long Textures::getOnOffTexposStart() {
return g_on_off_texpos_start;
}
long Textures::getThinBordersTexposStart() { long Textures::getThinBordersTexposStart() {
return g_thin_borders_texpos_start; return g_thin_borders_texpos_start;
} }