Esempio n. 1
0
        internal static void InitHook(FreeHClassRoomCharaFile __instance)
        {
            if (_refreshing)
            {
                return;
            }

            _folderTreeView.DefaultPath   = Path.Combine(Utils.NormalizePath(UserData.Path), __instance.sex != 0 ? @"chara/female" : "chara/male");
            _folderTreeView.CurrentFolder = _folderTreeView.DefaultPath;

            _freeHFile = __instance;

            // todo Actually fix this instead of the workaround? Difficult
            _isLive = GameObject.Find("LiveStage") != null;

            _targetScene = Scene.Instance.AddSceneName;
        }
Esempio n. 2
0
        public static void FreeHClassRoomCharaFileStartPostfix(FreeHClassRoomCharaFile __instance)
        {
            ExtendedSave.LoadEventsEnabled = true;

            ReactiveProperty <ChaFileControl> info        = Traverse.Create(__instance).Field("info").GetValue <ReactiveProperty <ChaFileControl> >();
            ClassRoomFileListCtrl             listCtrl    = Traverse.Create(__instance).Field("listCtrl").GetValue <ClassRoomFileListCtrl>();
            List <CustomFileInfo>             lstFileInfo = Traverse.Create(listCtrl).Field("lstFileInfo").GetValue <List <CustomFileInfo> >();
            Button enterButton = Traverse.Create(__instance).Field("enterButton").GetValue <Button>();

            enterButton.onClick.RemoveAllListeners();
            enterButton.onClick.AddListener(() =>
            {
                var onEnter     = (Action <ChaFileControl>)AccessTools.Field(typeof(FreeHClassRoomCharaFile), "onEnter").GetValue(__instance);
                string fullPath = lstFileInfo.First(x => x.FileName == info.Value.charaFileName.Remove(info.Value.charaFileName.Length - 4)).FullPath;

                ChaFileControl chaFileControl = new ChaFileControl();
                chaFileControl.LoadCharaFile(fullPath, info.Value.parameter.sex, false, true);

                onEnter(chaFileControl);
            });
        }
Esempio n. 3
0
 private static void UpdateFileList(FreeHClassRoomCharaFile __instance)
 {
     lastFileList = __instance.listCtrl.lstFileInfo;
 }