Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix(ui): fix main menu ui
- Loading branch information
Showing
15 changed files
with
144 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| using System; | ||
| using System.Linq; | ||
| using TechtonicaVR.Patches.MainMenu; | ||
| using UnityEngine; | ||
|
|
||
| namespace TechtonicaVR; | ||
|
|
||
| public class MainMenuPatch : MonoBehaviour | ||
| { | ||
|
|
||
| IPatch[] patches = [ | ||
| new CameraOriginPatch(), | ||
| new SpaceBGCameraPatch(), | ||
| new MenuCanvasPatch(), | ||
| ]; | ||
|
|
||
| private float startTime = Time.time; | ||
|
|
||
| public static MainMenuPatch Create() | ||
| { | ||
| var instance = new GameObject(nameof(MainMenuPatch)).AddComponent<MainMenuPatch>(); | ||
|
|
||
| return instance; | ||
| } | ||
|
|
||
| void Start() | ||
| { | ||
| Debug.Log("Hello Main Menu!"); | ||
| } | ||
|
|
||
| void Update() | ||
| { | ||
| patches = patches.Where(p => !p.Apply()).ToArray(); | ||
|
|
||
| if (!patches.Any()) | ||
| { | ||
| gameObject.SetActive(false); | ||
| } | ||
| } | ||
| } |
2 changes: 1 addition & 1 deletion
2
plugin/src/patch/player/hand_attach_patch.cs → ...tch/main_game/player/hand_attach_patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
plugin/src/patch/ui/dialogue_popup_patch.cs → ...atch/main_game/ui/dialogue_popup_patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../patch/ui/inventory_and_crafting_patch.cs → ...n_game/ui/inventory_and_crafting_patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rc/patch/ui/notifications_canvas_patch.cs → ...ain_game/ui/notifications_canvas_patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
plugin/src/patch/ui/quest_task_list_patch.cs → ...tch/main_game/ui/quest_task_list_patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
plugin/src/patch/ui/toolbar_ui_patch.cs → ...rc/patch/main_game/ui/toolbar_ui_patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using UnityEngine; | ||
|
|
||
| namespace TechtonicaVR.Patches.MainMenu; | ||
|
|
||
| public class CameraOriginPatch : GameObjectPatch | ||
| { | ||
| public CameraOriginPatch() : base("Main Camera (origin)") | ||
| { | ||
| } | ||
|
|
||
| protected override bool Apply(GameObject gameObject) | ||
| { | ||
| gameObject.transform.position = new Vector3(-1614, 23, -2312); | ||
| return true; | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| using UnityEngine; | ||
|
|
||
| namespace TechtonicaVR.Patches.MainMenu; | ||
|
|
||
| public class MenuCanvasPatch : GameObjectPatch | ||
| { | ||
| public MenuCanvasPatch() : base("Canvas") | ||
| { | ||
| } | ||
|
|
||
| protected override bool Apply(GameObject gameObject) | ||
| { | ||
| var origin = GameObject.Find("Main Camera (origin)"); | ||
| if (origin == null) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| gameObject.transform.parent = origin.transform; | ||
| gameObject.transform.localPosition = new Vector3(5.5982f, 0.7818f, 5.9599f); | ||
| gameObject.transform.rotation = Quaternion.Euler(0, 40.4374f, 0); | ||
| gameObject.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f); | ||
|
|
||
| var canvas = gameObject.GetComponent<Canvas>(); | ||
| canvas.renderMode = RenderMode.WorldSpace; | ||
|
|
||
| return true; | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| using FluffyUnderware.DevTools.Extensions; | ||
| using UnityEngine; | ||
| using UnityEngine.Rendering.PostProcessing; | ||
| using Valve.VR; | ||
|
|
||
| namespace TechtonicaVR.Patches.MainMenu; | ||
|
|
||
| public class SpaceBGCameraPatch : GameObjectPatch | ||
| { | ||
| public SpaceBGCameraPatch() : base("Space BG Camera") | ||
| { | ||
| } | ||
|
|
||
| protected override bool Apply(GameObject gameObject) | ||
| { | ||
| var origin = GameObject.Find("Main Camera (origin)"); | ||
| if (origin == null) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| gameObject.AddComponent<SteamVR_TrackedObject>(); | ||
| gameObject.GetComponent<PostProcessLayer>().enabled = false; | ||
| Object.Destroy(gameObject.GetComponent("SpaceGraphicsToolkit.SgtCamera")); | ||
|
|
||
| gameObject.transform.parent = origin.transform; | ||
| return true; | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.