forked from akanyan/mu3-mods
feat!: NaiveRating -> MoreProfileOptions
This commit is contained in:
24
Extras/MoreProfileOptions/MU3/patch_ANM_SWH_Profile.cs
Normal file
24
Extras/MoreProfileOptions/MU3/patch_ANM_SWH_Profile.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using MU3.User;
|
||||
using MU3.Util;
|
||||
using MU3.Mod;
|
||||
|
||||
namespace MU3;
|
||||
|
||||
class patch_ANM_SWH_Profile: ANM_SWH_Profile {
|
||||
public extern void orig_setUpLogin();
|
||||
|
||||
// Fixes login display
|
||||
public new void setUpLogin() {
|
||||
UserManager instance = Singleton<UserManager>.instance;
|
||||
var up = instance.userPreview;
|
||||
if(NaiveRating.IsEnabled()) {
|
||||
up.dispRating = 0;
|
||||
instance.userPreview = up;
|
||||
orig_setUpLogin();
|
||||
up.dispRating = 2;
|
||||
instance.userPreview = up;
|
||||
} else {
|
||||
orig_setUpLogin();
|
||||
}
|
||||
}
|
||||
}
|
51
Extras/MoreProfileOptions/MU3/patch_BattleUI.cs
Normal file
51
Extras/MoreProfileOptions/MU3/patch_BattleUI.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using MU3.DB;
|
||||
using MU3.Game;
|
||||
using MU3.User;
|
||||
using MU3.Util;
|
||||
|
||||
namespace MU3;
|
||||
class patch_BattleUI: BattleUI {
|
||||
private UIRetireInfo _retireInfo;
|
||||
private SessionInfo _sessionInfo;
|
||||
public new void setRetireInfo(UserOption.eAbort abort) {
|
||||
UIRetireInfo.Rank rank;
|
||||
int num;
|
||||
|
||||
var pabort = (patch_UserOption.eAbort)abort;
|
||||
switch(pabort) {
|
||||
case patch_UserOption.eAbort.S:
|
||||
rank = UIRetireInfo.Rank.S;
|
||||
num = 1010000 - TechnicalRankID.S.getLower();
|
||||
break;
|
||||
case patch_UserOption.eAbort.SS:
|
||||
rank = UIRetireInfo.Rank.SS;
|
||||
num = 1010000 - TechnicalRankID.SS.getLower();
|
||||
break;
|
||||
case patch_UserOption.eAbort.SSS:
|
||||
rank = UIRetireInfo.Rank.SSS;
|
||||
num = 1010000 - TechnicalRankID.SSS.getLower();
|
||||
break;
|
||||
case patch_UserOption.eAbort.SSS1:
|
||||
rank = UIRetireInfo.Rank.S;
|
||||
num = 1010000 - TechnicalRankID.SSS1.getLower();
|
||||
break;
|
||||
case patch_UserOption.eAbort.PB:
|
||||
UserManager userManager = Singleton<UserManager>.instance;
|
||||
var userFumen = userManager.getUserFumen(_sessionInfo.musicData.id, _sessionInfo.musicLevel, create: false);
|
||||
var previousPb = userFumen?.TechScoreMax ?? 0;
|
||||
rank = UIRetireInfo.Rank.S;
|
||||
num = 1010000 - previousPb;
|
||||
break;
|
||||
case patch_UserOption.eAbort.FB:
|
||||
case patch_UserOption.eAbort.ZERO:
|
||||
rank = UIRetireInfo.Rank.S;
|
||||
num = 1010000;
|
||||
break;
|
||||
default:
|
||||
rank = UIRetireInfo.Rank.MAX;
|
||||
num = 0;
|
||||
break;
|
||||
}
|
||||
_retireInfo.setupRetireInfo(rank, num);
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
using MU3.CustomUI;
|
||||
using MU3.User;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3;
|
||||
|
||||
class patch_OptionMiniSummaryController: OptionMiniSummaryController {
|
||||
private GameObject[] arrayIcon = new GameObject[35];
|
||||
private extern void orig_setParam(UserOption.OptionName id, int value);
|
||||
private void setParam(UserOption.OptionName id, int value) {
|
||||
var comp = arrayIcon[(int)id].transform.Find("NUL_Option_mini_Icon/TXT_Option_mini").GetComponent<MU3Text>();
|
||||
if(id == UserOption.OptionName.Rating) {
|
||||
switch(value) {
|
||||
case 0:
|
||||
comp.text = "OFF";
|
||||
break;
|
||||
case 1:
|
||||
comp.text = "TYPE-A";
|
||||
break;
|
||||
case 2:
|
||||
comp.text = "TYPE-B";
|
||||
break;
|
||||
}
|
||||
} else if(id == UserOption.OptionName.Abort) {
|
||||
switch(value) {
|
||||
case 0:
|
||||
comp.text = "OFF";
|
||||
break;
|
||||
case 1:
|
||||
comp.text = "S未達で中断";
|
||||
break;
|
||||
case 2:
|
||||
comp.text = "SS未達で中断";
|
||||
break;
|
||||
case 3:
|
||||
comp.text = "SSS未達で中断";
|
||||
break;
|
||||
case 4:
|
||||
comp.text = "SSS+未達で中断";
|
||||
break;
|
||||
case 5:
|
||||
comp.text = "PB未達で中断";
|
||||
break;
|
||||
case 6:
|
||||
comp.text = "FB未達で中断";
|
||||
break;
|
||||
case 7:
|
||||
comp.text = "スコア表示";
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
orig_setParam(id, value);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
using MonoMod;
|
||||
using MU3.CustomUI;
|
||||
using MU3.User;
|
||||
using MU3.Util;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3;
|
||||
|
||||
class patch_OptionSelecterController: OptionSelecterController {
|
||||
private chengeParamFuncArray[] cpFuncArray = new chengeParamFuncArray[35];
|
||||
|
||||
[MonoModIgnore]
|
||||
private extern void setInputCursor(int currentParam);
|
||||
|
||||
public extern void orig_init(UserOption.OptionName id);
|
||||
public new void init(UserOption.OptionName id) {
|
||||
orig_init(id);
|
||||
cpFuncArray[33].max = 2;
|
||||
cpFuncArray[4].max = 7;
|
||||
|
||||
if(id == UserOption.OptionName.Rating) {
|
||||
var rct = transform.Find("NUL_SWH_Option_00/NUL_Select/PAT_OnOff").GetComponent<RectTransform>();
|
||||
var changer = transform.Find("NUL_SWH_Option_00/NUL_Select/PAT_OnOff").GetComponent<MU3UIImageChanger>();
|
||||
|
||||
rct.anchoredPosition = new Vector3(0f, -5f, 0);
|
||||
rct.sizeDelta = new Vector2(158, 70);
|
||||
|
||||
var spritesFi = typeof(MU3UIImageChanger).GetField("_sprites", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
var tex = ((Sprite[])spritesFi.GetValue(changer))[0].texture;
|
||||
var newSprites = new Sprite[3];
|
||||
spritesFi.SetValue(changer, newSprites);
|
||||
|
||||
changer.setSprite(0, Sprite.Create(tex, new Rect(1552.0f, 366.0f, 160.0f, 65.0f), new Vector2(80.0f, 0.0f)));
|
||||
changer.setSprite(1, Sprite.Create(tex, new Rect(1221.0f, 1488.0f, 160.0f, 70.0f), new Vector2(80.0f, 35.0f)));
|
||||
changer.setSprite(2, Sprite.Create(tex, new Rect(1221.0f, 1410.0f, 160.0f, 70.0f), new Vector2(80.0f, 35.0f)));
|
||||
|
||||
setInputCursor((int)Singleton<UserManager>.instance.userOption.customSet.Rating);
|
||||
}
|
||||
}
|
||||
|
||||
private extern void orig_chengeParamOther(int currentParam);
|
||||
private void chengeParamOther(int currentParam) {
|
||||
if(myOptionId == UserOption.OptionName.Rating) {
|
||||
var changer = transform.Find("NUL_SWH_Option_00/NUL_Select/PAT_OnOff").GetComponent<MU3UIImageChanger>();
|
||||
changer.patternNumber = currentParam;
|
||||
Singleton<UserManager>.instance.userOption.customSet.Rating = (UserOption.eRating)currentParam;
|
||||
SingletonMonoBehaviour<SystemUI>.instance.userData.setUserDetail();
|
||||
} else {
|
||||
orig_chengeParamOther(currentParam);
|
||||
}
|
||||
}
|
||||
|
||||
private extern void orig_chengeParamAbort(int currentParam);
|
||||
private void chengeParamAbort(int currentParam) {
|
||||
string text = "NUL_SWH_Option_00/NUL_Select/PAT_Clear";
|
||||
GameObject gameObject = transform.Find(text).gameObject;
|
||||
MU3UIImageChanger component = gameObject.GetComponent<MU3UIImageChanger>();
|
||||
component.patternNumber = currentParam > 4 ? 0 : currentParam;
|
||||
}
|
||||
}
|
54
Extras/MoreProfileOptions/MU3/patch_UIResultBattlePoint.cs
Normal file
54
Extras/MoreProfileOptions/MU3/patch_UIResultBattlePoint.cs
Normal file
@ -0,0 +1,54 @@
|
||||
using MonoMod;
|
||||
using MU3.CustomUI;
|
||||
using MU3.Sequence;
|
||||
using MU3.User;
|
||||
using MU3.Mod;
|
||||
using MU3.Game;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3;
|
||||
|
||||
class patch_UIResultBattlePoint: UIResultBattlePoint {
|
||||
private Animator animator_;
|
||||
private patch_MU3UICounter counterScore_;
|
||||
private MU3UIImageChanger imageHeader_;
|
||||
private MU3UICounter counterScorePlus_;
|
||||
private MU3UICounter counterScoreMinus_;
|
||||
private GameObject hideScore_;
|
||||
|
||||
[MonoModIgnore]
|
||||
private extern void disable(MU3UICounter counter);
|
||||
|
||||
public extern void orig_initTechRating(PlayInfo playInfo);
|
||||
public new void initTechRating(PlayInfo playInfo) {
|
||||
counterScore_.isDispSuffix = NaiveRating.IsEnabled();
|
||||
if(!NaiveRating.IsEnabled()) {
|
||||
orig_initTechRating(playInfo);
|
||||
return;
|
||||
}
|
||||
int prevRating = ((patch_SessionResult)playInfo.sessionResult).prevNaiveRating;
|
||||
int rating1 = NaiveRating.Get();
|
||||
|
||||
UnityEngine.Debug.Log(prevRating + " " + rating1);
|
||||
if((bool)hideScore_) {
|
||||
hideScore_.SetActive(false);
|
||||
}
|
||||
counterScore_.Counter = (double)UserUtil.toRatingFloat(rating1);
|
||||
int ratingPatternNo = UserUtil.toRatingPatternNo(rating1);
|
||||
counterScore_.SpriteIndex = ratingPatternNo;
|
||||
imageHeader_.patternNumber = (float)ratingPatternNo;
|
||||
int rating2 = rating1 - prevRating;
|
||||
if(rating2 == 0) {
|
||||
disable(counterScorePlus_);
|
||||
disable(counterScoreMinus_);
|
||||
animator_.SetInteger(Sys.Const.AnimatorID_State, 2);
|
||||
} else if(0 < rating2) {
|
||||
disable(counterScoreMinus_);
|
||||
if((bool)counterScorePlus_) {
|
||||
counterScorePlus_.Counter = rating2 * 0.01f + 1E-05f;
|
||||
}
|
||||
animator_.SetInteger(Sys.Const.AnimatorID_State, 0);
|
||||
}
|
||||
animator_.SetTrigger(Sys.Const.AnimatorID_In);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user