Renamed a bunch of player stuff to pawn stuff and implemented extensive work on getting single-address 'netplay' code working. Not sure if I've created issues with single player but in theory it should all transfer across as if the player is simply always the host.
This commit is contained in:
@@ -2,7 +2,10 @@ class_name PawnDisplay extends Panel
|
||||
|
||||
@onready var pawn_name : Label = %PawnName
|
||||
@onready var trap_container : HBoxContainer = %TrapContainer
|
||||
@onready var portrait : TextureRect = $Portrait
|
||||
@onready var portrait_blinder : TextureRect = $PortraitBlinder
|
||||
var traps : Array = []
|
||||
var swap_portrait_tween : Tween = null
|
||||
|
||||
func _ready() -> void:
|
||||
for child in trap_container.get_children():
|
||||
@@ -16,5 +19,21 @@ func set_traps(trap_list : Array[TrapSet]) -> void:
|
||||
trap.setup(trap_list[tcount].type, trap_list[tcount].qty)
|
||||
tcount+=1
|
||||
|
||||
func set_portrait(picture : Texture2D) -> void:
|
||||
if swap_portrait_tween != null and swap_portrait_tween.is_running():
|
||||
swap_portrait_tween.stop()
|
||||
swap_portrait_tween = create_tween()
|
||||
|
||||
swap_portrait_tween.tween_property(portrait_blinder, "visible", true, 0)
|
||||
swap_portrait_tween.tween_method(tv_blur, 1.0, 0.0, .1)
|
||||
swap_portrait_tween.tween_property(portrait, "texture", picture, 0)
|
||||
swap_portrait_tween.tween_method(tv_blur, 0.0, 1.0, .1)
|
||||
swap_portrait_tween.tween_property(portrait_blinder, "visible", false, 0)
|
||||
portrait.texture = picture
|
||||
|
||||
func tv_blur(amount : float) -> void:
|
||||
var blinder_mat : ShaderMaterial = portrait_blinder.material
|
||||
blinder_mat.set_shader_parameter("opacity_limit", amount)
|
||||
|
||||
func set_pawn_name(name : String) -> void:
|
||||
pawn_name.text = name
|
||||
|
||||
Reference in New Issue
Block a user