This commit is contained in:
Page Asgardius 2024-02-29 18:22:06 -07:00
parent e4cd54b2a9
commit 44f4fef3cf
3 changed files with 96 additions and 80 deletions

View file

@ -9,6 +9,8 @@ var cf1
var cf2 var cf2
var cf3 var cf3
var cf4 var cf4
var cff
var cnf
var focus1 var focus1
var focus2 var focus2
var focus3 var focus3
@ -34,6 +36,8 @@ func _ready():
focus2 = $Topleft/Character2/ColorRect2 focus2 = $Topleft/Character2/ColorRect2
focus3 = $Topleft/Character3/ColorRect2 focus3 = $Topleft/Character3/ColorRect2
focus4 = $Topleft/Character4/ColorRect2 focus4 = $Topleft/Character4/ColorRect2
cnf = $Topmini/VBoxContainer/HBoxContainer/Label
cff = $Topmini/TextureRect
topleft.visible = false topleft.visible = false
topleftbg.visible = false topleftbg.visible = false
if Global.mangohud: if Global.mangohud:
@ -56,93 +60,102 @@ func _input(event):
topleftbg.visible = false topleftbg.visible = false
_charrefresh() _charrefresh()
func _charrefresh(): func _charrefresh():
if Global.debug: if topleft.visible:
if Global.dparty[0] != null: if Global.debug:
cn1.set_text(Global.pcnames[Global.dparty[0]]) if Global.dparty[0] != null:
cf1.texture = load(Global.hudfaces[Global.dparty[0]]) cn1.set_text(Global.pcnames[Global.dparty[0]])
if Global.dcpchar == 0: cf1.texture = load(Global.hudfaces[Global.dparty[0]])
focus1.set_color(Color(0, 0, 1, 1)) if Global.dcpchar == 0:
focus1.set_color(Color(0, 0, 1, 1))
else:
focus1.set_color(Color(1, 1, 1, 1))
else: else:
cn1.set_text("")
cf1.texture = null
focus1.set_color(Color(1, 1, 1, 1)) focus1.set_color(Color(1, 1, 1, 1))
else: if Global.dparty[1] != null:
cn1.set_text("") cn2.set_text(Global.pcnames[Global.dparty[1]])
cf1.texture = null cf2.texture = load(Global.hudfaces[Global.dparty[1]])
focus1.set_color(Color(1, 1, 1, 1)) if Global.dcpchar == 1:
if Global.dparty[1] != null: focus2.set_color(Color(0, 0, 1, 1))
cn2.set_text(Global.pcnames[Global.dparty[1]]) else:
cf2.texture = load(Global.hudfaces[Global.dparty[1]]) focus2.set_color(Color(1, 1, 1, 1))
if Global.dcpchar == 1:
focus2.set_color(Color(0, 0, 1, 1))
else: else:
cn2.set_text("")
cf2.texture = null
focus2.set_color(Color(1, 1, 1, 1)) focus2.set_color(Color(1, 1, 1, 1))
else: if Global.dparty[2] != null:
cn2.set_text("") cn3.set_text(Global.pcnames[Global.dparty[2]])
cf2.texture = null cf3.texture = load(Global.hudfaces[Global.dparty[2]])
focus2.set_color(Color(1, 1, 1, 1)) if Global.dcpchar == 2:
if Global.dparty[2] != null: focus3.set_color(Color(0, 0, 1, 1))
cn3.set_text(Global.pcnames[Global.dparty[2]]) else:
cf3.texture = load(Global.hudfaces[Global.dparty[2]]) focus3.set_color(Color(1, 1, 1, 1))
if Global.dcpchar == 2:
focus3.set_color(Color(0, 0, 1, 1))
else: else:
cn3.set_text("")
cf3.texture = null
focus3.set_color(Color(1, 1, 1, 1)) focus3.set_color(Color(1, 1, 1, 1))
else: if Global.dparty[3] != null:
cn3.set_text("") cn4.set_text(Global.pcnames[Global.dparty[3]])
cf3.texture = null cf4.texture = load(Global.hudfaces[Global.dparty[3]])
focus3.set_color(Color(1, 1, 1, 1)) if Global.dcpchar == 3:
if Global.dparty[3] != null: focus4.set_color(Color(0, 0, 1, 1))
cn4.set_text(Global.pcnames[Global.dparty[3]]) else:
cf4.texture = load(Global.hudfaces[Global.dparty[3]]) focus4.set_color(Color(1, 1, 1, 1))
if Global.dcpchar == 3:
focus4.set_color(Color(0, 0, 1, 1))
else: else:
cn4.set_text("")
cf4.texture = null
focus4.set_color(Color(1, 1, 1, 1)) focus4.set_color(Color(1, 1, 1, 1))
else: else:
cn4.set_text("") if Global.party[0] != null:
cf4.texture = null cn1.set_text(Global.pcnames[Global.party[0]])
focus4.set_color(Color(1, 1, 1, 1)) cf1.texture = load(Global.hudfaces[Global.party[0]])
if Global.dcpchar == 0:
focus1.set_color(Color(0, 0, 1, 1))
else:
focus1.set_color(Color(1, 1, 1, 1))
else:
cn1.set_text("")
cf1.texture = null
focus1.set_color(Color(1, 1, 1, 1))
if Global.party[1] != null:
cn2.set_text(Global.pcnames[Global.party[1]])
cf2.texture = load(Global.hudfaces[Global.party[1]])
if Global.dcpchar == 1:
focus2.set_color(Color(0, 0, 1, 1))
else:
focus2.set_color(Color(1, 1, 1, 1))
else:
cn2.set_text("")
cf2.texture = null
focus2.set_color(Color(1, 1, 1, 1))
if Global.party[2] != null:
cn3.set_text(Global.pcnames[Global.party[0]])
cf3.texture = load(Global.hudfaces[Global.party[0]])
if Global.dcpchar == 2:
focus3.set_color(Color(0, 0, 1, 1))
else:
focus3.set_color(Color(1, 1, 1, 1))
else:
cn3.set_text("")
cf3.texture = null
focus3.set_color(Color(1, 1, 1, 1))
if Global.party[3] != null:
cn4.set_text(Global.pcnames[Global.party[3]])
cf4.texture = load(Global.hudfaces[Global.party[3]])
if Global.dcpchar == 3:
focus4.set_color(Color(0, 0, 1, 1))
else:
focus4.set_color(Color(1, 1, 1, 1))
else:
cn4.set_text("")
cf4.texture = null
focus4.set_color(Color(1, 1, 1, 1))
else: else:
if Global.party[0] != null: if Global.debug:
cn1.set_text(Global.pcnames[Global.party[0]]) cnf.set_text(Global.pcnames[Global.dparty[Global.dcpchar]])
cf1.texture = load(Global.hudfaces[Global.party[0]]) cff.texture = load(Global.hudfaces[Global.dparty[Global.dcpchar]])
if Global.dcpchar == 0:
focus1.set_color(Color(0, 0, 1, 1))
else:
focus1.set_color(Color(1, 1, 1, 1))
else: else:
cn1.set_text("") cnf.set_text(Global.pcnames[Global.party[Global.cpchar]])
cf1.texture = null cff.texture = load(Global.hudfaces[Global.party[Global.cpchar]])
focus1.set_color(Color(1, 1, 1, 1))
if Global.party[1] != null:
cn2.set_text(Global.pcnames[Global.party[1]])
cf2.texture = load(Global.hudfaces[Global.party[1]])
if Global.dcpchar == 1:
focus2.set_color(Color(0, 0, 1, 1))
else:
focus2.set_color(Color(1, 1, 1, 1))
else:
cn2.set_text("")
cf2.texture = null
focus2.set_color(Color(1, 1, 1, 1))
if Global.party[2] != null:
cn3.set_text(Global.pcnames[Global.party[0]])
cf3.texture = load(Global.hudfaces[Global.party[0]])
if Global.dcpchar == 2:
focus3.set_color(Color(0, 0, 1, 1))
else:
focus3.set_color(Color(1, 1, 1, 1))
else:
cn3.set_text("")
cf3.texture = null
focus3.set_color(Color(1, 1, 1, 1))
if Global.party[3] != null:
cn4.set_text(Global.pcnames[Global.party[3]])
cf4.texture = load(Global.hudfaces[Global.party[3]])
if Global.dcpchar == 3:
focus4.set_color(Color(0, 0, 1, 1))
else:
focus4.set_color(Color(1, 1, 1, 1))
else:
cn4.set_text("")
cf4.texture = null
focus4.set_color(Color(1, 1, 1, 1))

View file

@ -116,14 +116,17 @@ horizontal_alignment = 2
[node name="ColorRect2" type="ColorRect" parent="Topmini"] [node name="ColorRect2" type="ColorRect" parent="Topmini"]
custom_minimum_size = Vector2(12, 64) custom_minimum_size = Vector2(12, 64)
layout_mode = 2 layout_mode = 2
color = Color(0, 0, 1, 1)
[node name="Topleftbg" type="ColorRect" parent="."] [node name="Topleftbg" type="ColorRect" parent="."]
visible = false
layout_mode = 0 layout_mode = 0
offset_right = 377.0 offset_right = 377.0
offset_bottom = 476.0 offset_bottom = 476.0
color = Color(0.254902, 0.254902, 0.254902, 1) color = Color(0.254902, 0.254902, 0.254902, 1)
[node name="Topleft" type="VBoxContainer" parent="."] [node name="Topleft" type="VBoxContainer" parent="."]
visible = false
layout_mode = 0 layout_mode = 0
offset_right = 377.0 offset_right = 377.0
offset_bottom = 476.0 offset_bottom = 476.0

View file

@ -23,7 +23,6 @@ func _physics_process(delta):
#var velocity = Vector2.ZERO #var velocity = Vector2.ZERO
if Global.live == 1: if Global.live == 1:
velocity = (Vector2.RIGHT.rotated(rotation) * 500 * Global.xm * delta)-Vector2.UP.rotated(rotation) * 500 * Global.ym * delta velocity = (Vector2.RIGHT.rotated(rotation) * 500 * Global.xm * delta)-Vector2.UP.rotated(rotation) * 500 * Global.ym * delta
_charswitch()
#origmpos = get_viewport().get_mouse_position() #origmpos = get_viewport().get_mouse_position()
#if Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) != 0: #if Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) != 0:
# velocity = Vector2.UP.rotated(rotation) * -400 * Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) # velocity = Vector2.UP.rotated(rotation) * -400 * Input.get_joy_axis(0,JOY_AXIS_LEFT_Y)
@ -58,6 +57,7 @@ func _physics_process(delta):
func _input(event): func _input(event):
if Global.live == 1: if Global.live == 1:
_charswitch()
if Input.is_action_just_pressed("shoot") && !bpress && Global.live == 1: if Input.is_action_just_pressed("shoot") && !bpress && Global.live == 1:
bpress = true bpress = true
var bullet var bullet