This commit is contained in:
@@ -84,26 +84,26 @@ function UI.create_action_item(label, action)
|
||||
}
|
||||
end
|
||||
|
||||
function UI.draw_desition_selector(desitions, selected_desition_index)
|
||||
function UI.draw_decision_selector(decisions, selected_decision_index)
|
||||
local bar_height = 16
|
||||
local bar_y = Config.screen.height - bar_height
|
||||
rect(0, bar_y, Config.screen.width, bar_height, Config.colors.dark_grey)
|
||||
if #desitions > 0 then
|
||||
local selected_desition = desitions[selected_desition_index]
|
||||
local desition_label = selected_desition.label
|
||||
local text_width = #desition_label * 4 local text_y = bar_y + 4
|
||||
if #decisions > 0 then
|
||||
local selected_decision = decisions[selected_decision_index]
|
||||
local decision_label = selected_decision.label
|
||||
local text_width = #decision_label * 4 local text_y = bar_y + 4
|
||||
local text_x = (Config.screen.width - text_width) / 2
|
||||
Print.text("<", 2, text_y, Config.colors.green)
|
||||
Print.text(desition_label, text_x, text_y, Config.colors.item) Print.text(">", Config.screen.width - 6, text_y, Config.colors.green) end
|
||||
Print.text(decision_label, text_x, text_y, Config.colors.item) Print.text(">", Config.screen.width - 6, text_y, Config.colors.green) end
|
||||
end
|
||||
|
||||
function UI.update_desition_selector(desitions, selected_desition_index)
|
||||
function UI.update_decision_selector(decisions, selected_decision_index)
|
||||
if Input.left() then
|
||||
Audio.sfx_beep()
|
||||
selected_desition_index = Util.safeindex(desitions, selected_desition_index - 1)
|
||||
selected_decision_index = Util.safeindex(decisions, selected_decision_index - 1)
|
||||
elseif Input.right() then
|
||||
Audio.sfx_beep()
|
||||
selected_desition_index = Util.safeindex(desitions, selected_desition_index + 1)
|
||||
selected_decision_index = Util.safeindex(decisions, selected_decision_index + 1)
|
||||
end
|
||||
return selected_desition_index
|
||||
return selected_decision_index
|
||||
end
|
||||
Reference in New Issue
Block a user