From 3550817d06f20536a4ebdb111649420d389b634a Mon Sep 17 00:00:00 2001 From: Hank Morgan Date: Wed, 17 Apr 2024 23:59:50 +0100 Subject: [PATCH] debug text for investigating build issues --- Underworld.tscn | 14 +++++++------- main.cs | 9 +++++++++ src/ui/uimanager.cs | 11 +++++++++++ 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Underworld.tscn b/Underworld.tscn index 0afa0df..da03d2e 100644 --- a/Underworld.tscn +++ b/Underworld.tscn @@ -38,6 +38,13 @@ shader = ExtResource("6_x6exc") [node name="Underworld" type="Node3D"] +[node name="main" type="Node3D" parent="." node_paths=PackedStringArray("cam", "audioplayer", "lblPositionDebug", "secondarycameras")] +script = ExtResource("6_3y8oy") +cam = NodePath("../WorldViewContainer/SubViewport/Camera3D") +audioplayer = NodePath("../UI/AudioPlayer") +lblPositionDebug = NodePath("../UI/Common/PositionLabel") +secondarycameras = NodePath("../WorldViewContainer/SubViewport") + [node name="WorldViewContainer" type="SubViewportContainer" parent="."] offset_left = 200.0 offset_top = 72.0 @@ -2723,13 +2730,6 @@ PowerGemUW2 = NodePath("../UW2/PowerGemUW2") [node name="tilemap" type="Node3D" parent="."] -[node name="main" type="Node3D" parent="." node_paths=PackedStringArray("cam", "audioplayer", "lblPositionDebug", "secondarycameras")] -script = ExtResource("6_3y8oy") -cam = NodePath("../WorldViewContainer/SubViewport/Camera3D") -audioplayer = NodePath("../UI/AudioPlayer") -lblPositionDebug = NodePath("../UI/Common/PositionLabel") -secondarycameras = NodePath("../WorldViewContainer/SubViewport") - [connection signal="gui_input" from="UI/UW1/CompassUW1/CompassClickArea" to="UI/uiManager" method="_on_compass_click"] [connection signal="gui_input" from="UI/UW1/ConversationUW1/PlayerTradeSelectedUW1_0" to="UI/uiManager" method="_on_player_trade_selected" binds= [0]] [connection signal="gui_input" from="UI/UW1/ConversationUW1/PlayerTradeSelectedUW1_1" to="UI/uiManager" method="_on_player_trade_selected" binds= [1]] diff --git a/main.cs b/main.cs index 5e5c163..61c94f5 100644 --- a/main.cs +++ b/main.cs @@ -79,7 +79,16 @@ public static void StartGame() { if (gamecam==null) { + if (instance.cam == null) + { + Debug.Print("Main Cam instance is null. trying to find it's node"); + instance.cam = (Camera3D)instance.GetNode("WorldViewContainer/SubViewport/Camera3D"); + } gamecam = instance.cam; + if (gamecam==null) + { + Debug.Print("Gamecam is still null!"); + } } gamecam.Fov = Math.Max(50, uwsettings.instance.FOV); uimanager.EnableDisable(instance.lblPositionDebug,EnablePositionDebug); diff --git a/src/ui/uimanager.cs b/src/ui/uimanager.cs index 4b830b7..4c6e297 100644 --- a/src/ui/uimanager.cs +++ b/src/ui/uimanager.cs @@ -1,4 +1,5 @@ using Godot; +using System.Diagnostics; namespace Underworld @@ -15,11 +16,21 @@ public partial class uimanager : Node2D public override void _Ready() { + Debug.Print("Uimanager about to set instance to this"); instance = this; + Debug.Print("Uimanager has set instance"); + if (instance==null) + { + Debug.Print("Uimanager instance is null"); + } //uimanager.instance.mousecursor.Texture = uimanager.instance.cross; //uimanager.EnableDisable(uimanager.instance.StartMenuPanel, true); + Debug.Print("Trying to load settings"); uimanager.instance.pathuw1.Text = uwsettings.instance.pathuw1; + Debug.Print(uwsettings.instance.pathuw1); uimanager.instance.pathuw2.Text = uwsettings.instance.pathuw2; + Debug.Print(uwsettings.instance.pathuw2); + Debug.Print("Settings loaded"); } public void InitUI()