Files
PacketsPlease/packet.gd
2025-03-03 12:29:56 +01:00

44 lines
1001 B
GDScript

extends Node3D
signal picked_up
var HIGHLIGHT = false;
var MAC_FROM = "00";
var MAC_TO = "FF";
var IP_FROM = "0.0.0.0";
var IP_TO = "0.0.0.0";
static func create_IP_packet(mac_from, mac_to, ip_from, ip_to):
return null
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
#get_node("InfoCard/MAC_label").text = str("MAC: ", MAC_FROM)
$Mesh.visible = !HIGHLIGHT
$Highlight.visible = HIGHLIGHT
func setColor(color):
var material = $Mesh.get_surface_material(0)
material.albedo_color = color
$Mesh.set_surface_material(0, material)
func add_info_card(card):
card.MAC_FROM = MAC_FROM
card.MAC_TO = MAC_TO
card.IP_FROM = IP_FROM
card.IP_TO = IP_TO
add_child(card)
func copy():
var ret = duplicate()
ret.MAC_FROM = MAC_FROM
ret.MAC_TO = MAC_TO
ret.IP_FROM = IP_FROM
ret.IP_TO = IP_TO
return ret