Skip to content

Commit

Permalink
change Windows namespace to UWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
Hirashi3630 committed Jul 9, 2022
1 parent 9cd9fdb commit 13fc078
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
8 changes: 2 additions & 6 deletions UrGUI/UWindow/GUIWindowControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
using UnityEngine;
using UrGUI.Utils;
using UrGUI.UWindow.Utils;
using UrGUI.Windows.Utils;
using static UrGUI.Utils.Logger;
using static UrGUI.UWindow.UWindowManager;

namespace UrGUI.Windows
namespace UrGUI.UWindow
{
internal static class GUIWindowControls
{


internal class WLabel : WControl
{
private Rect _rect = new Rect();
Expand Down Expand Up @@ -89,7 +86,6 @@ internal class WToggle : WControl
internal override void Draw(Rect r)
{
// calculations consider that toggle box is 1:1 ratio (r.height : r.height)
bool newValue = Value;
Rect rToggle = r;
if (_toggleStyle == null)
_toggleStyle = new GUIStyle(GUI.skin.toggle);
Expand All @@ -99,7 +95,7 @@ internal override void Draw(Rect r)
int overValue = Mathf.RoundToInt(r.width - r.height);
_toggleStyle.overflow.left = -overValue;
_toggleStyle.overflow.right = overValue;
newValue = GUI.Toggle(rToggle, Value, string.Empty, _toggleStyle);
var newValue = GUI.Toggle(rToggle, Value, string.Empty, _toggleStyle);

if (newValue != Value)
OnValueChanged(newValue);
Expand Down
1 change: 0 additions & 1 deletion UrGUI/UWindow/UWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Linq;
using System.IO;
using UnityEngine;
using UrGUI.Windows;
using UrGUI.Utils;
using static UrGUI.UWindow.UWindowManager;

Expand Down
4 changes: 4 additions & 0 deletions UrGUI/UWindow/UWindowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ internal static class UWindowManager
public static GameObject BManagerG = null;
public static UWindowManagerBehaviour BManager = null;

public static bool IsDrawing { get; set; } = true;

// ------- dialog -------
public static bool AllWindowsDisabled = false;
public static bool AnyWindowDragging = false;
Expand Down Expand Up @@ -48,6 +50,8 @@ public static Vector2 GetDynamicWindowPos(float currentWidth)

public static void OnBehaviourGUI()
{
if (!IsDrawing) return;

foreach (var w in Windows)
{
// draw window
Expand Down
19 changes: 12 additions & 7 deletions UrGUI/UWindow/UWindowManagerBehaviour.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
using System;
using UnityEngine;
using static UrGUI.Utils.Logger;

namespace UrGUI.UWindow
{
internal class UWindowManagerBehaviour : MonoBehaviour
{
// private bool _isDestroying = false;

private void Awake()
{
DontDestroyOnLoad(gameObject);

throw new NotImplementedException();
}

private void Start()
{
throw new NotImplementedException();

}

private void OnEnable()
{
// enable manager drawing

}

private void OnDisable()
{
// disable manager drawing
}
// private void OnDisable()
// {
// disable manager drawing
// if (!_isDestroying)
// war("Don't disable UrGUI ManagerBehaviour manually! If you want to stop/pause drawing use Manager.IsDrawing property!");
// }

// private void OnDestroy()
// {
// _isDestroying = true;
// UWindowManager.OnBehaviourDestroy();
// }

Expand Down
1 change: 0 additions & 1 deletion UrGUI/UWindow/Utils/GUIControl.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using UnityEngine;
using UrGUI.Windows.Utils;

namespace UrGUI.UWindow.Utils
{
Expand Down
2 changes: 1 addition & 1 deletion UrGUI/UWindow/Utils/GUIFormatting.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using UnityEngine;

namespace UrGUI.Windows.Utils
namespace UrGUI.UWindow.Utils
{
public static class GUIFormatting
{
Expand Down
2 changes: 1 addition & 1 deletion UrGUI/Utils/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static PrintType DebugFilter
#if DEBUG
private static PrintType _debugFilter = PrintType.Error | PrintType.Warnings | PrintType.Info; // debug
#else
private static PrintType _debugFilter = PrintType.Error | PrintType.Warnings | PrintType.Info; // release
private static PrintType _debugFilter = PrintType.Error | PrintType.Warnings; // release
#endif


Expand Down

0 comments on commit 13fc078

Please sign in to comment.