Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

Commit 5cb5156

Browse files
committed
update to UI1
1 parent 363bb07 commit 5cb5156

2 files changed

Lines changed: 17 additions & 11 deletions

File tree

AstralUI.UIMGUI.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using MelonLoader;
1+
using Astrum.AstralCore.UI;
2+
using Astrum.AstralCore.UI.Attributes;
3+
using MelonLoader;
24
using System;
35
using System.Collections.Generic;
46
using UnityEngine;
5-
using static Astrum.AstralCore.Managers.CommandManager;
6-
using static Astrum.AstralCore.Managers.ModuleManager;
77

8-
[assembly: MelonInfo(typeof(Astrum.AstralUI.UIMGUI), "AstralUI.UIMGUI", "0.2.0", downloadLink: "github.com/Astrum-Project/AstralUI.UIMGUI")]
8+
[assembly: MelonInfo(typeof(Astrum.AstralUI.UIMGUI), "AstralUI.UIMGUI", "1.0.0", downloadLink: "github.com/Astrum-Project/AstralUI.UIMGUI")]
99
[assembly: MelonColor(ConsoleColor.DarkMagenta)]
1010

1111
namespace Astrum.AstralUI
@@ -48,7 +48,7 @@ private void ModulesWindow(int id)
4848
{
4949
int i = 0;
5050

51-
foreach (KeyValuePair<string, Module> module in modules)
51+
foreach (KeyValuePair<string, Module> module in CoreUI.Modules)
5252
if (GUI.Button(new Rect(3, i++ * 22 + 21, 150, 20), module.Key))
5353
currentModule = module.Value;
5454

@@ -59,19 +59,19 @@ private void CommandsWindow(int windowID)
5959
{
6060
int i = 0;
6161

62-
foreach (KeyValuePair<string, Command> command in currentModule.commands)
62+
foreach (KeyValuePair<string, UIBase> command in currentModule.Commands)
6363
{
64-
if (command.Value is ConVar<bool> cb)
64+
if (command.Value is UIFieldProp<bool> cb)
6565
cb.Value = GUI.Toggle(CreateRect(ref i), cb.Value, command.Key);
66-
else if (command.Value is ConVar<float> cf)
66+
else if (command.Value is UIFieldProp<float> cf)
6767
{
6868
GUI.Label(CreateRect(ref i), command.Key + $": ({cf.Value:0.00})");
6969
cf.Value = GUI.HorizontalSlider(CreateRect(ref i), cf.Value, cf.Value - 10, cf.Value + 10);
7070
}
71-
else if (command.Value is Button)
71+
else if (command.Value is UIButton)
7272
{
7373
if (GUI.Button(CreateRect(ref i), command.Key))
74-
(command.Value as Button)?.onClick();
74+
(command.Value as UIButton)?.Click();
7575
}
7676
else GUI.Label(CreateRect(ref i), command.Key + " (Unsupported type)");
7777
}

AstralUI.UIMGUI.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<RootNamespace>Astrum.AstralUI</RootNamespace>
1111
<AssemblyName>AstralUI.UIMGUI</AssemblyName>
1212
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
13-
<LangVersion>10.0</LangVersion>
13+
<LangVersion>10.0</LangVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<Deterministic>true</Deterministic>
1616
</PropertyGroup>
@@ -70,6 +70,12 @@
7070
<ItemGroup>
7171
<Folder Include="Properties\" />
7272
</ItemGroup>
73+
<ItemGroup>
74+
<ProjectReference Include="..\AstralCore.UI\AstralCore.UI.csproj">
75+
<Project>{019A21EE-BB5F-46EE-BC7E-A62289F4CE2A}</Project>
76+
<Name>AstralCore.UI</Name>
77+
</ProjectReference>
78+
</ItemGroup>
7379
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
7480
<PropertyGroup>
7581
<PostBuildEvent>COPY "$(TargetPath)" "C:\Program Files (x86)\Steam\steamapps\common\VRChat\Mods\$(TargetFileName)"</PostBuildEvent>

0 commit comments

Comments
 (0)