Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
VolcanicArts committed Feb 5, 2023
2 parents 57b6931 + 179d632 commit e3a2c27
Show file tree
Hide file tree
Showing 117 changed files with 2,256 additions and 1,171 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ riderModule.iml
/_ReSharper.Caches/
/.idea
*.user
.vs/
VRCOSCSecrets.cs
.vs/
8 changes: 7 additions & 1 deletion VRCOSC.Desktop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ namespace VRCOSC.Desktop;

public static class Program
{
#if DEBUG
private const string base_game_name = @"VRCOSC-Development";
#else
private const string base_game_name = @"VRCOSC";
#endif

public static void Main()
{
initSquirrel();

using GameHost host = Host.GetSuitableDesktopHost(@"VRCOSC");
using GameHost host = Host.GetSuitableDesktopHost(base_game_name);
using osu.Framework.Game game = new VRCOSCGameDesktop();
host.Run(game);
}
Expand Down
5 changes: 3 additions & 2 deletions VRCOSC.Desktop/VRCOSC.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
<ApplicationIcon>game.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Version>0.0.0</Version>
<FileVersion>2023.109.0</FileVersion>
<FileVersion>2023.205.0</FileVersion>
<Title>VRCOSC</Title>
<Authors>VolcanicArts</Authors>
<Company>VolcanicArts</Company>
<Nullable>enable</Nullable>
<AssemblyVersion>2023.109.0</AssemblyVersion>
<AssemblyVersion>2023.205.0</AssemblyVersion>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\VRCOSC.Game\VRCOSC.Game.csproj" />
<ProjectReference Include="..\VRCOSC.Modules\VRCOSC.Modules.csproj" />
</ItemGroup>
<ItemGroup Label="Resources">
<EmbeddedResource Include="game.ico" />
Expand Down
7 changes: 3 additions & 4 deletions VRCOSC.Desktop/VRCOSCGameDesktop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
using VRCOSC.Desktop.Updater;
using VRCOSC.Game;
using VRCOSC.Game.Graphics.Updater;
using VRCOSC.Modules;

namespace VRCOSC.Desktop;

public partial class VRCOSCGameDesktop : VRCOSCGame
{
protected override VRCOSCUpdateManager CreateUpdateManager()
{
return new SquirrelUpdateManager();
}
protected override IVRCOSCSecrets GetSecrets() => new VRCOSCModuleSecrets();
protected override VRCOSCUpdateManager CreateUpdateManager() => new SquirrelUpdateManager();
}
2 changes: 2 additions & 0 deletions VRCOSC.Game/Graphics/MainContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using osu.Framework.Graphics.Containers;
using VRCOSC.Game.Graphics.About;
using VRCOSC.Game.Graphics.ModuleListing;
using VRCOSC.Game.Graphics.Router;
using VRCOSC.Game.Graphics.Settings;
using VRCOSC.Game.Graphics.TabBar;

Expand Down Expand Up @@ -51,6 +52,7 @@ private void load()
{
new ModuleListingScreen(),
new SettingsScreen(),
new RouterScreen(),
new AboutScreen()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ protected override void OnTextBoxUpdate(ValueChangedEvent<string> e)
{
UpdateAttribute(0);
TextBox.Current.Value = "0";
return;
}

if (int.TryParse(e.NewValue, out var intValue))
Expand Down
46 changes: 42 additions & 4 deletions VRCOSC.Game/Graphics/ModuleEditing/ModuleEditingContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public sealed partial class ModuleEditingContent : Container
{
private readonly SpriteText titleText;
private readonly SeparatedAttributeFlow settings;
private readonly SeparatedAttributeFlow parameters;
private readonly BasicScrollContainer scrollContainer;
private readonly FillFlowContainer<SeparatedAttributeFlow> separatedAttributeFlowFlow;

Expand Down Expand Up @@ -67,7 +68,12 @@ public ModuleEditingContent()
Spacing = new Vector2(0, 5),
Children = new[]
{
settings = new SeparatedAttributeFlow()
settings = new SeparatedAttributeFlow(),
parameters = new SeparatedAttributeFlow
{
Title = "Parameter Names",
SubTitle = "Only edit these if you know what you are doing"
}
}
}
}
Expand All @@ -91,26 +97,58 @@ protected override void LoadComplete()

settings.Replace(editingModule.Value.Settings.Values);
settings.Alpha = editingModule.Value.HasSettings ? 1 : 0;

parameters.Replace(editingModule.Value.Parameters.Values);
parameters.Alpha = editingModule.Value.HasParameters ? 1 : 0;
}, true);
}

private sealed partial class SeparatedAttributeFlow : Container
private sealed partial class SeparatedAttributeFlow : FillFlowContainer
{
private readonly AttributeFlow attributeFlow;
public string Title { get; init; } = string.Empty;
public string SubTitle { get; init; } = string.Empty;

private AttributeFlow attributeFlow = null!;

public SeparatedAttributeFlow()
[BackgroundDependencyLoader]
private void load()
{
Anchor = Anchor.TopCentre;
Origin = Anchor.TopCentre;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Spacing = new Vector2(0, 5);
Direction = FillDirection.Vertical;

Children = new Drawable[]
{
new LineSeparator
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre
},
new SpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Font = FrameworkFont.Regular.With(size: 60),
Colour = ThemeManager.Current[ThemeAttribute.Text],
Text = Title,
Alpha = string.IsNullOrEmpty(Title) ? 0 : 1
},
new SpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Font = FrameworkFont.Regular.With(size: 25),
Colour = ThemeManager.Current[ThemeAttribute.SubText],
Margin = new MarginPadding
{
Vertical = 10
},
Text = SubTitle,
Alpha = string.IsNullOrEmpty(SubTitle) ? 0 : 1
},
attributeFlow = new AttributeFlow()
};
}
Expand Down
7 changes: 4 additions & 3 deletions VRCOSC.Game/Graphics/ModuleListing/Listing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENSE file in the repository root for full license text.

using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
Expand All @@ -17,7 +18,7 @@ public sealed partial class Listing : Container
private GameManager gameManager { get; set; } = null!;

[Resolved]
private VRCOSCGame game { get; set; } = null!;
private Bindable<Module.ModuleType?> typeFilter { get; set; } = null!;

private readonly FillFlowContainer<ModuleCard> moduleCardFlow;

Expand Down Expand Up @@ -62,12 +63,12 @@ private void load()

protected override void LoadComplete()
{
game.TypeFilter.BindValueChanged(_ => filter(), true);
typeFilter.BindValueChanged(_ => filter(), true);
}

private void filter()
{
var type = game.TypeFilter.Value;
var type = typeFilter.Value;

moduleCardFlow.ForEach(moduleCard =>
{
Expand Down
1 change: 0 additions & 1 deletion VRCOSC.Game/Graphics/ModuleListing/ModuleCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ private Colour4 calculateModuleColour()
Module.ModuleType.General => Colour4.White.Darken(0.15f),
Module.ModuleType.Health => Colour4.Red,
Module.ModuleType.Integrations => Colour4.Yellow.Darken(0.25f),
Module.ModuleType.Accessibility => Colour4.FromHex(@"66ccff"),
Module.ModuleType.OpenVR => Colour4.FromHex(@"04144d"),
_ => throw new ArgumentOutOfRangeException()
};
Expand Down
22 changes: 12 additions & 10 deletions VRCOSC.Game/Graphics/ModuleListing/ModuleInfoPopover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ public ModuleInfoPopover()

private sealed partial class ParameterData : Container
{
public string ParameterName { get; init; } = null!;
public string Description { get; init; } = null!;
public string Type { get; init; } = null!;
public bool Outgoing { get; init; }
public bool Incoming { get; init; }
public required string ParameterName;
public required string DisplayName;
public required string Description;
public required string Type;
public required bool Outgoing;
public required bool Incoming;

public ParameterData()
{
Expand All @@ -142,11 +143,11 @@ public ParameterData()
[BackgroundDependencyLoader]
private void load()
{
var name = $"Name: {ParameterName}";
var metadata = $"{DisplayName} - {Description}";
var name = $"Parameter Name: {ParameterName}";
var type = $"Type: {Type}";
var outgoing = $"Writes To VRC?: {Outgoing}";
var incoming = $"Reads From VRC?: {Incoming}";
var description = $"Description: {Description}";

Children = new Drawable[]
{
Expand All @@ -167,7 +168,7 @@ private void load()
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Text = $"{name}\n{type}\n{outgoing}\n{incoming}\n{description}"
Text = $"{metadata}\n\n{name}\n{type}\n{outgoing}\n{incoming}"
}
}
}
Expand Down Expand Up @@ -200,8 +201,9 @@ public override void Show()
{
parameters.Add(new ParameterData
{
ParameterName = parameter.Name,
Description = parameter.Description,
ParameterName = (string)parameter.Attribute.Value,
DisplayName = parameter.Metadata.DisplayName,
Description = parameter.Metadata.Description,
Type = parameter.ExpectedType.ToReadableName(),
Outgoing = parameter.Mode.HasFlagFast(ParameterMode.Write),
Incoming = parameter.Mode.HasFlagFast(ParameterMode.Read)
Expand Down
11 changes: 6 additions & 5 deletions VRCOSC.Game/Graphics/ModuleListing/TypeFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using VRCOSC.Game.Graphics.UI;
Expand All @@ -13,7 +14,7 @@ namespace VRCOSC.Game.Graphics.ModuleListing;
public sealed partial class TypeFilter : Container
{
[Resolved]
private VRCOSCGame game { get; set; } = null!;
private Bindable<Module.ModuleType?> typeFilter { get; set; } = null!;

private readonly VRCOSCDropdown<Group> dropdown;

Expand All @@ -35,16 +36,16 @@ protected override void LoadComplete()
{
base.LoadComplete();

dropdown.Current.BindValueChanged(group => game.TypeFilter.Value = groupToType(group.NewValue), true);
dropdown.Current.BindValueChanged(group => typeFilter.Value = groupToType(group.NewValue), true);
}

private enum Group
{
All = -1,
General = 0,
Health = 1,
Health = 0,
OpenVR = 1,
Integrations = 2,
OpenVR = 4
General = 3,
}

private static Module.ModuleType? groupToType(Group group) => group == Group.All ? null : (Module.ModuleType)(int)group;
Expand Down
10 changes: 5 additions & 5 deletions VRCOSC.Game/Graphics/ModuleRun/ParameterContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using osu.Framework.Graphics.Shapes;
using VRCOSC.Game.Graphics.Themes;
using VRCOSC.Game.Modules;
using VRCOSC.OSC.VRChat;
using VRCOSC.Game.OSC.VRChat;

namespace VRCOSC.Game.Graphics.ModuleRun;

Expand Down Expand Up @@ -65,8 +65,8 @@ public ParameterContainer()

protected override void LoadComplete()
{
gameManager.OscClient.OnParameterSent += onParameterSent;
gameManager.OscClient.OnParameterReceived += onParameterReceived;
gameManager.VRChatOscClient.OnParameterSent += onParameterSent;
gameManager.VRChatOscClient.OnParameterReceived += onParameterReceived;
}

private void onParameterSent(VRChatOscData data)
Expand Down Expand Up @@ -132,7 +132,7 @@ public void ClearContent()
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
gameManager.OscClient.OnParameterSent -= onParameterSent;
gameManager.OscClient.OnParameterReceived -= onParameterReceived;
gameManager.VRChatOscClient.OnParameterSent -= onParameterSent;
gameManager.VRChatOscClient.OnParameterReceived -= onParameterReceived;
}
}
Loading

0 comments on commit e3a2c27

Please sign in to comment.