Not sure whether to file this under Bugs or Requests, but I'm working on a mod that will enable the visualizer on startup (when a player loads into an new or existing game, or joins a multiplayer game), and I tried creating a function with the below in control.lua:
local player = game.players[event.player_index]
if script.active_mods["belt-visualizer"] then
if player.mod_settings['belt-visualizer-default'].value then
player.set_shortcut_toggled("bv-toggle-hover", true)
end
end
And running it during on_player_joined_game, on_cutscene_cancelled, and on_player_created, and it technically works, the toggle looks enabled, but there's no visualizer, until untoggling, and retoggling it again, which kinda defeats the purpose.
Is this a problem with my implementation, or something not expected by this mod's control.lua? Alternatively, if this can't be fixed, then could I request a player setting to start with belt visualizer enabled?