A selected thread glows in the selection colour, like a selected card
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3d51c8c8ba
commit
f90427d748
2 changed files with 5 additions and 2 deletions
|
|
@ -63,13 +63,16 @@ static func coarse(rid: RID, pts: PackedVector2Array, color: Color, width: float
|
|||
|
||||
## An unlit thread (as PipeLayer._draw_pipe draws it), in its own canvas item.
|
||||
## `own` is the thread's own colour ("" = the theme's THREAD).
|
||||
func add_pipe(pts: PackedVector2Array, hovered: bool, own: String = "") -> void:
|
||||
func add_pipe(pts: PackedVector2Array, hovered: bool, own: String = "", selected: bool = false) -> void:
|
||||
var rid := item()
|
||||
var color := Color.from_string(own, Style.THREAD) if own != "" else Style.THREAD
|
||||
var dark := color.darkened(0.6) if own != "" else Style.THREAD_DARK
|
||||
if far:
|
||||
coarse(rid, pts, color, 10.0)
|
||||
return
|
||||
if selected: # the glow selected cards have (TableCardSkin)
|
||||
line(rid, pts, Color(Style.SELECTED, 0.3), 26.0)
|
||||
line(rid, pts, Style.SELECTED, 15.0)
|
||||
if ThreadStrip.active:
|
||||
ThreadStrip.active.add_to(rid, pts, color.lightened(0.35) if hovered else color, dark)
|
||||
ThreadStrip.active.add_pins(item(), pts)
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ func _draw() -> void:
|
|||
elif rerouted:
|
||||
_batch.add_bundle(pts)
|
||||
else:
|
||||
_batch.add_pipe(pts, build and (key == hover_key or key == select_key), str(e.pipe_color.get(to, "")))
|
||||
_batch.add_pipe(pts, build and (key == hover_key or key == select_key), str(e.pipe_color.get(to, "")), build and key == select_key)
|
||||
if not is_ref and not rerouted:
|
||||
var tag := RulesView.pipe_label(e, to, main.data, plain)
|
||||
if tag != "":
|
||||
|
|
|
|||
Loading…
Reference in a new issue