From aed8b266b847a84888e067a37de4d19d9f473516 Mon Sep 17 00:00:00 2001 From: Tony Bark <35226681+tonytins@users.noreply.github.com> Date: Sun, 7 Aug 2022 23:00:59 -0400 Subject: [PATCH] Fixed news ticker not replacing text Glad to get that annoying bug finally out of the way. --- scenes/game.tscn | 3 --- scripts/ticker.gd | 12 ++++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/scenes/game.tscn b/scenes/game.tscn index 071e64b..170eba9 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -101,7 +101,6 @@ margin_right = 234.609 margin_bottom = 138.5 [node name="ToolsWindow" type="WindowDialog" parent="Controls/Windows"] -visible = true anchor_left = 0.402435 anchor_top = 0.315697 anchor_right = 0.60263 @@ -277,7 +276,6 @@ anchor_left = 0.0115391 anchor_top = 0.193259 anchor_right = 0.0525548 anchor_bottom = 0.670871 -margin_top = -9.53674e-07 hint_tooltip = "Meet" size_flags_horizontal = 4 icon = ExtResource( 35 ) @@ -290,7 +288,6 @@ anchor_left = 0.0566406 anchor_top = 0.208955 anchor_right = 0.601562 anchor_bottom = 0.746269 -margin_top = 9.53674e-07 custom_constants/separation = 50 alignment = 1 script = ExtResource( 38 ) diff --git a/scripts/ticker.gd b/scripts/ticker.gd index 11c0e38..eec012e 100644 --- a/scripts/ticker.gd +++ b/scripts/ticker.gd @@ -89,20 +89,20 @@ func _random_news(files: Array): if SimData.city_name == "Furtropolis" or "Furville" and "[outlet]" in news_text: # FNN = Furtropolis/Furry News Network - news_text.replace("[outlet]", "FNN") - elif "[outlet]" in news_text: - news_text.replace("[outlet]", "Pawprint Press") + news_text = news_text.replace("[outlet]", "FNN") + else: + news_text = news_text.replace("[outlet]", "Pawprint Press") if "[species]" in news_text: speices.shuffle() var speices_range = rng.randi_range(speices.size() - 1) - news_text.replace("[species]", speices[speices_range]) + news_text = news_text.replace("[species]", speices[speices_range]) if "[city]" in news_text: - news_text.replace("[city]", SimData.city_name) + news_text = news_text.replace("[city]", SimData.city_name) if "[mayor]" in news_text: - news_text.replace("[mayor]", SimData.mayor_name) + news_text = news_text.replace("[mayor]", SimData.mayor_name) if ticker_text.items.size() > 3: ticker_text.clear()