mirror of https://github.com/hykilpikonna/AquaDX
[+] GUI style
Build AquaMai / build (push) Has been cancelled
Details
Build AquaMai / build (push) Has been cancelled
Details
parent
e844164cf6
commit
906bdfa15e
|
@ -1,4 +1,9 @@
|
||||||
using UnityEngine;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using HarmonyLib;
|
||||||
|
using MelonLoader;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace AquaMai.Helpers;
|
namespace AquaMai.Helpers;
|
||||||
|
|
||||||
|
@ -9,4 +14,43 @@ public static class GuiSizes
|
||||||
public static int FontSize => (int)(PlayerWidth * .015f);
|
public static int FontSize => (int)(PlayerWidth * .015f);
|
||||||
public static float LabelHeight => FontSize * 1.5f;
|
public static float LabelHeight => FontSize * 1.5f;
|
||||||
public static float Margin => PlayerWidth * .005f;
|
public static float Margin => PlayerWidth * .005f;
|
||||||
|
|
||||||
|
private static Color backgroundColor = new(147 / 256f, 160 / 256f, 173 / 256f, .8f);
|
||||||
|
|
||||||
|
public static void SetupStyles()
|
||||||
|
{
|
||||||
|
var buttonStyle = GUI.skin.button;
|
||||||
|
buttonStyle.normal.textColor = Color.white;
|
||||||
|
buttonStyle.normal.background = Texture2D.whiteTexture;
|
||||||
|
buttonStyle.hover.background = Texture2D.whiteTexture;
|
||||||
|
buttonStyle.active.background = Texture2D.whiteTexture;
|
||||||
|
buttonStyle.border = new RectOffset(0, 0, 0, 0);
|
||||||
|
buttonStyle.margin = new RectOffset(0, 0, 0, 0);
|
||||||
|
buttonStyle.padding = new RectOffset(10, 10, 10, 10);
|
||||||
|
buttonStyle.overflow = new RectOffset(0, 0, 0, 0);
|
||||||
|
|
||||||
|
var boxStyle = GUI.skin.box;
|
||||||
|
boxStyle.border = new RectOffset(0, 0, 0, 0);
|
||||||
|
boxStyle.normal.background = Texture2D.whiteTexture;
|
||||||
|
|
||||||
|
GUI.backgroundColor = backgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BoxBackground
|
||||||
|
{
|
||||||
|
public static IEnumerable<MethodBase> TargetMethods()
|
||||||
|
{
|
||||||
|
return typeof(GUI).GetMethods().Where(x => x.Name == "Box");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Prefix()
|
||||||
|
{
|
||||||
|
GUI.backgroundColor = new Color(62 / 256f, 62 / 256f, 66 / 256f, .6f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Postfix()
|
||||||
|
{
|
||||||
|
GUI.backgroundColor = backgroundColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,7 @@ namespace AquaMai
|
||||||
Patch(typeof(MessageHelper));
|
Patch(typeof(MessageHelper));
|
||||||
Patch(typeof(MusicDirHelper));
|
Patch(typeof(MusicDirHelper));
|
||||||
Patch(typeof(SharedInstances));
|
Patch(typeof(SharedInstances));
|
||||||
|
Patch(typeof(GuiSizes));
|
||||||
// Fixes
|
// Fixes
|
||||||
Patch(typeof(FixCharaCrash));
|
Patch(typeof(FixCharaCrash));
|
||||||
Patch(typeof(BasicFix));
|
Patch(typeof(BasicFix));
|
||||||
|
@ -187,5 +188,11 @@ namespace AquaMai
|
||||||
|
|
||||||
MelonLogger.Msg(Locale.Loaded);
|
MelonLogger.Msg(Locale.Loaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnGUI()
|
||||||
|
{
|
||||||
|
GuiSizes.SetupStyles();
|
||||||
|
base.OnGUI();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue