Port latest OptionsView changes into DMF
This commit is contained in:
parent
c87b0fd9c0
commit
3b387c294d
3 changed files with 120 additions and 39 deletions
|
@ -7,8 +7,14 @@ local _widgets_by_name
|
||||||
-- ####################################################################################################################
|
-- ####################################################################################################################
|
||||||
|
|
||||||
local function load_scrolling_speed_setting()
|
local function load_scrolling_speed_setting()
|
||||||
if dmf:get("dmf_options_scrolling_speed") and _widgets_by_name and _widgets_by_name["scrollbar"] then
|
local dmf_scroll_speed = dmf:get("dmf_options_scrolling_speed")
|
||||||
_widgets_by_name["scrollbar"].content.scroll_speed = dmf:get("dmf_options_scrolling_speed")
|
if dmf_scroll_speed and _widgets_by_name then
|
||||||
|
if _widgets_by_name["scrollbar"] then
|
||||||
|
_widgets_by_name["scrollbar"].content.scroll_speed = dmf_scroll_speed / 10
|
||||||
|
end
|
||||||
|
if _widgets_by_name["settings_scrollbar"] then
|
||||||
|
_widgets_by_name["settings_scrollbar"].content.scroll_speed = dmf_scroll_speed / 10
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -151,6 +157,8 @@ DMFOptionsView.cb_on_back_pressed = function (self)
|
||||||
self._close_selected_setting = true
|
self._close_selected_setting = true
|
||||||
elseif selected_navigation_column == SETTINGS_GRID then
|
elseif selected_navigation_column == SETTINGS_GRID then
|
||||||
self:_change_navigation_column(selected_navigation_column - 1)
|
self:_change_navigation_column(selected_navigation_column - 1)
|
||||||
|
elseif self._require_restart then
|
||||||
|
self:_restart_popup_info()
|
||||||
else
|
else
|
||||||
local view_name = "dmf_options_view"
|
local view_name = "dmf_options_view"
|
||||||
Managers.ui:close_view(view_name)
|
Managers.ui:close_view(view_name)
|
||||||
|
@ -207,6 +215,30 @@ DMFOptionsView.cb_reset_category_to_default = function (self)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
DMFOptionsView._restart_popup_info = function (self)
|
||||||
|
local context = {
|
||||||
|
title_text = "loc_popup_settings_require_restart_header",
|
||||||
|
description_text = "loc_popup_settings_require_restart_description",
|
||||||
|
options = {
|
||||||
|
{
|
||||||
|
text = "loc_confirm",
|
||||||
|
close_on_pressed = true,
|
||||||
|
callback = callback(function ()
|
||||||
|
self._popup_id = nil
|
||||||
|
local view_name = "options_view"
|
||||||
|
self._require_restart = false
|
||||||
|
|
||||||
|
Managers.ui:close_view(view_name)
|
||||||
|
end)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Managers.event:trigger("event_show_ui_popup", context, function (id)
|
||||||
|
self._popup_id = id
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
DMFOptionsView._setup_input_legend = function (self)
|
DMFOptionsView._setup_input_legend = function (self)
|
||||||
self._input_legend_element = self:_add_element(ViewElementInputLegend, "input_legend", 10)
|
self._input_legend_element = self:_add_element(ViewElementInputLegend, "input_legend", 10)
|
||||||
local legend_inputs = self._definitions.legend_inputs
|
local legend_inputs = self._definitions.legend_inputs
|
||||||
|
@ -225,7 +257,7 @@ DMFOptionsView._setup_content_grid_scrollbar = function (self, grid, widget_id,
|
||||||
|
|
||||||
load_scrolling_speed_setting()
|
load_scrolling_speed_setting()
|
||||||
|
|
||||||
grid:assign_scrollbar(scrollbar_widget, grid_pivot_scenegraph_id, grid_scenegraph_id)
|
grid:assign_scrollbar(scrollbar_widget, grid_pivot_scenegraph_id, grid_scenegraph_id, true)
|
||||||
grid:set_scrollbar_progress(0)
|
grid:set_scrollbar_progress(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -746,6 +778,7 @@ DMFOptionsView._setup_settings_config = function (self, config)
|
||||||
local settings_default_values = {}
|
local settings_default_values = {}
|
||||||
local aligment_list = {}
|
local aligment_list = {}
|
||||||
local callback_name = "cb_on_settings_pressed"
|
local callback_name = "cb_on_settings_pressed"
|
||||||
|
local changed_callback_name = "cb_on_settings_changed"
|
||||||
|
|
||||||
for setting_index, setting in ipairs(config_settings) do
|
for setting_index, setting in ipairs(config_settings) do
|
||||||
local valid = self._validation_mapping[setting.category].settings[setting.display_name].validation_result
|
local valid = self._validation_mapping[setting.category].settings[setting.display_name].validation_result
|
||||||
|
@ -768,7 +801,7 @@ DMFOptionsView._setup_settings_config = function (self, config)
|
||||||
end
|
end
|
||||||
|
|
||||||
local widget_suffix = "setting_" .. tostring(setting_index)
|
local widget_suffix = "setting_" .. tostring(setting_index)
|
||||||
local widget, alignment_widget = self:_create_settings_widget_from_config(setting, category, widget_suffix, callback_name)
|
local widget, alignment_widget = self:_create_settings_widget_from_config(setting, category, widget_suffix, callback_name, changed_callback_name)
|
||||||
category_widgets[category][#widgets + 1] = {
|
category_widgets[category][#widgets + 1] = {
|
||||||
widget = widget,
|
widget = widget,
|
||||||
alignment_widget = alignment_widget
|
alignment_widget = alignment_widget
|
||||||
|
@ -852,7 +885,7 @@ DMFOptionsView._set_tooltip_data = function (self, widget)
|
||||||
height
|
height
|
||||||
}
|
}
|
||||||
self._widgets_by_name.tooltip.offset[1] = x_pos - width * 0.8
|
self._widgets_by_name.tooltip.offset[1] = x_pos - width * 0.8
|
||||||
self._widgets_by_name.tooltip.offset[2] = new_y - height
|
self._widgets_by_name.tooltip.offset[2] = math.max(new_y - height, 20)
|
||||||
self._widgets_by_name.tooltip.content.visible = true
|
self._widgets_by_name.tooltip.content.visible = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -945,7 +978,7 @@ DMFOptionsView._create_settings_widget_from_config = function (self, config, cat
|
||||||
local init = template.init
|
local init = template.init
|
||||||
|
|
||||||
if init then
|
if init then
|
||||||
init(self, widget, config, callback_name)
|
init(self, widget, config, callback_name, changed_callback_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1079,6 +1112,24 @@ DMFOptionsView.cb_on_settings_pressed = function (self, widget, entry)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
DMFOptionsView.cb_on_settings_changed = function (self, widget, entry, option_id)
|
||||||
|
if not self._require_restart then
|
||||||
|
if option_id then
|
||||||
|
for i = 1, #entry.options do
|
||||||
|
local option = entry.options[i]
|
||||||
|
|
||||||
|
if option.id == option_id then
|
||||||
|
self._require_restart = option.require_restart
|
||||||
|
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self._require_restart = entry.require_restart
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
DMFOptionsView._enable_settings_overlay = function (self, enable)
|
DMFOptionsView._enable_settings_overlay = function (self, enable)
|
||||||
local widgets_by_name = self._widgets_by_name
|
local widgets_by_name = self._widgets_by_name
|
||||||
local settings_overlay_widget = widgets_by_name.settings_overlay
|
local settings_overlay_widget = widgets_by_name.settings_overlay
|
||||||
|
|
|
@ -56,7 +56,7 @@ local blueprints = {
|
||||||
settings_value_height
|
settings_value_height
|
||||||
},
|
},
|
||||||
pass_template = ButtonPassTemplates.list_button,
|
pass_template = ButtonPassTemplates.list_button,
|
||||||
init = function (parent, widget, entry, callback_name)
|
init = function (parent, widget, entry, callback_name, changed_callback_name)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
local hotspot = content.hotspot
|
local hotspot = content.hotspot
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ local blueprints = {
|
||||||
settings_value_height
|
settings_value_height
|
||||||
},
|
},
|
||||||
pass_template = ButtonPassTemplates.settings_button(settings_grid_width, settings_value_height, settings_value_width, true),
|
pass_template = ButtonPassTemplates.settings_button(settings_grid_width, settings_value_height, settings_value_width, true),
|
||||||
init = function (parent, widget, entry, callback_name)
|
init = function (parent, widget, entry, callback_name, changed_callback_name)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
|
|
||||||
content.hotspot.pressed_callback = function ()
|
content.hotspot.pressed_callback = function ()
|
||||||
|
@ -98,6 +98,10 @@ local blueprints = {
|
||||||
content.text = display_name
|
content.text = display_name
|
||||||
content.button_text = Localize("loc_settings_change")
|
content.button_text = Localize("loc_settings_change")
|
||||||
content.entry = entry
|
content.entry = entry
|
||||||
|
|
||||||
|
entry.changed_callback = function (changed_value)
|
||||||
|
callback(parent, changed_callback_name, widget, entry)()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
group_header = {
|
group_header = {
|
||||||
|
@ -113,7 +117,7 @@ local blueprints = {
|
||||||
value = Localize("loc_settings_option_unavailable")
|
value = Localize("loc_settings_option_unavailable")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init = function (parent, widget, entry, callback_name)
|
init = function (parent, widget, entry, callback_name, changed_callback_name)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
local display_name = entry.display_name
|
local display_name = entry.display_name
|
||||||
content.text = display_name
|
content.text = display_name
|
||||||
|
@ -127,9 +131,9 @@ local blueprints = {
|
||||||
pass_template_function = function (parent, config, size)
|
pass_template_function = function (parent, config, size)
|
||||||
return CheckboxPassTemplates.settings_checkbox(size[1], settings_value_height, settings_value_width, 2, true)
|
return CheckboxPassTemplates.settings_checkbox(size[1], settings_value_height, settings_value_width, 2, true)
|
||||||
end,
|
end,
|
||||||
init = function (parent, widget, entry, callback_name)
|
init = function (parent, widget, entry, callback_name, changed_callback_name)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
local display_name = entry.display_name or Localize("loc_settings_option_unavailable")
|
local display_name = entry.display_name or Managers.localization:localize("loc_settings_option_unavailable")
|
||||||
content.text = display_name
|
content.text = display_name
|
||||||
content.entry = entry
|
content.entry = entry
|
||||||
|
|
||||||
|
@ -137,6 +141,11 @@ local blueprints = {
|
||||||
local widget_option_id = "option_" .. i
|
local widget_option_id = "option_" .. i
|
||||||
content[widget_option_id] = i == 1 and Managers.localization:localize("loc_setting_checkbox_on") or Managers.localization:localize("loc_setting_checkbox_off")
|
content[widget_option_id] = i == 1 and Managers.localization:localize("loc_setting_checkbox_on") or Managers.localization:localize("loc_setting_checkbox_off")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
entry.changed_callback = function (changed_value)
|
||||||
|
callback(parent, callback_name, widget, entry)()
|
||||||
|
callback(parent, changed_callback_name, widget, entry)()
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
update = function (parent, widget, input_service, dt, t)
|
update = function (parent, widget, input_service, dt, t)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
|
@ -149,7 +158,7 @@ local blueprints = {
|
||||||
content.disabled = is_disabled
|
content.disabled = is_disabled
|
||||||
local new_value = nil
|
local new_value = nil
|
||||||
|
|
||||||
if hotspot.on_pressed and not is_disabled then
|
if hotspot.on_pressed and not parent._navigation_column_changed_this_frame and not is_disabled then
|
||||||
new_value = not value
|
new_value = not value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -167,9 +176,9 @@ local blueprints = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local function slider_init_function(parent, widget, entry, callback_name)
|
local function slider_init_function(parent, widget, entry, callback_name, changed_callback_name)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
local display_name = entry.display_name or Localize("loc_settings_option_unavailable")
|
local display_name = entry.display_name or Managers.localization:localize("loc_settings_option_unavailable")
|
||||||
content.text = display_name
|
content.text = display_name
|
||||||
content.entry = entry
|
content.entry = entry
|
||||||
content.area_length = settings_value_width
|
content.area_length = settings_value_width
|
||||||
|
@ -186,7 +195,7 @@ local function slider_init_function(parent, widget, entry, callback_name)
|
||||||
content.previous_slider_value = value
|
content.previous_slider_value = value
|
||||||
content.slider_value = value
|
content.slider_value = value
|
||||||
|
|
||||||
content.pressed_callback = function ()
|
entry.pressed_callback = function ()
|
||||||
local is_disabled = entry.is_disabled
|
local is_disabled = entry.is_disabled
|
||||||
|
|
||||||
if is_disabled then
|
if is_disabled then
|
||||||
|
@ -195,6 +204,10 @@ local function slider_init_function(parent, widget, entry, callback_name)
|
||||||
|
|
||||||
callback(parent, callback_name, widget, entry)()
|
callback(parent, callback_name, widget, entry)()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
entry.changed_callback = function (changed_value)
|
||||||
|
callback(parent, changed_callback_name, widget, entry)()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
blueprints.percent_slider = {
|
blueprints.percent_slider = {
|
||||||
|
@ -205,8 +218,8 @@ blueprints.percent_slider = {
|
||||||
pass_template_function = function (parent, config, size)
|
pass_template_function = function (parent, config, size)
|
||||||
return SliderPassTemplates.settings_percent_slider(size[1], settings_value_height, settings_value_width, true)
|
return SliderPassTemplates.settings_percent_slider(size[1], settings_value_height, settings_value_width, true)
|
||||||
end,
|
end,
|
||||||
init = function (parent, widget, entry, callback_name)
|
init = function (parent, widget, entry, callback_name, changed_callback_name)
|
||||||
slider_init_function(parent, widget, entry, callback_name)
|
slider_init_function(parent, widget, entry, callback_name, changed_callback_name)
|
||||||
end,
|
end,
|
||||||
update = function (parent, widget, input_service, dt, t)
|
update = function (parent, widget, input_service, dt, t)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
|
@ -263,8 +276,8 @@ blueprints.percent_slider = {
|
||||||
if hotspot.on_pressed and not is_disabled then
|
if hotspot.on_pressed and not is_disabled then
|
||||||
if focused then
|
if focused then
|
||||||
new_value = content.slider_value
|
new_value = content.slider_value
|
||||||
elseif using_gamepad then
|
elseif using_gamepad and entry.pressed_callback then
|
||||||
content.pressed_callback()
|
entry.pressed_callback()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -296,8 +309,8 @@ blueprints.value_slider = {
|
||||||
pass_template_function = function (parent, config, size)
|
pass_template_function = function (parent, config, size)
|
||||||
return SliderPassTemplates.settings_value_slider(size[1], settings_value_height, settings_value_width, true)
|
return SliderPassTemplates.settings_value_slider(size[1], settings_value_height, settings_value_width, true)
|
||||||
end,
|
end,
|
||||||
init = function (parent, widget, entry, callback_name)
|
init = function (parent, widget, entry, callback_name, changed_callback_name)
|
||||||
slider_init_function(parent, widget, entry, callback_name)
|
slider_init_function(parent, widget, entry, callback_name, changed_callback_name)
|
||||||
end,
|
end,
|
||||||
update = function (parent, widget, input_service, dt, t)
|
update = function (parent, widget, input_service, dt, t)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
|
@ -359,8 +372,8 @@ blueprints.value_slider = {
|
||||||
if hotspot.on_pressed then
|
if hotspot.on_pressed then
|
||||||
if focused then
|
if focused then
|
||||||
new_normalized_value = content.slider_value
|
new_normalized_value = content.slider_value
|
||||||
elseif using_gamepad then
|
elseif using_gamepad and entry.pressed_callback then
|
||||||
content.pressed_callback()
|
entry.pressed_callback()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -394,9 +407,9 @@ blueprints.slider = {
|
||||||
pass_template_function = function (parent, config, size)
|
pass_template_function = function (parent, config, size)
|
||||||
return SliderPassTemplates.settings_value_slider(size[1], settings_value_height, settings_value_width, true)
|
return SliderPassTemplates.settings_value_slider(size[1], settings_value_height, settings_value_width, true)
|
||||||
end,
|
end,
|
||||||
init = function (parent, widget, entry, callback_name)
|
init = function (parent, widget, entry, callback_name, changed_callback_name)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
local display_name = entry.display_name or Localize("loc_settings_option_unavailable")
|
local display_name = entry.display_name or Managers.localization:localize("loc_settings_option_unavailable")
|
||||||
content.text = display_name
|
content.text = display_name
|
||||||
content.entry = entry
|
content.entry = entry
|
||||||
content.area_length = settings_value_width
|
content.area_length = settings_value_width
|
||||||
|
@ -406,7 +419,11 @@ blueprints.slider = {
|
||||||
local value, value_fraction = get_function(entry)
|
local value, value_fraction = get_function(entry)
|
||||||
content.previous_slider_value = value_fraction
|
content.previous_slider_value = value_fraction
|
||||||
content.slider_value = value_fraction
|
content.slider_value = value_fraction
|
||||||
content.pressed_callback = callback(parent, callback_name, widget, entry)
|
entry.pressed_callback = callback(parent, callback_name, widget, entry)
|
||||||
|
|
||||||
|
entry.changed_callback = function (changed_value)
|
||||||
|
callback(parent, changed_callback_name, widget, entry)()
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
update = function (parent, widget, input_service, dt, t)
|
update = function (parent, widget, input_service, dt, t)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
|
@ -466,7 +483,7 @@ blueprints.slider = {
|
||||||
if focused then
|
if focused then
|
||||||
new_value_fraction = content.slider_value
|
new_value_fraction = content.slider_value
|
||||||
elseif not hotspot.is_hover then
|
elseif not hotspot.is_hover then
|
||||||
content.pressed_callback()
|
entry.pressed_callback()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -507,9 +524,9 @@ blueprints.dropdown = {
|
||||||
|
|
||||||
return DropdownPassTemplates.settings_dropdown(size[1], settings_value_height, settings_value_width, num_visible_options, true)
|
return DropdownPassTemplates.settings_dropdown(size[1], settings_value_height, settings_value_width, num_visible_options, true)
|
||||||
end,
|
end,
|
||||||
init = function (parent, widget, entry, callback_name)
|
init = function (parent, widget, entry, callback_name, changed_callback_name)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
local display_name = entry.display_name or Localize("loc_settings_option_unavailable")
|
local display_name = entry.display_name or Managers.localization:localize("loc_settings_option_unavailable")
|
||||||
content.text = display_name
|
content.text = display_name
|
||||||
content.entry = entry
|
content.entry = entry
|
||||||
local has_options_function = entry.options_function ~= nil
|
local has_options_function = entry.options_function ~= nil
|
||||||
|
@ -551,6 +568,10 @@ blueprints.dropdown = {
|
||||||
local scroll_amount = scroll_length > 0 and (size[2] + spacing) / scroll_length or 0
|
local scroll_amount = scroll_length > 0 and (size[2] + spacing) / scroll_length or 0
|
||||||
content.scroll_amount = scroll_amount
|
content.scroll_amount = scroll_amount
|
||||||
local value = entry.get_function and entry:get_function() or entry.default_value
|
local value = entry.get_function and entry:get_function() or entry.default_value
|
||||||
|
|
||||||
|
entry.changed_callback = function (changed_value)
|
||||||
|
callback(parent, changed_callback_name, widget, entry, changed_value)()
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
update = function (parent, widget, input_service, dt, t)
|
update = function (parent, widget, input_service, dt, t)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
|
@ -592,7 +613,7 @@ blueprints.dropdown = {
|
||||||
|
|
||||||
local preview_option = options_by_value[value]
|
local preview_option = options_by_value[value]
|
||||||
local preview_option_id = preview_option and preview_option.id
|
local preview_option_id = preview_option and preview_option.id
|
||||||
local preview_value = preview_option and preview_option.display_name or Localize("loc_settings_option_unavailable")
|
local preview_value = preview_option and preview_option.display_name or Managers.localization:localize("loc_settings_option_unavailable")
|
||||||
|
|
||||||
content.value_text = preview_value
|
content.value_text = preview_value
|
||||||
|
|
||||||
|
@ -670,18 +691,24 @@ blueprints.dropdown = {
|
||||||
local using_scrollbar = num_visible_options < num_options
|
local using_scrollbar = num_visible_options < num_options
|
||||||
|
|
||||||
for i = start_index, end_index do
|
for i = start_index, end_index do
|
||||||
|
local actual_i = end_index - i + start_index
|
||||||
|
|
||||||
|
if grow_downwards then
|
||||||
|
actual_i = i
|
||||||
|
end
|
||||||
|
|
||||||
local option_text_id = "option_text_" .. option_index
|
local option_text_id = "option_text_" .. option_index
|
||||||
local option_hotspot_id = "option_hotspot_" .. option_index
|
local option_hotspot_id = "option_hotspot_" .. option_index
|
||||||
local outline_style_id = "outline_" .. option_index
|
local outline_style_id = "outline_" .. option_index
|
||||||
local option_hotspot = content[option_hotspot_id]
|
local option_hotspot = content[option_hotspot_id]
|
||||||
option_hovered = option_hovered or option_hotspot.is_hover
|
option_hovered = option_hovered or option_hotspot.is_hover
|
||||||
option_hotspot.is_selected = i == selected_index
|
option_hotspot.is_selected = actual_i == selected_index
|
||||||
local option = options[i]
|
local option = options[actual_i]
|
||||||
|
|
||||||
if not new_value and focused and not using_gamepad and option_hotspot.on_pressed then
|
if not new_value and focused and not using_gamepad and option_hotspot.on_pressed then
|
||||||
option_hotspot.on_pressed = nil
|
option_hotspot.on_pressed = nil
|
||||||
new_value = option.value
|
new_value = option.value
|
||||||
content.selected_index = i
|
content.selected_index = actual_i
|
||||||
end
|
end
|
||||||
|
|
||||||
local option_display_name = option.display_name
|
local option_display_name = option.display_name
|
||||||
|
@ -719,9 +746,9 @@ blueprints.keybind = {
|
||||||
settings_value_height
|
settings_value_height
|
||||||
},
|
},
|
||||||
pass_template = KeybindPassTemplates.settings_keybind(settings_grid_width, settings_value_height, settings_value_width),
|
pass_template = KeybindPassTemplates.settings_keybind(settings_grid_width, settings_value_height, settings_value_width),
|
||||||
init = function (parent, widget, entry, callback_name)
|
init = function (parent, widget, entry, callback_name, changed_callback_name)
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
local display_name = entry.display_name or Localize("loc_settings_option_unavailable")
|
local display_name = entry.display_name or parent:_localize("loc_settings_option_unavailable")
|
||||||
content.text = display_name
|
content.text = display_name
|
||||||
content.entry = entry
|
content.entry = entry
|
||||||
content.key_unassigned_string = Managers.localization:localize("loc_keybind_unassigned")
|
content.key_unassigned_string = Managers.localization:localize("loc_keybind_unassigned")
|
||||||
|
@ -772,8 +799,7 @@ blueprints.description = {
|
||||||
local content = widget.content
|
local content = widget.content
|
||||||
local style = widget.style
|
local style = widget.style
|
||||||
local text_style = style.text
|
local text_style = style.text
|
||||||
local display_name = entry.display_name
|
local display_text = entry.display_name
|
||||||
local display_text = display_name
|
|
||||||
local ui_renderer = parent._ui_renderer
|
local ui_renderer = parent._ui_renderer
|
||||||
local size = content.size
|
local size = content.size
|
||||||
local text_options = UIFonts.get_font_options_by_style(text_style)
|
local text_options = UIFonts.get_font_options_by_style(text_style)
|
||||||
|
|
|
@ -385,7 +385,9 @@ local widget_definitions = {
|
||||||
}, "tooltip", {
|
}, "tooltip", {
|
||||||
visible = false
|
visible = false
|
||||||
}),
|
}),
|
||||||
scrollbar = UIWidget.create_definition(ScrollbarPassTemplates.default_scrollbar, "scrollbar"),
|
scrollbar = UIWidget.create_definition(ScrollbarPassTemplates.default_scrollbar, "scrollbar", {
|
||||||
|
scroll_speed = (dmf:get("dmf_options_scrolling_speed") / 10) or 10
|
||||||
|
}),
|
||||||
grid_mask = UIWidget.create_definition({
|
grid_mask = UIWidget.create_definition({
|
||||||
{
|
{
|
||||||
value = "content/ui/materials/offscreen_masks/ui_overlay_offscreen_vertical_blur",
|
value = "content/ui/materials/offscreen_masks/ui_overlay_offscreen_vertical_blur",
|
||||||
|
@ -406,7 +408,9 @@ local widget_definitions = {
|
||||||
content_id = "hotspot"
|
content_id = "hotspot"
|
||||||
}
|
}
|
||||||
}, "grid_interaction"),
|
}, "grid_interaction"),
|
||||||
settings_scrollbar = UIWidget.create_definition(ScrollbarPassTemplates.default_scrollbar, "settings_scrollbar"),
|
settings_scrollbar = UIWidget.create_definition(ScrollbarPassTemplates.default_scrollbar, "settings_scrollbar", {
|
||||||
|
scroll_speed = (dmf:get("dmf_options_scrolling_speed") / 10) or 10
|
||||||
|
}),
|
||||||
settings_grid_mask = UIWidget.create_definition({
|
settings_grid_mask = UIWidget.create_definition({
|
||||||
{
|
{
|
||||||
value = "content/ui/materials/offscreen_masks/ui_overlay_offscreen_vertical_blur",
|
value = "content/ui/materials/offscreen_masks/ui_overlay_offscreen_vertical_blur",
|
||||||
|
|
Loading…
Add table
Reference in a new issue