1 Commits

Author SHA1 Message Date
be1c1f4989 Make field planner request recalulate on mouse move 2023-02-06 15:10:30 -06:00

View File

@@ -80,12 +80,15 @@ module TAC
@segment_thickness = 2 @segment_thickness = 2
@font = CyberarmEngine::Text.new(font: THEME_BOLD_FONT, size: 18, border: true, static: true) @font = CyberarmEngine::Text.new(font: THEME_BOLD_FONT, size: 18, border: true, static: true)
@last_mouse_position = CyberarmEngine::Vector.new(window.mouse_x, window.mouse_y)
measure_path measure_path
refresh_panel refresh_panel
end end
def draw def draw
super
@field.draw @field.draw
display_path display_path
@@ -105,15 +108,19 @@ module TAC
@font.width + 12, @font.width + 12,
@font.height + 12, @font.height + 12,
0xaa_000000, 0xaa_000000,
100_000) 100_000
)
@font.draw
@font.draw
end end
end end
def update def update
super
current_state.request_repaint if window.mouse_x != @last_mouse_position.x || window.mouse_y != @last_mouse_position.y
@last_mouse_position = CyberarmEngine::Vector.new(window.mouse_x, window.mouse_y)
@field.update @field.update
measure_path measure_path