Skip to content

Commit f684134

Browse files
committed
Merge branch 'dev' into main
2 parents 9522e84 + bb6a441 commit f684134

File tree

76 files changed

+958
-1128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+958
-1128
lines changed

Logo.png

6.62 KB
Loading

VRCOSC.Desktop/VRCOSC.Desktop.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
<ApplicationIcon>game.ico</ApplicationIcon>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Version>0.0.0</Version>
9-
<FileVersion>2022.1211.1</FileVersion>
9+
<FileVersion>2022.1218.0</FileVersion>
1010
<Title>VRCOSC</Title>
1111
<Authors>VolcanicArts</Authors>
1212
<Company>VolcanicArts</Company>
1313
<Nullable>enable</Nullable>
14-
<AssemblyVersion>2022.1211.1</AssemblyVersion>
14+
<AssemblyVersion>2022.1218.0</AssemblyVersion>
1515
</PropertyGroup>
1616
<ItemGroup Label="Project References">
1717
<ProjectReference Include="..\VRCOSC.Game\VRCOSC.Game.csproj" />

VRCOSC.Game.Tests/Tests/TimedTaskTests.cs

Lines changed: 0 additions & 115 deletions
This file was deleted.

VRCOSC.Game/Config/VRCOSCConfigManager.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ protected override void InitialiseDefaults()
2828
SetDefault(VRCOSCSetting.UpdateRepo, @"https://github.com/VolcanicArts/VRCOSC");
2929
SetDefault(VRCOSCSetting.Theme, ColourTheme.Dark);
3030
SetDefault(VRCOSCSetting.ChatBoxTimeSpan, 1500);
31+
SetDefault(VRCOSCSetting.AutoStopOpenVR, false);
3132
}
3233
}
3334

@@ -41,5 +42,6 @@ public enum VRCOSCSetting
4142
UpdateMode,
4243
UpdateRepo,
4344
Theme,
44-
ChatBoxTimeSpan
45+
ChatBoxTimeSpan,
46+
AutoStopOpenVR
4547
}

VRCOSC.Game/Constants.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

VRCOSC.Game/Graphics/ModuleEditing/AttributeFlow.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ private AttributeCard generateCard(ModuleAttribute attributeData)
7979

8080
private AttributeCard generateListCard(ModuleAttributeList attributeData)
8181
{
82-
if (attributeData.Type == typeof(int))
83-
return new IntTextAttributeCardList(attributeData);
84-
8582
if (attributeData.Type == typeof(string))
8683
return new TextAttributeCardList(attributeData);
8784

VRCOSC.Game/Graphics/ModuleEditing/Attributes/AttributeCard.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) VolcanicArts. Licensed under the GPL-3.0 License.
22
// See the LICENSE file in the repository root for full license text.
33

4+
using System;
45
using osu.Framework.Allocation;
56
using osu.Framework.Graphics;
67
using osu.Framework.Graphics.Containers;
@@ -134,7 +135,10 @@ protected virtual void SetDefault()
134135

135136
protected void UpdateResetToDefault(bool show)
136137
{
137-
resetToDefault.FadeTo(show ? 1 : 0, 200, Easing.OutQuart);
138+
var newAlpha = show ? 1 : 0;
139+
if (Math.Abs(resetToDefault.Alpha - newAlpha) < 0.01f) return;
140+
141+
resetToDefault.FadeTo(newAlpha, 200, Easing.OutQuart);
138142
}
139143

140144
#region Graphics
Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) VolcanicArts. Licensed under the GPL-3.0 License.
22
// See the LICENSE file in the repository root for full license text.
33

4-
using System;
54
using osu.Framework.Bindables;
65
using VRCOSC.Game.Modules;
76

@@ -10,53 +9,34 @@ namespace VRCOSC.Game.Graphics.ModuleEditing.Attributes;
109
public abstract partial class AttributeCardSingle : AttributeCard
1110
{
1211
protected new readonly ModuleAttributeSingle AttributeData;
13-
protected virtual bool ShouldLimitSaves => false;
14-
15-
private DateTimeOffset lastUpdateTime;
16-
private readonly TimeSpan timeUntilSave = TimeSpan.FromSeconds(0.5f);
17-
18-
private object lastValue = null!;
1912

2013
protected AttributeCardSingle(ModuleAttributeSingle attributeData)
2114
: base(attributeData)
2215
{
2316
AttributeData = attributeData;
24-
lastUpdateTime = DateTimeOffset.Now;
2517
}
2618

2719
protected override void LoadComplete()
2820
{
29-
AttributeData.Attribute.BindValueChanged(e => Schedule(performAttributeUpdate, e), true);
30-
lastValue = AttributeData.Attribute.Value;
31-
}
32-
33-
protected override void Update()
34-
{
35-
if (lastUpdateTime + timeUntilSave < DateTimeOffset.Now && !AttributeData.Attribute.Value.Equals(lastValue))
36-
{
37-
AttributeData.Attribute.Value = lastValue;
38-
}
21+
AttributeData.Attribute.BindValueChanged(onAttributeUpdate, true);
3922
}
4023

41-
private void performAttributeUpdate(ValueChangedEvent<object> e)
24+
private void onAttributeUpdate(ValueChangedEvent<object> e)
4225
{
43-
UpdateValues(e.NewValue);
4426
UpdateResetToDefault(!AttributeData.IsDefault());
4527
}
4628

47-
protected virtual void UpdateValues(object value)
29+
protected virtual void UpdateAttribute(object value)
4830
{
49-
lastValue = value;
31+
//Specifically check for equal values here to stop memory allocations from setting the bindable's value
32+
if (value == AttributeData.Attribute.Value) return;
5033

51-
if (ShouldLimitSaves)
52-
lastUpdateTime = DateTimeOffset.Now;
53-
else
54-
AttributeData.Attribute.Value = value;
34+
AttributeData.Attribute.Value = value;
5535
}
5636

5737
protected override void Dispose(bool isDisposing)
5838
{
5939
base.Dispose(isDisposing);
60-
AttributeData.Attribute.ValueChanged -= performAttributeUpdate;
40+
AttributeData.Attribute.ValueChanged -= onAttributeUpdate;
6141
}
6242
}

VRCOSC.Game/Graphics/ModuleEditing/Attributes/Dropdown/DropdownAttributeCard.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,20 @@ private void load()
2727
Anchor = Anchor.TopCentre,
2828
Origin = Anchor.TopCentre,
2929
RelativeSizeAxes = Axes.X,
30-
Items = Enum.GetValues(typeof(T)).Cast<T>()
30+
Items = Enum.GetValues(typeof(T)).Cast<T>(),
31+
Current = { Value = (T)AttributeData.Attribute.Value }
3132
});
3233
}
3334

3435
protected override void LoadComplete()
3536
{
3637
base.LoadComplete();
37-
dropdown.Current.ValueChanged += e => UpdateValues(e.NewValue);
38+
dropdown.Current.ValueChanged += e => UpdateAttribute(e.NewValue);
3839
}
3940

40-
protected override void UpdateValues(object value)
41+
protected override void SetDefault()
4142
{
42-
base.UpdateValues(value);
43-
dropdown.Current.Value = (T)value;
43+
base.SetDefault();
44+
dropdown.Current.Value = (T)AttributeData.Attribute.Value;
4445
}
4546
}

VRCOSC.Game/Graphics/ModuleEditing/Attributes/Slider/FloatSliderAttributeCard.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public FloatSliderAttributeCard(ModuleAttributeSingleWithBounds attributeData)
1717
{
1818
MinValue = (float)AttributeDataWithBounds.MinValue,
1919
MaxValue = (float)AttributeDataWithBounds.MaxValue,
20-
Precision = 0.01f
20+
Precision = 0.01f,
21+
Value = (float)AttributeData.Attribute.Value
2122
};
2223
}

VRCOSC.Game/Graphics/ModuleEditing/Attributes/Slider/IntSliderAttributeCard.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public IntSliderAttributeCard(ModuleAttributeSingleWithBounds attributeData)
1717
{
1818
MinValue = (int)AttributeDataWithBounds.MinValue,
1919
MaxValue = (int)AttributeDataWithBounds.MaxValue,
20-
Precision = 1
20+
Precision = 1,
21+
Value = (int)AttributeData.Attribute.Value
2122
};
2223
}

VRCOSC.Game/Graphics/ModuleEditing/Attributes/Slider/SliderAttributeCard.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ private void load()
4141
protected override void LoadComplete()
4242
{
4343
base.LoadComplete();
44-
slider.SlowedCurrent.ValueChanged += e => UpdateValues(e.NewValue);
44+
slider.Current.ValueChanged += e => UpdateAttribute(e.NewValue);
4545
}
4646

47-
protected override void UpdateValues(object value)
47+
protected override void SetDefault()
4848
{
49-
base.UpdateValues(value);
50-
slider.SlowedCurrent.Value = (T)value;
49+
base.SetDefault();
50+
slider.Current.Value = (T)AttributeData.Attribute.Value;
5151
}
5252

5353
protected abstract Bindable<T> CreateCurrent();

VRCOSC.Game/Graphics/ModuleEditing/Attributes/Text/IntTextAttributeCard.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,17 @@ public IntTextAttributeCard(ModuleAttributeSingle attributeData)
1313
{
1414
}
1515

16-
protected override object OnTextWrite(ValueChangedEvent<string> e)
16+
protected override void OnTextBoxUpdate(ValueChangedEvent<string> e)
1717
{
18-
if (string.IsNullOrEmpty(e.NewValue)) return 0;
18+
if (string.IsNullOrEmpty(e.NewValue))
19+
{
20+
UpdateAttribute(0);
21+
TextBox.Current.Value = "0";
22+
}
1923

20-
return int.TryParse(e.NewValue, out var intValue) ? intValue : e.OldValue;
24+
if (int.TryParse(e.NewValue, out var intValue))
25+
UpdateAttribute(intValue);
26+
else
27+
TextBox.Current.Value = e.OldValue;
2128
}
2229
}

VRCOSC.Game/Graphics/ModuleEditing/Attributes/Text/IntTextAttributeCardList.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)