Skip to content

Commit 180c915

Browse files
committed
refactor: move some files, minor changes to code style
1 parent 8d0783a commit 180c915

16 files changed

+76
-94
lines changed

maps/house/wand_pedestal_interaction.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static var _correct_pedestals: = {}
2222
## Specify a timeline that should be run if an item is already placed on the pedestal.
2323
@export var wand_placed_timeline: DialogicTimeline
2424

25-
## Specify which wand colour this pedestal expects.
25+
## Specify which wand color this pedestal expects.
2626
@export_enum("Red", "Blue", "Green") var pedestal_requirement: = "Red"
2727

2828
## Keep track of the id of the item currently placed on the pedestal, from Inventory.ItemTypes enum.

src/combat/ui/battler_entry/ui_energy_point.gd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const SELECT_TIME: = 0.2
99
## The time required to fade in or out the filled point.
1010
const FADE_TIME: = 0.3
1111

12-
var _colour_tween: Tween = null
12+
var _color_tween: Tween = null
1313
var _offset_tween: Tween = null
1414

1515
@onready var _fill: = $EnergyPoint/Fill as TextureRect
@@ -21,18 +21,18 @@ var _offset_tween: Tween = null
2121

2222
## Animate the point fill texture to fully opaque.
2323
func appear() -> void:
24-
if _colour_tween:
25-
_colour_tween.kill()
26-
_colour_tween = create_tween()
27-
_colour_tween.tween_property(_fill, "modulate", Color.WHITE, FADE_TIME)
24+
if _color_tween:
25+
_color_tween.kill()
26+
_color_tween = create_tween()
27+
_color_tween.tween_property(_fill, "modulate", Color.WHITE, FADE_TIME)
2828

2929

3030
## Animate the point fill texture to mostly-transparent.
3131
func disappear() -> void:
32-
if _colour_tween:
33-
_colour_tween.kill()
34-
_colour_tween = create_tween()
35-
_colour_tween.tween_property(_fill, "modulate", _color_transparent, FADE_TIME)
32+
if _color_tween:
33+
_color_tween.kill()
34+
_color_tween = create_tween()
35+
_color_tween.tween_property(_fill, "modulate", _color_transparent, FADE_TIME)
3636

3737

3838
func select() -> void:

src/combat/ui/battler_entry/ui_life_bar.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var _tween: Tween = null
3737

3838
func _ready() -> void:
3939
value_changed.connect(
40-
func(new_value: float):
40+
func _on_value_changed(new_value: float):
4141
_value_label.text = str(int(new_value))
4242
)
4343

src/combat/ui/effect_labels/ui_damage_label.gd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ class_name UIDamageLabel extends Marker2D
1111
## <br><br><b>Note:</b> fade_time must be less than [member move_time].
1212
@export var fade_time: = 0.2
1313

14-
## Label colour when [member amount] is >= 0.
14+
## Label color when [member amount] is >= 0.
1515
@export var color_damage := Color("#b0305c")
1616

17-
## Label outline colour when [member amount] is >= 0.
17+
## Label outline color when [member amount] is >= 0.
1818
@export var color_damage_outline := Color("#b0305c")
1919

20-
## Label colour when [member amount] is < 0.
20+
## Label color when [member amount] is < 0.
2121
@export var color_heal := Color("#3ca370")
2222

23-
## Label outline colour when [member amount] is < 0.
23+
## Label outline color when [member amount] is < 0.
2424
@export var color_heal_outline := Color("#3ca370")
2525

2626
## Consistent with [BattlerHit], damage values greater than 0 incur damage whereas those less than 0
2727
## are for healing.
28-
var amount: int:
28+
var amount := 0:
2929
set(value):
3030
amount = value
3131

@@ -45,7 +45,7 @@ var _tween: Tween = null
4545

4646

4747
func _ready() -> void:
48-
assert(fade_time < move_time, "%s's fade_time must be less than it's move_time!")
48+
assert(fade_time < move_time, "%s's fade_time must be less than its move_time!")
4949

5050

5151
func setup(origin: Vector2, damage_amount: int) -> void:

src/combat/ui/effect_labels/ui_effect_label_builder.gd

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ class_name UIEffectLabelBuilder extends Node2D
66

77
func setup(battlers: Array[Battler]) -> void:
88
for battler in battlers:
9-
battler.hit_missed.connect(_on_battler_hit_missed.bind(battler))
10-
battler.hit_received.connect(_on_battler_hit_received.bind(battler))
119

10+
battler.hit_missed.connect(func _on_battler_hit_missed() -> void:
11+
var label: = missed_label_scene.instantiate()
12+
add_child(label)
13+
label.global_position = battler.anim.top.global_position
14+
)
1215

13-
func _on_battler_hit_missed(battler: Battler) -> void:
14-
var label: = missed_label_scene.instantiate()
15-
add_child(label)
16-
label.global_position = battler.anim.top.global_position
17-
18-
19-
func _on_battler_hit_received(amount: int, battler: Battler) -> void:
20-
var label: = damage_label_scene.instantiate() as UIDamageLabel
21-
add_child(label)
22-
label.setup(battler.anim.top.global_position, amount)
16+
battler.hit_received.connect(func _on_battler_hit_received(amount: int) -> void:
17+
var label: = damage_label_scene.instantiate() as UIDamageLabel
18+
add_child(label)
19+
label.setup(battler.anim.top.global_position, amount)
20+
)
File renamed without changes.

assets/gui/combat/portrait_bg_ally.png.import renamed to src/combat/ui/turn_bar/portrait_bg_ally.png.import

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
importer="texture"
44
type="CompressedTexture2D"
55
uid="uid://bda66befdbudh"
6-
path="res://.godot/imported/portrait_bg_ally.png-65cd5432e4df38ed80cd461dd71f8783.ctex"
6+
path="res://.godot/imported/portrait_bg_ally.png-c4cbdeb48156b9eee64db936ced8e941.ctex"
77
metadata={
88
"vram_texture": false
99
}
1010

1111
[deps]
1212

13-
source_file="res://assets/gui/combat/portrait_bg_ally.png"
14-
dest_files=["res://.godot/imported/portrait_bg_ally.png-65cd5432e4df38ed80cd461dd71f8783.ctex"]
13+
source_file="res://src/combat/ui/turn_bar/portrait_bg_ally.png"
14+
dest_files=["res://.godot/imported/portrait_bg_ally.png-c4cbdeb48156b9eee64db936ced8e941.ctex"]
1515

1616
[params]
1717

File renamed without changes.

assets/gui/combat/portrait_bg_enemy.png.import renamed to src/combat/ui/turn_bar/portrait_bg_enemy.png.import

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
importer="texture"
44
type="CompressedTexture2D"
55
uid="uid://cx3migkss6sja"
6-
path="res://.godot/imported/portrait_bg_enemy.png-024b9acd3f76a94b80aa31f0211cee62.ctex"
6+
path="res://.godot/imported/portrait_bg_enemy.png-b47360190e5adcea6e504f7c5c31a47f.ctex"
77
metadata={
88
"vram_texture": false
99
}
1010

1111
[deps]
1212

13-
source_file="res://assets/gui/combat/portrait_bg_enemy.png"
14-
dest_files=["res://.godot/imported/portrait_bg_enemy.png-024b9acd3f76a94b80aa31f0211cee62.ctex"]
13+
source_file="res://src/combat/ui/turn_bar/portrait_bg_enemy.png"
14+
dest_files=["res://.godot/imported/portrait_bg_enemy.png-b47360190e5adcea6e504f7c5c31a47f.ctex"]
1515

1616
[params]
1717

File renamed without changes.

0 commit comments

Comments
 (0)