Add support for many options

This commit is contained in:
Rin 2021-08-21 17:24:52 +01:00
parent 3a67e15966
commit 45b247939e
2 changed files with 25 additions and 2 deletions

View File

@ -59,9 +59,23 @@ function GamemodeConfigScene:render()
love.graphics.printf(setting, 100 + 110 * j, 100 + i * 20, 100, "center")
end
else
love.graphics.setColor(1, 1, 1, 1)
love.graphics.printf(option[3][new_config[option[1]]], -- what an indexer
local curr_index = new_config[option[1]]
local prev_index = Mod1(curr_index-1, #option[3])
local next_index = Mod1(curr_index+1, #option[3])
love.graphics.setColor(1, 1, 1, 0.5)
love.graphics.printf(option[3][prev_index],
100 + 110 * 1, 100 + i * 20, 100, 'center')
love.graphics.setColor(1, 1, 1, 1)
love.graphics.printf("< " .. option[3][curr_index] .. " >",
100 + 110 * 2.5, 100 + i * 20, 100, 'center')
love.graphics.setColor(1, 1, 1, 0.5)
love.graphics.printf(option[3][next_index],
100 + 110 * 4, 100 + i * 20, 100, 'center')
love.graphics.setColor(1, 1, 1, 1)
end
end
end

View File

@ -254,6 +254,15 @@ function MarathonA1Game:provideSettings()
{"allowHardDrop", "Allow hard drop", {"No", "Yes"}}
}
--[[
local opts = {}
for i=1, 10 do
opts[i] = i
end
table.insert(t, {"manyOptions", "Many options", opts})
]]
return t
end