File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -4168,6 +4168,27 @@ static int internal_getClipboardTextCp437Multiline(lua_State *L) {
41684168 return 1 ;
41694169}
41704170
4171+ static int internal_get_persistent_data_int (lua_State* L, get_data_fn get_data) {
4172+ CoreSuspender suspend;
4173+
4174+ PersistentDataItem data = get_data (L);
4175+
4176+ if (!data.isValid () || !lua_isnumber (L, 2 )){
4177+ lua_pushnil (L);
4178+ }
4179+ else {
4180+ const int idx = lua_tointeger (L, 2 );
4181+ lua_pushinteger (L, data.get_int (idx));
4182+ }
4183+
4184+ return 1 ;
4185+ }
4186+
4187+ static int internal_readPersistentSiteDataInt (lua_State* L) {
4188+ return internal_get_persistent_data_int (L, get_site_data);
4189+ }
4190+
4191+
41714192static const luaL_Reg dfhack_internal_funcs[] = {
41724193 { " getPE" , internal_getPE },
41734194 { " getMD5" , internal_getmd5 },
@@ -4203,6 +4224,7 @@ static const luaL_Reg dfhack_internal_funcs[] = {
42034224 { " getPerfCounters" , internal_getPerfCounters },
42044225 { " getPreferredNumberFormat" , internal_getPreferredNumberFormat },
42054226 { " getClipboardTextCp437Multiline" , internal_getClipboardTextCp437Multiline },
4227+ { " readPersistentSiteConfigInt" , internal_readPersistentSiteDataInt },
42064228 { NULL , NULL }
42074229};
42084230
You can’t perform that action at this time.
0 commit comments