Skip to content

Commit

Permalink
fix(ui): position save icon to be visible (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenira committed Jan 13, 2024
1 parent 1b8723c commit 1675887
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 24 deletions.
1 change: 1 addition & 0 deletions plugin/src/MainGamePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ void Start()
new PlayerInventoryUIPatch(),
new StorageInventoryUIPatch(),
new IaCMenuPatch(),
new SaveNotificationPatch(),
]).ToArray();

Logger.LogDebug("Hello World!");
Expand Down
24 changes: 24 additions & 0 deletions plugin/src/patch/loading_screen/LoadingScreenCanvasPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using TechtonicaVR.VRCamera;
using UnityEngine;

namespace TechtonicaVR.Patches.LoadingScreen;

public class LoadingScreenCanvasPatch : GameObjectPatch
{
public LoadingScreenCanvasPatch() : base("Canvas")
{
}

protected override bool Apply(GameObject gameObject)
{
gameObject.transform.position = new Vector3(0, 0, 0);
gameObject.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f);

var canvas = gameObject.GetComponent<Canvas>();
canvas.renderMode = RenderMode.WorldSpace;

VRCameraManager.mainCamera.farClipPlane = 20f;

return true;
}
}
24 changes: 0 additions & 24 deletions plugin/src/patch/loading_screen/loading_screen_canvas_patch.cs

This file was deleted.

25 changes: 25 additions & 0 deletions plugin/src/patch/main_game/ui/SaveNotificationPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using UnityEngine;

namespace TechtonicaVR.Patches.MainGame.UI;

public class SaveNotificationPatch : GameComponentPatch<SaveNotification>
{
protected override bool Apply(SaveNotification component)
{
var tlc = component.transform.GetChild(0).gameObject;
if (tlc == null)
{
return false;
}

var image = tlc.transform.GetChild(0).gameObject;
if (image == null)
{
return false;
}

image.transform.localPosition = new Vector3(200, -200, -500);

return true;
}
}

0 comments on commit 1675887

Please sign in to comment.