TimeButtons


TimeButtons: Speed x1, Speed x2, Speed x5, Speed x10, Speed x20

Utilities
3 years ago
0.16 - 1.1
7.55K

i Save Settings

4 years ago

I'd like to be able to save my time button settings, so I don't have to re-enter it each time I play. Perhaps settings in the mod settings menu for this.

I have an idea for this.
Input box for amount of buttons. Max the input allowed at the max buttons allowed.
Input box below that, comma separated list of button names.
Input box below that, comma separated list of times for that button.

E.G.

5
Slowest,Slow,Normal,Fast,Fastest
0.05,0.5,1,5,10

This would give me 5 buttons, the first of which named Slowest, with a speed of 0.05.

You can also do a single input, including the name and speed.

Slowest:0.05,Slow:0.5,Normal:1,Fast:5,Fastest:10

Here's something you can use for reference from my mod.

if START_EQUIP ~= "" then
    local items = split(START_EQUIP,",")
    for no, item_str in pairs(items) do
        local info = split(item_str,":")
        if game.item_prototypes[info[1]] then
            table.insert(kit, {name=info[1],count=tonumber(info[2])})
        end
    end
end

New response