-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
547 changed files
with
23,337 additions
and
23,074 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
bin/ | ||
obj/ | ||
/build | ||
/Releases | ||
/releases | ||
/publish | ||
/publish.sh | ||
/packages/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
<!-- Contains required properties for osu!framework projects. --> | ||
<Project> | ||
<PropertyGroup> | ||
<ApplicationManifest>$(MSBuildThisFileDirectory)app.manifest</ApplicationManifest> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<GlobalVersionYear>$([System.DateTime]::Now.ToString("yyyy"))</GlobalVersionYear> | ||
<GlobalVersionMonthDay>$([System.DateTime]::Now.ToString("Mdd"))</GlobalVersionMonthDay> | ||
<GlobalBuild>0</GlobalBuild> | ||
<GlobalVersion>$(GlobalVersionYear).$(GlobalVersionMonthDay).$(GlobalBuild).0</GlobalVersion> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) VolcanicArts. Licensed under the GPL-3.0 License. | ||
// See the LICENSE file in the repository root for full license text. | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace VRCOSC.App.Actions; | ||
|
||
public class CompositeProgressAction : ProgressAction | ||
{ | ||
public override string Title => currentChild is CompositeProgressAction compositeCurrentChild ? compositeCurrentChild.Title : currentChild?.Title ?? string.Empty; | ||
|
||
private readonly List<ProgressAction> children = new(); | ||
private ProgressAction? currentChild => children.FirstOrDefault(child => !child.IsComplete); | ||
|
||
public void AddAction(ProgressAction? child) | ||
{ | ||
if (child is null) return; | ||
|
||
children.Add(child); | ||
} | ||
|
||
protected override async Task Perform() | ||
{ | ||
foreach (var child in children) | ||
{ | ||
await child.Execute(); | ||
} | ||
} | ||
|
||
public override float GetProgress() | ||
{ | ||
var multiplier = 1f / children.Count; | ||
return children.Sum(child => child.IsComplete ? multiplier : child.GetProgress() * multiplier); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) VolcanicArts. Licensed under the GPL-3.0 License. | ||
// See the LICENSE file in the repository root for full license text. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace VRCOSC.App.Actions; | ||
|
||
public class DynamicChildProgressAction : CompositeProgressAction | ||
{ | ||
private readonly Func<ProgressAction?> callback; | ||
|
||
public DynamicChildProgressAction(Func<ProgressAction?> callback) | ||
{ | ||
this.callback = callback; | ||
} | ||
|
||
protected override async Task Perform() | ||
{ | ||
var childAction = callback(); | ||
AddAction(childAction); | ||
|
||
await base.Perform(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) VolcanicArts. Licensed under the GPL-3.0 License. | ||
// See the LICENSE file in the repository root for full license text. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace VRCOSC.App.Actions; | ||
|
||
public class DynamicProgressAction : ProgressAction | ||
{ | ||
public override string Title { get; } | ||
private readonly Action callback; | ||
|
||
public DynamicProgressAction(string title, Action callback) | ||
{ | ||
Title = title; | ||
this.callback = callback; | ||
} | ||
|
||
protected override Task Perform() | ||
{ | ||
callback(); | ||
return Task.CompletedTask; | ||
} | ||
|
||
public override float GetProgress() => 0f; | ||
} | ||
|
||
public class DynamicAsyncProgressAction : ProgressAction | ||
{ | ||
public override string Title { get; } | ||
private readonly Func<Task> callback; | ||
|
||
public DynamicAsyncProgressAction(string title, Func<Task> callback) | ||
{ | ||
Title = title; | ||
this.callback = callback; | ||
} | ||
|
||
protected override async Task Perform() => await callback(); | ||
|
||
public override float GetProgress() => 0f; | ||
} |
Oops, something went wrong.