Remove the one-way ore API superseded by the transfer menu
The loose end from #24. withdraw_to_fleet, unload_into_building and deliver_cargo were the old one-way moves behind "Load ore" and "Store ore here"; every one of them is a special case of transfer_to_building / transfer_to_fleet, and none had a caller left outside tests. The cargo_delivered signal had no listeners at all. Not just tidying: unload_into_building routed through deposit_to_building, which does NOT special-case the mothership - it writes b.stock, while building_holdings() returns `rocks` for a mothership and ignores stock entirely. So unload_into_building( mothership_id) would have parked ore in a field nothing reads, with no error. Nothing called it that way, but it is a plausibly-named function sitting there to be reached for later. transfer_to_building handles it. CARGO_LOAD_BATCH stays - the transfer menu's batch buttons use it; only its role as withdraw_to_fleet's default argument is gone. The #24 note expected folding these in to be costly for test_cargo_readout, which places no buildings. It is not: the transfer primitives work off GameState records rather than spawned nodes, so a single add_building() in setup is enough and it stays a display test. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
fe1c721d64
commit
b6427b080d
27 changed files with 1085 additions and 275 deletions
|
|
@ -16,6 +16,10 @@ enum Icon {
|
|||
# and the command centre sharing a folded-map glyph and neither of them
|
||||
# looking anything like the structure they build.
|
||||
MOTHERSHIP, CRAFTER, COMMAND_CENTER, EXTRACTOR, TRANSPORT_HUB, SHIP_LAB,
|
||||
# Moving ore between the fleet and a building (#24). Two arrows passing
|
||||
# each other: the single up/down arrows already mean "load" and "store"
|
||||
# one way each, and this button is the place where both live.
|
||||
TRANSFER,
|
||||
}
|
||||
|
||||
# Size the glyphs were originally drawn against. Every glyph dimension is
|
||||
|
|
@ -147,6 +151,8 @@ func _draw() -> void:
|
|||
_draw_transport_hub_icon(center, pulse, s)
|
||||
Icon.SHIP_LAB:
|
||||
_draw_ship_lab_icon(center, pulse, s)
|
||||
Icon.TRANSFER:
|
||||
_draw_transfer_icon(center, pulse, s)
|
||||
|
||||
|
||||
func _draw_close(center: Vector2, pulse: float, s: float) -> void:
|
||||
|
|
@ -172,6 +178,27 @@ func _draw_arrow(center: Vector2, pulse: float, direction: float, s: float) -> v
|
|||
NeonDraw.draw_glowing_line(self, tip, tip + Vector2(r * 0.7, -r * 0.8 * direction), _active_color(), pulse, 0.5 * s, core_color)
|
||||
|
||||
|
||||
func _draw_transfer_icon(center: Vector2, pulse: float, s: float) -> void:
|
||||
# Two shafts side by side pointing opposite ways. Drawn as a pair rather
|
||||
# than as one double-headed arrow because the button's whole job is that
|
||||
# ore moves BOTH ways here, and a double-headed arrow reads as one thing
|
||||
# sliding back and forth.
|
||||
var r: float = 10.0 * s
|
||||
var gap: float = 7.0 * s
|
||||
for side in [-1.0, 1.0]:
|
||||
# Left shaft points up (into the fleet), right shaft points down.
|
||||
var direction: float = side
|
||||
var x: float = gap * side
|
||||
var tip: Vector2 = center + Vector2(x, r * direction)
|
||||
var tail: Vector2 = center + Vector2(x, -r * direction)
|
||||
NeonDraw.draw_glowing_line(self, tail, tip, _active_color(), pulse, 0.42 * s, core_color)
|
||||
var head: float = 5.0 * s
|
||||
NeonDraw.draw_glowing_line(self, tip, tip + Vector2(-head, -head * direction),
|
||||
_active_color(), pulse, 0.42 * s, core_color)
|
||||
NeonDraw.draw_glowing_line(self, tip, tip + Vector2(head, -head * direction),
|
||||
_active_color(), pulse, 0.42 * s, core_color)
|
||||
|
||||
|
||||
func _draw_build(center: Vector2, pulse: float, s: float) -> void:
|
||||
# A plus inside a frame - "add a structure".
|
||||
var r: float = 11.0 * s
|
||||
|
|
|
|||
Loading…
Reference in a new issue