Alternate Control Styles Support (#554)

* add mouse controller

* support different control styles in options

deprecate old input check methods

* fully functional input actions system

* btsds InputAction

* blue bear InputAction

* more games

fix bugs with some input related systems

* coin toss re-toss

* cheer readers touch

* dog ninja touch

* multiple games

* last of the easy games' touch

* more specialized games

* specialized games 2

* finish ktb games

* remove legacy settings disclaimer

* "only" two games left

* karate man touch

* rockers touch

still needs fixes and bad judge strum

* DSGuy flicking animation

* playstyle chart property

* improve performance of minigame preloading

* improve look of cursor

make assetbundles use chunk-based compression
refactor assetbundle loading methods a bit

* prime conductor stream playback to stabilize seeking operations

* fix air rally swing on pad release

* use virtual mouse pointer

* add UniTask

* make BeatAction use UniTask

* implement UniTask to replace some coroutines

* add touch style UI elements and effects

games now support the ability to define two cursor colours if they need split screen touch inputs

* update plugins and buildscript

* implement thresholded pointer position clipping

* fix clamping

* instant show / hide

fix discord game SDK crashes
This commit is contained in:
minenice55
2023-10-29 15:44:47 -04:00
committed by GitHub
parent 4afa1f646c
commit 3002e48350
220 changed files with 55447 additions and 8426 deletions

View File

@ -10,6 +10,7 @@ using Jukebox;
using HeavenStudio.Util;
using HeavenStudio.Games;
using HeavenStudio.Common;
using Cysharp.Threading.Tasks;
namespace HeavenStudio
{
@ -51,6 +52,16 @@ namespace HeavenStudio
[NonSerialized] public RiqEntity currentSection, nextSection;
public double sectionProgress { get; private set; }
public bool GameHasSplitColours
{
get
{
var inf = GetGameInfo(currentGame);
if (inf == null) return false;
return inf.splitColorL != null && inf.splitColorR != null;
}
}
bool AudioLoadDone;
bool ChartLoadError;
@ -176,6 +187,7 @@ namespace HeavenStudio
if (playOnStart)
{
StartCoroutine(WaitReadyAndPlayCo(startBeat));
CircleCursor.LockCursor(true);
}
}
@ -338,15 +350,15 @@ namespace HeavenStudio
{
int aLen = a.Length;
int bLen = b.Length;
int ap = 0; int bp = 0;
while (ap < aLen && bp < bLen && a [ap] == b [bp])
while (ap < aLen && bp < bLen && a[ap] == b[bp])
{
ap++;
bp++;
}
return (bp == bLen);
}
@ -365,8 +377,7 @@ namespace HeavenStudio
if (inf != null && inf.usesAssetBundle && !inf.AssetsLoaded)
{
Debug.Log($"ASYNC loading assetbundles for game {gameName}");
StartCoroutine(inf.LoadCommonAssetBundleAsync());
StartCoroutine(inf.LoadLocalizedAssetBundleAsync());
inf.LoadAssetsAsync().Forget();
}
currentPreSwitch++;
}
@ -391,8 +402,7 @@ namespace HeavenStudio
if (inf != null && inf.usesAssetBundle && !inf.AssetsLoaded)
{
Debug.Log($"ASYNC loading assetbundles for game {gameName}");
StartCoroutine(inf.LoadCommonAssetBundleAsync());
StartCoroutine(inf.LoadLocalizedAssetBundleAsync());
inf.LoadAssetsAsync().Forget();
}
currentPreEvent++;
}
@ -619,7 +629,8 @@ namespace HeavenStudio
if (miniGame != null)
miniGame.OnPlay(beat);
}
Application.backgroundLoadingPriority = ThreadPriority.Low;
Conductor.instance.Play(beat);
}
@ -663,6 +674,10 @@ namespace HeavenStudio
{
Play(0, restartDelay);
}
else
{
Application.backgroundLoadingPriority = ThreadPriority.Normal;
}
// when rating screen gets added playOnStart will instead move to that scene
}
@ -946,7 +961,7 @@ namespace HeavenStudio
{
var gameInfo = GetGameInfo(game);
//load the games' sound sequences
// TODO: this blocks the main thread, and sound sequences sould be stored in a ScriptableObject
// TODO: sound sequences sould be stored in a ScriptableObject
if (gameInfo != null && gameInfo.LoadedSoundSequences == null)
gameInfo.LoadedSoundSequences = GetGame(game).GetComponent<Minigame>().SoundSequences;
}
@ -971,7 +986,9 @@ namespace HeavenStudio
if (gameInfo.usesAssetBundle)
{
//game is packed in an assetbundle, load from that instead
// this is fucked!! figure out a way to make this async
if (gameInfo.LoadedPrefab != null) return gameInfo.LoadedPrefab;
// StartCoroutine(gameInfo.LoadCommonAudioClipsAsync());
// StartCoroutine(gameInfo.LoadLocalizedAudioClipsAsync());
return gameInfo.GetCommonAssetBundle().LoadAsset<GameObject>(name);
}
name = gameInfo.LoadableName;
@ -985,20 +1002,20 @@ namespace HeavenStudio
return eventCaller.minigames.Find(c => c.name == name);
}
Color colMain;
public void SetCurrentGame(string game, bool useMinigameColor = true)
{
currentGame = game;
if (GetGameInfo(currentGame) != null)
{
CircleCursor.InnerCircle.GetComponent<SpriteRenderer>().color = Colors.Hex2RGB(GetGameInfo(currentGame).color);
if (useMinigameColor) HeavenStudio.StaticCamera.instance.SetAmbientGlowColour(Colors.Hex2RGB(GetGameInfo(currentGame).color), true);
//else HeavenStudio.StaticCamera.instance.SetAmbientGlowColour(HeavenStudio.GameCamera.currentColor, false);
colMain = Colors.Hex2RGB(GetGameInfo(currentGame).color);
CircleCursor.SetCursorColors(colMain, Colors.Hex2RGB(GetGameInfo(currentGame).splitColorL), Colors.Hex2RGB(GetGameInfo(currentGame).splitColorR));
if (useMinigameColor) HeavenStudio.StaticCamera.instance.SetAmbientGlowColour(colMain, true);
else HeavenStudio.StaticCamera.instance.SetAmbientGlowColour(Color.black, false);
}
else
{
CircleCursor.InnerCircle.GetComponent<SpriteRenderer>().color = Color.white;
//HeavenStudio.StaticCamera.instance.SetAmbientGlowColour(HeavenStudio.GameCamera.currentColor, false);
CircleCursor.SetCursorColors(Color.white, Color.white, Color.white);
HeavenStudio.StaticCamera.instance.SetAmbientGlowColour(Color.black, false);
}
}