예제 #1
0
 internal static void TranslateFileInfo(GameCharaFileInfo info, params TranslationResultHandler[] handlers)
 {
     if (info == null || !TranslationHelper.Instance.CurrentCardLoadTranslationEnabled)
     {
         return;
     }
     TranslateFileInfo(() => info.name, () => (CharacterSex)info.sex, n => info.SafeProc(i => i.name = n),
                       handlers);
 }
예제 #2
0
        internal static void TranslateFileInfo(GameCharaFileInfo info, params TranslationResultHandler[] handlers)
        {
            if (info == null || !TranslationHelper.Instance.CurrentCardLoadTranslationEnabled)
            {
                return;
            }
            var wrapper = CharaFileInfoWrapper.CreateWrapper(info);

            TranslationHelper.Instance.StartCoroutine(
                TranslationHelper.Instance.FileInfoTranslationManager.TranslateFileInfo(wrapper, handlers));
        }
예제 #3
0
        protected override void OnBeforeStart()
        {
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.OnActiveChangedAsObservable(), (System.Action <M0>)(active => this.SetActiveControl(active)));
            for (int index = 0; index < this._charaButtons.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey2 startCAnonStorey2 = new CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey2();
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey2.\u0024this = this;
                Button charaButton = this._charaButtons[index];
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey2.id = index;
                // ISSUE: method pointer
                ((UnityEvent)charaButton.get_onClick()).AddListener(new UnityAction((object)startCAnonStorey2, __methodptr(\u003C\u003Em__0)));
            }
            ObservableExtensions.Subscribe <int>((IObservable <M0>) this.OnSelectIDChangedAsObservable(), (System.Action <M0>)(x =>
            {
                ((Selectable)this._charaCreateButton).set_interactable(x != -1);
                ((UnityEngine.Component) this._selectedImageTransform).get_gameObject().SetActiveIfDifferent(x != -1);
                if (((UnityEngine.Component) this._selectedImageTransform).get_gameObject().get_activeSelf())
                {
                    ((Transform)this._selectedImageTransform).set_localPosition(((Transform)this._elements[x]).get_localPosition());
                }
                GameCharaFileInfo element = this._infos.GetElement <GameCharaFileInfo>(x);
                if (element == null)
                {
                    return;
                }
                if (!element.FullPath.IsNullOrEmpty())
                {
                    bool activeSelf = this._objFemaleParameterWindow.get_activeSelf();
                    this._objFemaleParameterWindow.SetActiveIfDifferent(true);
                    if (!activeSelf)
                    {
                        this._femaleParameterSelectNum = 0;
                        this._tglFemaleStateSelects[0].SetIsOnWithoutCallback(true);
                        for (int index = 0; index < this._objFemaleParameterRoots.Length; ++index)
                        {
                            this._objFemaleParameterRoots[index].SetActiveIfDifferent(index == 0);
                        }
                    }
                    this._txtFemaleCharaName.set_text(element.name);
                    this._riFemaleCard.set_texture((Texture)PngAssist.ChangeTextureFromByte(PngFile.LoadPngBytes(element.FullPath), 0, 0, (TextureFormat)5, false));
                    for (int index = 0; index < this._sccStateOfProgress.Length; ++index)
                    {
                        this._sccStateOfProgress[index].OnChangeValue(element.phase >= index ? 1 : 0);
                    }
                    string empty = string.Empty;
                    this._txtLifeStyle.set_text(!Lifestyle.LifestyleName.TryGetValue(element.lifeStyle, out empty) ? "--------------------" : (element.lifeStyle != 4 ? empty : "E・シーカー"));
                    this._txtGirlPower.set_text(element.flavorState[0].ToString());
                    this._txtTrust.set_text(element.flavorState[1].ToString());
                    this._txtHumanNature.set_text(element.flavorState[2].ToString());
                    this._txtInstinct.set_text(element.flavorState[3].ToString());
                    this._txtHentai.set_text(element.flavorState[4].ToString());
                    this._txtVigilance.set_text(element.flavorState[5].ToString());
                    this._txtSocial.set_text(element.flavorState[7].ToString());
                    this._txtDarkness.set_text(element.flavorState[6].ToString());
                    for (int key = 0; key < this._txtNormalSkillSlots.Length; ++key)
                    {
                        string str = "--------------------";
                        if (element.normalSkill.ContainsKey(key))
                        {
                            str = Singleton <Resources> .Instance.GameInfo.GetItem(16, element.normalSkill[key])?.Name ?? "--------------------";
                        }
                        this._txtNormalSkillSlots[key].set_text(str);
                    }
                    for (int key = 0; key < this._txtHSkillSlots.Length; ++key)
                    {
                        string str = "--------------------";
                        if (element.hSkill.ContainsKey(key))
                        {
                            str = Singleton <Resources> .Instance.GameInfo.GetItem(17, element.hSkill[key])?.Name ?? "--------------------";
                        }
                        this._txtHSkillSlots[key].set_text(str);
                    }
                }
                else
                {
                    this._txtFemaleCharaName.set_text(string.Empty);
                    this._riFemaleCard.set_texture((Texture)this._texEmpty);
                    for (int index = 0; index < this._sccStateOfProgress.Length; ++index)
                    {
                        this._sccStateOfProgress[index].OnChangeValue(element.phase >= index ? 1 : 0);
                    }
                    this._txtLifeStyle.set_text(string.Empty);
                    this._txtGirlPower.set_text(string.Empty);
                    this._txtTrust.set_text(string.Empty);
                    this._txtHumanNature.set_text(string.Empty);
                    this._txtInstinct.set_text(string.Empty);
                    this._txtHentai.set_text(string.Empty);
                    this._txtVigilance.set_text(string.Empty);
                    this._txtSocial.set_text(string.Empty);
                    this._txtDarkness.set_text(string.Empty);
                    for (int index = 0; index < this._txtNormalSkillSlots.Length; ++index)
                    {
                        string str = "--------------------";
                        this._txtNormalSkillSlots[index].set_text(str);
                    }
                    for (int index = 0; index < this._txtHSkillSlots.Length; ++index)
                    {
                        string str = "--------------------";
                        this._txtHSkillSlots[index].set_text(str);
                    }
                }
            }));
            this._objFemaleParameterWindow.SetActiveIfDifferent(false);
            this._txtFemaleCharaName.set_text("NoName");
            this._riFemaleCard.set_texture((Texture)null);
            for (int index = 0; index < this._sccStateOfProgress.Length; ++index)
            {
                this._sccStateOfProgress[index].OnChangeValue(index != 0 ? 0 : 1);
            }
            for (int index = 0; index < this._tglFemaleStateSelects.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey3 startCAnonStorey3 = new CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey3();
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey3.\u0024this = this;
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey3.sel = index;
                // ISSUE: reference to a compiler-generated method
                // ISSUE: reference to a compiler-generated method
                ObservableExtensions.Subscribe <bool>(Observable.Where <bool>(UnityEventExtensions.AsObservable <bool>((UnityEvent <M0>) this._tglFemaleStateSelects[index].onValueChanged), (Func <M0, bool>) new Func <bool, bool>(startCAnonStorey3.\u003C\u003Em__0)), (System.Action <M0>) new System.Action <bool>(startCAnonStorey3.\u003C\u003Em__1));
            }
            for (int index = 0; index < this._actionStateSelects.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey4 startCAnonStorey4 = new CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey4();
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey4.\u0024this = this;
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey4.sel = index;
                // ISSUE: method pointer
                this._actionStateSelects[index].listActionEnter.Add(new UnityAction((object)startCAnonStorey4, __methodptr(\u003C\u003Em__0)));
                // ISSUE: method pointer
                this._actionStateSelects[index].listActionExit.Add(new UnityAction((object)startCAnonStorey4, __methodptr(\u003C\u003Em__1)));
            }
            for (int index = 0; index < this._objFemaleStateSelectSels.Length; ++index)
            {
                this._objFemaleStateSelectSels[index].SetActiveIfDifferent(false);
            }
            this._txtLifeStyle.set_text(string.Empty);
            this._txtGirlPower.set_text("0");
            this._txtTrust.set_text("0");
            this._txtHumanNature.set_text("0");
            this._txtInstinct.set_text("0");
            this._txtHentai.set_text("0");
            this._txtVigilance.set_text("0");
            this._txtSocial.set_text("0");
            this._txtDarkness.set_text("0");
            for (int index = 0; index < this._txtNormalSkillSlots.Length; ++index)
            {
                this._txtNormalSkillSlots[index].set_text("--------------------");
            }
            for (int index = 0; index < this._txtHSkillSlots.Length; ++index)
            {
                this._txtHSkillSlots[index].set_text("--------------------");
            }
            KeyCodeDownCommand keyCodeDownCommand = new KeyCodeDownCommand()
            {
                KeyCode = (KeyCode)324
            };

            // ISSUE: method pointer
            keyCodeDownCommand.TriggerEvent.AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__2)));
            this._keyCommands.Add(keyCodeDownCommand);
            // ISSUE: method pointer
            ((UnityEvent)this._closeButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__3)));
            // ISSUE: method pointer
            ((UnityEvent)this._charaCreateButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__4)));
            ((Selectable)this._charaCreateButton).set_interactable(false);
            ((UnityEngine.Component) this._selectedImageTransform).get_gameObject().SetActive(false);
        }
예제 #4
0
        protected override void OnBeforeStart()
        {
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.OnActiveChangedAsObservable(), (Action <M0>)(active => this.SetActiveControl(active)));
            // ISSUE: method pointer
            ((UnityEvent)this._playerButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__2)));
            ObservableExtensions.Subscribe <int>((IObservable <M0>) this.OnSelectIDChangedAsObservable(), (Action <M0>)(x =>
            {
                ((Component)this._selectedImageTransform).get_gameObject().SetActiveIfDifferent(x != 1);
                if (!((Component)this._selectedImageTransform).get_gameObject().get_activeSelf())
                {
                    return;
                }
                ((Transform)this._selectedImageTransform).set_localPosition(((Transform)this._element).get_localPosition());
            }));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.OnActiveLCWChangedAsObservable(), (Action <M0>)(active => this.SetActiveControlLCW(active)));
            KeyCodeDownCommand keyCodeDownCommand = new KeyCodeDownCommand()
            {
                KeyCode = (KeyCode)324
            };

            // ISSUE: method pointer
            keyCodeDownCommand.TriggerEvent.AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__5)));
            this._keyCommands.Add(keyCodeDownCommand);
            // ISSUE: method pointer
            ((UnityEvent)this._closeButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__6)));
            this._lcw.onLoadItemFunc = (Action <GameCharaFileInfo>)(dat =>
            {
                PlayerData playerData = Singleton <Game> .Instance.WorldData.PlayerData;
                playerData.CharaFileNames[dat.sex] = dat.FileName;
                playerData.Sex = (byte)dat.sex;
                this._info     = dat;
                this._charaText.set_text(dat.name);
                ((ReactiveProperty <bool>) this._isActiveLCW).set_Value(false);
                Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.OK_L);
            });
            this._lcw.onClickRightFunc = (Action)(() =>
            {
                if (!((ReactiveProperty <bool>) this._isActiveLCW).get_Value())
                {
                    return;
                }
                ((ReactiveProperty <bool>) this._isActiveLCW).set_Value(false);
                Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Cancel);
            });
            this._lcw.onCloseWindowFunc = (GameLoadCharaWindow.OnCloseWindowFunc)(() =>
            {
                if (!((ReactiveProperty <bool>) this._isActiveLCW).get_Value())
                {
                    return;
                }
                ((ReactiveProperty <bool>) this._isActiveLCW).set_Value(false);
                Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Cancel);
            });
            this._lcw.onCharaCreateClickAction = (Action <int>)(sex =>
            {
                if (Singleton <Scene> .Instance.IsNowLoadingFade)
                {
                    return;
                }
                CharaCustom.CharaCustom.modeNew   = true;
                CharaCustom.CharaCustom.modeSex   = (byte)sex;
                CharaCustom.CharaCustom.actEixt   = (Action)null;
                CharaCustom.CharaCustom.nextScene = Singleton <Resources> .Instance.DefinePack.SceneNames.MapScene;
                Singleton <Scene> .Instance.LoadReserve(new Scene.Data()
                {
                    levelName = "CharaCustom",
                    isAdd     = false,
                    isFade    = true
                }, false);
                Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.OK_L);
            });
            ((Component)this._selectedImageTransform).get_gameObject().SetActive(false);
        }
예제 #5
0
        private void SetActiveControl(bool active)
        {
            Input       instance = Singleton <Input> .Instance;
            IEnumerator coroutine;

            if (active)
            {
                Time.set_timeScale(0.0f);
                ChaFileControl chaFileControl = new ChaFileControl();
                PlayerData     playerData     = Singleton <Game> .Instance.WorldData.PlayerData;
                if (!playerData.CharaFileName.IsNullOrEmpty() && chaFileControl.LoadCharaFile(playerData.CharaFileName, playerData.Sex, false, true))
                {
                    string          empty = string.Empty;
                    VoiceInfo.Param obj;
                    string          str1 = Singleton <Manager.Voice> .Instance.voiceInfoDic.TryGetValue(chaFileControl.parameter.personality, out obj) ? obj.Personality : "不明";

                    string str2 = playerData.Sex != (byte)0 ? string.Format("{0}chara/female/{1}.png", (object)UserData.Path, (object)playerData.CharaFileName) : string.Format("{0}chara/male/{1}.png", (object)UserData.Path, (object)playerData.CharaFileName);
                    this._info = new GameCharaFileInfo()
                    {
                        name             = chaFileControl.parameter.fullname,
                        personality      = str1,
                        voice            = chaFileControl.parameter.personality,
                        hair             = chaFileControl.custom.hair.kind,
                        birthMonth       = (int)chaFileControl.parameter.birthMonth,
                        birthDay         = (int)chaFileControl.parameter.birthDay,
                        strBirthDay      = chaFileControl.parameter.strBirthDay,
                        sex              = (int)chaFileControl.parameter.sex,
                        FullPath         = str2,
                        FileName         = playerData.CharaFileName,
                        gameRegistration = chaFileControl.gameinfo.gameRegistration,
                        flavorState      = new Dictionary <int, int>((IDictionary <int, int>)chaFileControl.gameinfo.flavorState),
                        phase            = chaFileControl.gameinfo.phase,
                        normalSkill      = new Dictionary <int, int>((IDictionary <int, int>)chaFileControl.gameinfo.normalSkill),
                        hSkill           = new Dictionary <int, int>((IDictionary <int, int>)chaFileControl.gameinfo.hSkill),
                        favoritePlace    = chaFileControl.gameinfo.favoritePlace,
                        futanari         = chaFileControl.parameter.futanari,
                        data_uuid        = chaFileControl.dataID
                    };
                }
                else
                {
                    this._info = (GameCharaFileInfo)null;
                }
                if (this._info != null)
                {
                    this._charaText.set_text(this._info.name);
                }
                else
                {
                    this._charaText.set_text("-----");
                }
                instance.FocusLevel   = 0;
                instance.MenuElements = this.MenuUIList;
                coroutine             = this.OpenCoroutine();
            }
            else
            {
                instance.ClearMenuElements();
                instance.FocusLevel = -1;
                coroutine           = this.CloseCoroutine();
            }
            if (this._fadeDisposable != null)
            {
                this._fadeDisposable.Dispose();
            }
            this._fadeDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => coroutine), false), (Action <M0>)(_ => {}), (Action <Exception>)(ex => Debug.LogException(ex)));
        }
예제 #6
0
        internal static void LobbySetGameCharaFileInfoPostfix(LobbyParameterUI __instance, GameCharaFileInfo _info)
        {
            if (_info == null || !TranslationHelper.Instance.CurrentCardLoadTranslationEnabled)
            {
                return;
            }

            void Handler(ITranslationResult result)
            {
                if (!result.Succeeded || string.IsNullOrEmpty(result.TranslatedText) || __instance == null)
                {
                    return;
                }
                __instance.SafeProc(inst => inst.txtCharaName.SafeProc(tcn => tcn.text = result.TranslatedText));
            }

            Translation.Hooks.TranslateFileInfo(_info, Handler);
        }
예제 #7
0
 internal static void LobbySetGameCharaFileInfoPrefix(GameCharaFileInfo _info)
 {
     Translation.Hooks.TranslateFileInfo(_info);
 }
예제 #8
0
        internal static void LobbySetGameCharaFileInfoPostfix(LobbyParameterUI __instance, GameCharaFileInfo _info)
        {
            if (_info == null || !TranslationHelper.Instance.CurrentCardLoadTranslationEnabled)
            {
                return;
            }

            void Handler(ITranslationResult result)
            {
                if (!result.Succeeded || string.IsNullOrEmpty(result.TranslatedText))
                {
                    return;
                }
                var txtCharaName = Traverse.Create(__instance)?.Field <Text>("txtCharaName")?.Value;

                if (txtCharaName == null)
                {
                    return;
                }
                txtCharaName.text = result.TranslatedText;
            }

            Translation.Hooks.TranslateFileInfo(_info, Handler);
        }