TShawKiller

  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

4 Neutral

1 Follower

About TShawKiller

  • Rank
    Junior Member
...

Recent Profile Visitors

580 profile views
  1. When modifying mod options that are past the initial scroll view, the changes made to that option are not saved properly. After going through code (in file scripts\screens\redux\modconfigurationscreen.lua), currently it looks like the idx in the spinner's OnChanged call is used to index self.options based on the current widget view index, rather than the absolute index of the option being changed. A fix I did was store the idx from the ApplyDataToWidget function to the widget and load that idx inside widget.opt.spinner.OnChange to store the selected value to the correct mod option index. Below is code a snippet: -- file: scripts\screens\redux\modconfigurationscreen.lua local ModConfigurationScreen = Class(Screen, function(self, modname, client_config) -- ... local function ScrollWidgetsCtor(context, idx) -- ... widget:SetOnGainFocus(function(_) self.options_scroll_list:OnWidgetFocus(widget) widget:ApplyDescription() end) widget.index = idx -- Added widget.opt.spinner.OnChanged = function( _, data ) self.options[widget.index].value = data -- Changed from: self.options[idx].value = data widget.opt.data.selected_value = data widget.opt.spinner:SetHasModification(widget.opt.data.selected_value ~= widget.opt.data.initial_value) widget:ApplyDescription() self:MakeDirty() end widget.focus_forward = widget.opt return widget end local function ApplyDataToWidget(context, widget, data, idx) widget.opt.data = data if data then widget.index = idx -- Added -- ... end -- ... end -- ... end)