не понимаю почему само меняет тип переменной

leekyrave

Известный
Автор темы
419
223
Версия MoonLoader
.026-beta
привет всем,не пойму почему в скрипте с имгуи после перезагрузки скрипта меняется тип переменной


Lua:
local directIni = "SHelper\\SHelper.ini"


local def = {
    settings = {
        nick = u8"Не установлен",
    theme = 0,
    tag = u8"Не установлен",
    sex = 0,
    post = u8"Не определена",
    organisation = u8"Не определена",
    donat = true,
    command = "shelper",
    password = "",
    passwordauto = false,
    enablestats = true,
    timejp = 2500,
  },
}



local ini = inicfg.load(def, directIni)

local tema = imgui.ImInt(ini.settings.theme)

После рестарта - в ини файле строка theme - становится true, почему - не знаю.

Код смены тем -
Lua:
if imgui.CollapsingHeader(u8'Настройка тем') then
    if ini.settings.theme == 0 then gray_theme() end
       if ini.settings.theme == 1 then orange_theme() end
      if ini.settings.theme == 2 then blue_theme() end
    if ini.settings.theme == 3 then pink_theme() end
    if ini.settings.theme == 4 then red_theme() end
 
    local table_themes = {u8'Серая', u8'Оранжевая', u8'Синяя', u8'Фиолетовая',u8'Красная'}
    imgui.PushItemWidth(200) --Устанавливаем ширину элементов listBox
    if imgui.Combo(u8'', tema, table_themes, 6) then

      ini.settings.theme = tema.v
            inicfg.save(def, directIni)
      
    end
imgui.PopItemWidth()
  end

Помогите
я глупый,закрыто,я присваивал полю темы значение другой переменной,решено.