-
Автор темы
- #1
Увидел такое в неверлузе,но не понял как это сделать, ведь несколько тултипов как в ските сделать нельзя, прошу помощи!
code_language.lua:
local function setup(screen_width_temp, screen_height_temp)
screen_width, screen_height = screen_width_temp, screen_height_temp
local aspect_ratio_table = {}
for i=1, steps do
local i2=(steps-i)*multiplier
local divisor = gcd(screen_width*i2, screen_height)
if screen_width*i2/divisor < 100 or i2 == 1 then
aspect_ratio_table[i] = screen_width*i2/divisor .. ":" .. screen_height/divisor
end
end
if aspect_ratio_reference ~= nil then
aspect_ratio_reference:set_callback(noop)
end
--ui.new_slider(tab: string, container: string, name: string, min: number, max: number[, init_value: number] [, show_tooltip: boolean] [, unit: string] [, scale: number] [, tooltips: table]): number (menu item)
aspect_ratio_reference = lua_ui.visuals.enable_aspectratio:create():slider("Force aspect ratio", 0, steps-1, steps/2, aspect_ratio_table, "%")
if lua_ui.visuals.enable_aspectratio:get() then
aspect_ratio_reference:set_callback(on_aspect_ratio_changed)
else
aspect_ratio_reference:unset_callback(on_aspect_ratio_changed)
end
end