mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 05:42:35 +00:00
Fixed using File.exists? instead of File.exist?, updated Randomizer to PowerPlay (with ducks), misc. tweaking.
This commit is contained in:
@@ -42,13 +42,13 @@ module TAC
|
|||||||
end
|
end
|
||||||
|
|
||||||
def move_config(old_name, new_name)
|
def move_config(old_name, new_name)
|
||||||
if not File.exists?("#{TAC::CONFIGS_PATH}/#{old_name}.json") or
|
if not File.exist?("#{TAC::CONFIGS_PATH}/#{old_name}.json") or
|
||||||
File.directory?("#{TAC::CONFIGS_PATH}/#{old_name}.json")
|
File.directory?("#{TAC::CONFIGS_PATH}/#{old_name}.json")
|
||||||
# move_config: Can not move config file "#{old_name}" does not exist!
|
# move_config: Can not move config file "#{old_name}" does not exist!
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
if File.exists?("#{TAC::CONFIGS_PATH}/#{new_name}.json") &&
|
if File.exist?("#{TAC::CONFIGS_PATH}/#{new_name}.json") &&
|
||||||
!File.directory?("#{TAC::CONFIGS_PATH}/#{old_name}.json")
|
!File.directory?("#{TAC::CONFIGS_PATH}/#{old_name}.json")
|
||||||
# move_config: Config file "#{new_name}" already exist!
|
# move_config: Config file "#{new_name}" already exist!
|
||||||
return false
|
return false
|
||||||
@@ -61,7 +61,7 @@ module TAC
|
|||||||
end
|
end
|
||||||
|
|
||||||
def delete_config(config_name)
|
def delete_config(config_name)
|
||||||
FileUtils.rm("#{TAC::CONFIGS_PATH}/#{config_name}.json") if File.exists?("#{TAC::CONFIGS_PATH}/#{config_name}.json")
|
FileUtils.rm("#{TAC::CONFIGS_PATH}/#{config_name}.json") if File.exist?("#{TAC::CONFIGS_PATH}/#{config_name}.json")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,14 +23,22 @@ module TAC
|
|||||||
when 2, 5
|
when 2, 5
|
||||||
#Blue and Red: Center
|
#Blue and Red: Center
|
||||||
|
|
||||||
@ducks << Ducky.new(window: window, alliance: :blue, slot: 2, speed: 512, die_size: @size)
|
@ducks << Ducky.new(window: window, alliance: :blue, slot: 1, speed: 512, die_size: @size)
|
||||||
@ducks << Ducky.new(window: window, alliance: :red, slot: 2, speed: 512, die_size: @size)
|
@ducks << Ducky.new(window: window, alliance: :blue, slot: 3, speed: 512, die_size: @size)
|
||||||
|
|
||||||
|
@ducks << Ducky.new(window: window, alliance: :red, slot: 3, speed: 512, die_size: @size)
|
||||||
|
@ducks << Ducky.new(window: window, alliance: :red, slot: 1, speed: 512, die_size: @size)
|
||||||
when 3, 6
|
when 3, 6
|
||||||
# Blue: Left
|
# Blue: Left
|
||||||
# Red: Right
|
# Red: Right
|
||||||
|
|
||||||
@ducks << Ducky.new(window: window, alliance: :blue, slot: 1, speed: 512, die_size: @size)
|
@ducks << Ducky.new(window: window, alliance: :blue, slot: 1, speed: 512, die_size: @size)
|
||||||
|
@ducks << Ducky.new(window: window, alliance: :blue, slot: 2, speed: 512, die_size: @size)
|
||||||
|
@ducks << Ducky.new(window: window, alliance: :blue, slot: 3, speed: 512, die_size: @size)
|
||||||
|
|
||||||
@ducks << Ducky.new(window: window, alliance: :red, slot: 3, speed: 512, die_size: @size)
|
@ducks << Ducky.new(window: window, alliance: :red, slot: 3, speed: 512, die_size: @size)
|
||||||
|
@ducks << Ducky.new(window: window, alliance: :red, slot: 2, speed: 512, die_size: @size)
|
||||||
|
@ducks << Ducky.new(window: window, alliance: :red, slot: 1, speed: 512, die_size: @size)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ robot.forward 100
|
|||||||
robot.turn -90
|
robot.turn -90
|
||||||
robot.forward 100"
|
robot.forward 100"
|
||||||
|
|
||||||
source_code = File.read(SOURCE_FILE_PATH) if File.exists?(SOURCE_FILE_PATH)
|
source_code = File.read(SOURCE_FILE_PATH) if File.exist?(SOURCE_FILE_PATH)
|
||||||
|
|
||||||
@source_code = edit_box source_code, width: 1.0, height: 1.0
|
@source_code = edit_box source_code, width: 1.0, height: 1.0
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -32,11 +32,7 @@ module TAC
|
|||||||
end
|
end
|
||||||
|
|
||||||
def needs_redraw?
|
def needs_redraw?
|
||||||
if current_state.is_a?(Editor)
|
states.any?(&:needs_repaint?) || @notification_manager.instance_variable_get(:@drivers).size.positive?
|
||||||
current_state.needs_repaint? || @notification_manager.instance_variable_get(:@drivers).size.positive?
|
|
||||||
else
|
|
||||||
true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def toast(title, message = nil)
|
def toast(title, message = nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user