mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-15 15:52:34 +00:00
Added Settings
This commit is contained in:
@@ -7,12 +7,42 @@ class IMICRTS
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
|
||||
label "Settings", text_size: 78, margin: 20
|
||||
label "Nothing to see here, move along."
|
||||
|
||||
stack(width: 1.0) do
|
||||
background 0xff030303
|
||||
|
||||
label "Debug Settings"
|
||||
@debug_mode = check_box "Debug Mode", checked: Setting.enabled?(:debug_mode)
|
||||
@debug_info_bar = check_box "Show Debug Info Bar", checked: Setting.enabled?(:debug_info_bar)
|
||||
@debug_pathfinding = check_box "Debug Pathfinding", checked: Setting.enabled?(:debug_pathfinding)
|
||||
@debug_pathfinding_allow_diagonal = check_box "Allow Diagonal Paths", checked: Setting.enabled?(:debug_pathfinding_allow_diagonal)
|
||||
end
|
||||
|
||||
button("Save and Close", width: 1.0, margin_top: 20) do
|
||||
if valid_options?
|
||||
save_settings
|
||||
|
||||
push_state(MainMenu)
|
||||
end
|
||||
end
|
||||
|
||||
button("Back", width: 1.0, margin_top: 20) do
|
||||
push_state(MainMenu)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def valid_options?
|
||||
true
|
||||
end
|
||||
|
||||
def save_settings
|
||||
Setting.set(:debug_mode, @debug_mode.value)
|
||||
Setting.set(:debug_info_bar, @debug_info_bar.value)
|
||||
Setting.set(:debug_pathfinding, @debug_pathfinding.value)
|
||||
Setting.set(:debug_pathfinding_allow_diagonal, @debug_pathfinding_allow_diagonal.value)
|
||||
|
||||
Setting.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -18,7 +18,7 @@ class IMICRTS
|
||||
stack do
|
||||
case elements[index]
|
||||
when :edit_line
|
||||
edit_line "Novice"
|
||||
edit_line Setting.get(:player_name)
|
||||
when :button
|
||||
button item
|
||||
when :toggle_button
|
||||
|
||||
Reference in New Issue
Block a user