Skip to content

Commit

Permalink
changes to execution order
Browse files Browse the repository at this point in the history
  • Loading branch information
hankmorgan committed Apr 17, 2024
1 parent 3800ac3 commit 6fdfe48
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ jobs:
generateReleaseNotes: true
tag: ${{ github.ref_name }}
artifacts: ${{ steps.export.outputs.archive_directory }}/*
prerelease: true
18 changes: 9 additions & 9 deletions main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static bool blockmouseinput
public static Camera3D gamecam; //static ref to the above camera
[Export] public AudioStreamPlayer audioplayer;
[Export] public RichTextLabel lblPositionDebug;
[Export] public uimanager uwUI;
//[Export] public uimanager uwUI;

[Export] public SubViewport secondarycameras;

Expand All @@ -64,15 +64,15 @@ public static bool blockmouseinput

public override void _Ready()
{
instance = this;
instance = this;
gamecam = cam;
uimanager.instance = uwUI;
uimanager.instance.mousecursor.Texture = uimanager.instance.cross;
uwsettings.LoadSettings();
uimanager.EnableDisable(uimanager.instance.StartMenuPanel, true);
uimanager.instance.pathuw1.Text = uwsettings.instance.pathuw1;
uimanager.instance.pathuw2.Text = uwsettings.instance.pathuw2;
GetTree().DebugCollisionsHint =uwsettings.instance.showcolliders;
//uimanager.instance = uwUI;
if (uwsettings.instance!=null)
{
gamecam.Fov = Math.Max(50, uwsettings.instance.FOV);
GetTree().DebugCollisionsHint = uwsettings.instance.showcolliders;
}

}

public static void StartGame()
Expand Down
13 changes: 12 additions & 1 deletion src/ui/uimanager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ public partial class uimanager : Node2D
[Export] public TextureRect placeholderuw1;
[Export] public TextureRect placeholderuw2;

public void InitUI()

public override void _Ready()
{
uwsettings.LoadSettings();
instance = this;
uimanager.instance.mousecursor.Texture = uimanager.instance.cross;
uimanager.EnableDisable(uimanager.instance.StartMenuPanel, true);
uimanager.instance.pathuw1.Text = uwsettings.instance.pathuw1;
uimanager.instance.pathuw2.Text = uwsettings.instance.pathuw2;
}

public void InitUI()
{
InitArt();
InitMainMenu();
Expand Down
6 changes: 5 additions & 1 deletion src/utility/config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ public static void LoadSettings()
}
var gamesettings = JsonSerializer.Deserialize<uwsettings>(File.ReadAllText(settingsfile));
uwsettings.instance = gamesettings;
main.gamecam.Fov = Math.Max(50, uwsettings.instance.FOV);
if (main.gamecam!=null)
{
main.gamecam.Fov = Math.Max(50, uwsettings.instance.FOV);
}


setGame(gamesettings.gametoload);
switch (UWClass._RES)
Expand Down

0 comments on commit 6fdfe48

Please sign in to comment.