[0.18.17] LuaPlayer::set_shortcut_toggled doesnt toggle shortcut

Bugs that are actually features.
Post Reply
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 333
Joined: Tue Jul 08, 2014 10:06 am
Contact:

[0.18.17] LuaPlayer::set_shortcut_toggled doesnt toggle shortcut

Post by LuziferSenpai »

Hey,

so if I run this Command:

Code: Select all

/c
local player = game.get_player( "LuziferSenpai" )
local shortcut = "toggle-equipment-movement-bonus"

if player.is_shortcut_toggled( shortcut ) then
    game.print( "true" )
    player.set_shortcut_toggled( shortcut, false )
else
    game.print( "false" )
    player.set_shortcut_toggled( shortcut, true )
end
It switches between true and false, BUT it doesnt toggle the shortcut so my exoskeleton is still enabled, what shouldnt be.
Same goes with "toggle-personal-roboport".

Greetz,

Luzifer
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: [18.17] LuaPlayer::set_shortcut_toggled

Post by Mylon »

I can confirm. I was investigating using the roborport toggle as an option to make Klonan's Construction Drones mod better but I could not enable the Roboport toggle. Thus I was unable to make it useful as an option for controlling construction drones.

Idea:
Toggle mouseover displays some additional information, such as, "You do not have a personal roboport equipped." or "You do not have construction robots to deploy." or, "This toggle is controlled by script."

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.17] LuaPlayer::set_shortcut_toggled doesnt toggle shortcut

Post by Rseding91 »

Thanks for the report. Looking into this that only does anything for Lua shortcuts. The alt mode, equipment movement, personal requests, and personal roboport are not controlled through that.

All of those 4 shortcuts are controlled directly on what they modify: alt mode, the boolean on the equipment grid, and the booleans on the entity.

For example:

alt mode: https://lua-api.factorio.com/latest/Lua ... w_settings -> https://lua-api.factorio.com/latest/Con ... ewSettings
movement bonus: https://lua-api.factorio.com/latest/Lua ... ment_bonus
enable personal roboport: https://lua-api.factorio.com/latest/Lua ... ing_robots
enable personal logistics: https://lua-api.factorio.com/latest/Lua ... istic_slot
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”