Skip to content

Commit

Permalink
Fix _ready() issue for items and resource status
Browse files Browse the repository at this point in the history
  • Loading branch information
Kvel2D committed Mar 4, 2023
1 parent 3c65c97 commit c6ae5fe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Scenes/HUD/Gold.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
extends "res://Scenes/HUD/ResourceStatusPanel.gd"

func _ready():
super()

GoldManager.connect("gold_change",Callable(self,"_on_gold_change"))

var initial_value: int = int(GoldManager.gold)
Expand Down
2 changes: 2 additions & 0 deletions Scenes/HUD/KnowledgeTome.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
extends "res://Scenes/HUD/ResourceStatusPanel.gd"

func _ready():
super()

KnowledgeTomesManager.connect("knowledge_tomes_change",Callable(self,"_on_knowledge_tomes_change"))

var initial_value: int = KnowledgeTomesManager.knowledge_tomes
Expand Down
2 changes: 1 addition & 1 deletion Scenes/Items/Instances/ClawsOfWisdom.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ extends Item
# TODO: visual


func _ready():
func _item_init():
_modifier.add_modification(Unit.ModType.MOD_ATTACKSPEED, -0.16, 0.0)
_modifier.add_modification(Unit.ModType.MOD_EXP_RECEIVED, -0.16, 0.0)
8 changes: 7 additions & 1 deletion Scenes/Items/Item.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ var _modifier: Modifier = Modifier.new()


func _ready():
pass

_item_init()


# TODO: implement checks for max item count
Expand All @@ -54,6 +55,11 @@ func remove_from_tower():
# carrier? queue_free() or reparent to some new node?


# Override this function to initialize subclass
func _item_init():
pass


# Override in subclass to define adding of effects from
# to the carrier
func _add_to_tower_subclass():
Expand Down
2 changes: 1 addition & 1 deletion Scenes/Towers/Instances/ThiefApprentice1.gd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func _on_tower_init():
# called by tooltip i guess?
func on_tower_details() -> MultiboardValues:
var tower = self
m0ck_thief_multiboard.set_value(str(int(tower.user_real)))
m0ck_thief_multiboard.set_value(0, str(int(tower.user_real)))
return m0ck_thief_multiboard


Expand Down

0 comments on commit c6ae5fe

Please sign in to comment.