public static MPCharCtrl MPCharCtrl(this ManipulatePanelCtrl _) { if (_MPCharCtrl == null) { var charaPanelInfo = Traverse.Create(Studio.Studio.Instance.manipulatePanelCtrl).Field("charaPanelInfo").GetValue(); _MPCharCtrl = (MPCharCtrl)Traverse.Create(charaPanelInfo).Property("mpCharCtrl").GetValue(); } return(_MPCharCtrl); }
public static void OnClickRoot(MPCharCtrl __instance, int _idx) { if (_idx == 0) { foreach (var stateCategory in _customCurrentStateCategories) { stateCategory.UpdateInfo(__instance.ociChar); } } }
public static MPCharCtrl GetMPCharCtrl(OCIChar _chara) { MPCharCtrl _charCtrl = GameObject.FindObjectOfType <MPCharCtrl>(); if (_charCtrl.ociChar == _chara) { return(_charCtrl); } return(null); }
private static void RootButtonCtrl_OnClick_Postfix(int _kind) { MPCharCtrl _mpc = GameObject.FindObjectOfType <MPCharCtrl>(); if (_mpc != null && Studio.Studio.Instance.treeNodeCtrl.selectNodes?.Length == 0) { TreeNodeObject _selected = Studio.Studio.Instance.dicInfo.Where(x => (x.Value as OCIChar) == _mpc.ociChar).Select(x => x.Key).FirstOrDefault(); Studio.Studio.Instance.treeNodeCtrl.SelectSingle(_selected, false); } }
public static void AwakePostfix(MPCharCtrl __instance) { ((Button)__instance.GetField("ikInfo").GetField("buttonReflectFK")).onClick.RemoveAllListeners(); ((Button)__instance.GetField("ikInfo").GetField("buttonReflectFK")).onClick.AddListener(delegate() { //__instance.CopyBoneFK((OIBoneInfo.BoneGroup)353); __instance.Invoke("CopyBoneFK", new object[] { OIBoneInfo.BoneGroup.Body }); }); ((Button[])__instance.GetField("fkInfo").GetField("buttonAnimeSingle"))[1].onClick.RemoveAllListeners(); ((Button[])__instance.GetField("fkInfo").GetField("buttonAnimeSingle"))[1].onClick.AddListener(delegate() { __instance.Invoke("CopyBoneFK", new object[] { OIBoneInfo.BoneGroup.Neck }); }); KK_StudioReflectFKFix.Logger.LogDebug("FK Fix Finish"); InitBtn(__instance); }
public static void OnClickRoot(MPCharCtrl __instance, int _idx) { IEnumerator DelayedUpdateTrigger() { // Need to wait for the selected character to change or we risk overwriting current character with new character's data yield return(CoroutineUtils.WaitForEndOfFrame); if (_idx == 0) { foreach (var stateCategory in _customCurrentStateCategories) { stateCategory.UpdateInfo(__instance.ociChar); } } } KoikatuAPI.Instance.StartCoroutine(DelayedUpdateTrigger()); }
private static void InitBtn(MPCharCtrl __instance) { var original = GameObject.Find("StudioScene/Canvas Main Menu/01_Add/00_Female/Button Change"); var parent = GameObject.Find("StudioScene/Canvas Main Menu/02_Manipulate/00_Chara/02_Kinematic/03_Neck"); btn = UnityEngine.Object.Instantiate(original, parent.transform); btn.name = "Copy FK Neck"; btn.transform.localPosition = new Vector3(0, -95, 0); btn.transform.SetRect(new Vector2(0, 1), new Vector2(0, 1), new Vector2(0, -116), new Vector2(190, -95)); btn.GetComponent <Image>().sprite = Extension.Extension.LoadNewSprite("KK_StudioReflectFKFix.Resources.CopyFKNeck.png", 183, 20); btn.GetComponent <Button>().onClick.RemoveAllListeners(); btn.GetComponent <Button>().onClick.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.Off); btn.GetComponent <Button>().interactable = true; btn.GetComponent <Button>().onClick.AddListener(() => { __instance.Invoke("CopyBoneFK", new object[] { OIBoneInfo.BoneGroup.Neck }); }); KK_StudioReflectFKFix.Logger.LogDebug("Draw Button Finish"); }
internal static bool RefreshCharaStatePanel() { if (!Loaded) { return(false); } MPCharCtrl MPCharCtrl = FindObjectOfType <MPCharCtrl>(); if (MPCharCtrl == null) { return(false); } int select = Traverse.Create(MPCharCtrl).Field <int>("select").Value; if (select != 0) { return(false); } MPCharCtrl.OnClickRoot(0); return(true); }
private static void MPCharCtrl_UpdateInfo_ChangeLabels(MPCharCtrl __instance) => KK_StudioAccessoryNames.instance.StartCoroutine(KK_StudioAccessoryNames.UpdateStudioLabelsDelayed(__instance.ociChar));
public static void AwakePostfix(MPCharCtrl __instance) { }
private static void MPCharCtrl_OnClickRoot(MPCharCtrl __instance) { StudioUI.InitializeStudioUI(__instance); }