Skip to content

Commit

Permalink
Change outfit on replacing character in Studio if the new character h…
Browse files Browse the repository at this point in the history
…as fewer additional outfits than the current selected outfit
  • Loading branch information
DeathWeasel1337 committed Jan 5, 2022
1 parent 3fcf8d1 commit 4e8f1e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/MoreOutfits.Core/MoreOutfits.CharaController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using KKAPI;
using KKAPI.Chara;
using KKAPI.Maker;
using KKAPI.Studio;
using MessagePack;
using System.Collections.Generic;

Expand Down Expand Up @@ -30,6 +31,12 @@ protected override void OnReload(GameMode currentGameMode, bool maintainState)
if (maintainState)
return;

if (StudioAPI.InsideStudio && ChaControl.fileStatus.coordinateType >= ChaControl.chaFile.coordinate.Length)
{
var ociChar = ChaControl.GetOCIChar();
ociChar.SetCoordinateInfo(0);
}

var loadFlags = MakerAPI.GetCharacterLoadFlags();
if (loadFlags == null || loadFlags.Clothes)
{
Expand Down
6 changes: 3 additions & 3 deletions src/MoreOutfits.Core/MoreOutfits.UI.Studio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class StudioUI
private static bool StudioUIInitialized = false;

#if KK
private static readonly List<string> CoordinateNames = new List<string> { "学生服(校内)", "学生服(下校)", "体操着", "水着", "部活", "私服", "お泊り" };
private static readonly List<string> CoordinateNames = new List<string> { "学生服(校内)", "学生服(下校)", "体操着", "水着", "部活", "私服", "お泊り" };
#elif KKS
private static readonly List<string> CoordinateNames = new List<string> { "私服", "水着", "寝間着", "風呂場", "お風呂" };
#endif
Expand All @@ -29,7 +29,7 @@ public static void RegisterStudioControls()
StudioCoordinateCurrentStateCategoryDropdown = new CurrentStateCategoryDropdown("Coordinate", CoordinateNames.ToArray(), c => CoordinateIndex());
StudioCoordinateCurrentStateCategoryDropdown.Value.Subscribe(value =>
{
var mpCharCtrol = UnityEngine.Object.FindObjectOfType<MPCharCtrl>();
var mpCharCtrol = Object.FindObjectOfType<MPCharCtrl>();
if (StudioCoordinateDropdown != null)
{
var character = StudioAPI.GetSelectedCharacters().First();
Expand All @@ -45,7 +45,7 @@ public static void RegisterStudioControls()
{
StudioCoordinateDropdown.options.Add(new Dropdown.OptionData(GetCoodinateName(character.charInfo, OriginalCoordinateLength + i)));
}
StudioCoordinateDropdown.captionText.text = StudioCoordinateDropdown.options[StudioCoordinateDropdown.value].text;
StudioCoordinateDropdown.captionText.text = StudioCoordinateDropdown.options[value].text;
}
}

Expand Down

0 comments on commit 4e8f1e0

Please sign in to comment.