private void Start() { ObservableExtensions.Subscribe <int>(Observable.Where <int>((IObservable <M0>) this.SelectedID, (Func <M0, bool>)(x => x >= 0 && x < this.lstCoordinates.Count)), (Action <M0>)(x => { for (int index = 0; index < this.lstCoordinates.Count; ++index) { if (this.lstCoordinates[index].id == x) { this.SelectedLabel.set_text(this.lstCoordinates[index].coodeName.get_text()); this.filename = this.lstCoordinates[index].fileName; this.CardImage.set_texture((Texture)PngAssist.ChangeTextureFromByte(this.lstCoordinatesBase[x].pngData == null ? PngFile.LoadPngBytes(this.lstCoordinatesBase[x].FullPath) : this.lstCoordinatesBase[x].pngData, 0, 0, (TextureFormat)5, false)); } } if (!((Component)this.CardImage).get_gameObject().get_activeSelf()) { ((Component)this.CardImage).get_gameObject().SetActive(true); } for (int index = 0; index < this.lstCoordinates.Count; ++index) { if (this.lstCoordinates[index].id != x) { ((Graphic)this.lstCoordinates[index].image).set_color(Color.get_white()); } else { ((Graphic)this.lstCoordinates[index].image).set_color(Define.Get(Colors.Yellow)); } } })); }
public void SetData(int index, GameCoordinateFileInfo info, Action <bool> onClickAction) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type GameCoordinateFileInfoComponent.\u003CSetData\u003Ec__AnonStorey0 dataCAnonStorey0 = new GameCoordinateFileInfoComponent.\u003CSetData\u003Ec__AnonStorey0(); // ISSUE: reference to a compiler-generated field dataCAnonStorey0.onClickAction = onClickAction; // ISSUE: reference to a compiler-generated field dataCAnonStorey0.\u0024this = this; bool active = info != null; GameCoordinateFileInfoComponent.RowInfo row = this._rows[index]; ((Component)row.toggle).get_gameObject().SetActiveIfDifferent(active); ((UnityEventBase)row.toggle.onValueChanged).RemoveAllListeners(); if (!active) { return; } ((UnityEventBase)row.toggle.onValueChanged).RemoveAllListeners(); // ISSUE: method pointer ((UnityEvent <bool>)row.toggle.onValueChanged).AddListener(new UnityAction <bool>((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__0))); row.toggle.SetIsOnWithoutCallback(false); ((Selectable)row.toggle).set_interactable(!info.IsInSaveData); row.imageThumb.set_texture((Texture)PngAssist.ChangeTextureFromByte(info.PngData ?? PngFile.LoadPngBytes(info.FullPath), 0, 0, (TextureFormat)5, false)); row.objSelect.SetActiveIfDifferent(false); // ISSUE: reference to a compiler-generated field dataCAnonStorey0.sel = index; // ISSUE: method pointer row.pointerAction.listActionEnter.Add(new UnityAction((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__1))); // ISSUE: method pointer row.pointerAction.listActionExit.Add(new UnityAction((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__2))); row.info = info; }
IEnumerator LoadButtonsAsync(Transform parent, List <KeyValuePair <DateTime, string> > scenefiles) { string categoryText = category.captionText.text; string sceneFilePath = ""; foreach (var scene in scenefiles) { sceneFilePath = scene.Value; // Mod Orginizer fix if (!File.Exists(sceneFilePath)) { sceneFilePath = ModOrginizerPathFix(sceneFilePath); } LoadingIcon.loadingState[categoryText] = true; //Console.WriteLine("URL 1:" + scene.Value); using (WWW www = new WWW("file:///" + sceneFilePath)) { //Console.WriteLine("URL 2:"+scene.Value); yield return(www); if (!string.IsNullOrEmpty(www.error)) { throw new Exception(www.error); } CreateSceneButton(parent, PngAssist.ChangeTextureFromByte(www.bytes), sceneFilePath); } } LoadingIcon.loadingState[categoryText] = false; }
private void SetParameter(GameCoordinateFileInfo data, bool fromFolder) { this._objParameterWindow.get_activeSelf(); this._objParameterWindow.SetActiveIfDifferent(true); this._rawImageCoordinateCard.set_texture((Texture)PngAssist.ChangeTextureFromByte(PngFile.LoadPngBytes(data.FullPath), 0, 0, (TextureFormat)5, false)); ((Component)this._buttonInput).get_gameObject().SetActiveIfDifferent(fromFolder); ((Component)this._buttonOutput).get_gameObject().SetActiveIfDifferent(!fromFolder); }
protected override void OnBeforeStart() { ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.OnActiveChangedAsObservable(), (Action <M0>)(active => this.SetActiveControl(active))); // ISSUE: method pointer ((UnityEvent)this._charaButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__1))); 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()) { ((Transform)this._selectedImageTransform).set_localPosition(((Transform)this._element).get_localPosition()); } this._objPlayerParameterWindow.SetActiveIfDifferent(true); if (this._info == null) { return; } this._txtPlayerCharaName.set_text(this._info.name); this._riPlayerCard.set_texture((Texture)PngAssist.ChangeTextureFromByte(PngFile.LoadPngBytes(this._info.FullPath), 0, 0, (TextureFormat)5, false)); int languageInt = Singleton <GameSystem> .Instance.languageInt; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(this._info.sex != 0 ? this._localizeFemale[languageInt] : this._localizeMale[languageInt]); if (this._info.sex == 1 && this._info.futanari) { stringBuilder.Append(this._localizeFutanari[languageInt]); } this._txtPlayerSex.set_text(stringBuilder.ToString()); })); this._objPlayerParameterWindow.SetActiveIfDifferent(false); this._txtPlayerCharaName.set_text("NoName"); this._riPlayerCard.set_texture((Texture)null); this._txtPlayerSex.set_text(string.Empty); KeyCodeDownCommand keyCodeDownCommand = new KeyCodeDownCommand() { KeyCode = (KeyCode)324 }; // ISSUE: method pointer keyCodeDownCommand.TriggerEvent.AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__3))); this._keyCommands.Add(keyCodeDownCommand); // ISSUE: method pointer ((UnityEvent)this._closeButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__4))); Button.ButtonClickedEvent onClick = this._charaCreateButton.get_onClick(); // ISSUE: reference to a compiler-generated field if (PlayerLookEditUI.\u003C\u003Ef__am\u0024cache0 == null) { // ISSUE: reference to a compiler-generated field // ISSUE: method pointer PlayerLookEditUI.\u003C\u003Ef__am\u0024cache0 = new UnityAction((object)null, __methodptr(\u003COnBeforeStart\u003Em__5)); } // ISSUE: reference to a compiler-generated field UnityAction fAmCache0 = PlayerLookEditUI.\u003C\u003Ef__am\u0024cache0; ((UnityEvent)onClick).AddListener(fAmCache0); ((Component)this._selectedImageTransform).get_gameObject().SetActive(false); }
void PopulateGrid(bool forceUpdate = false) { var cache = cardTypes[currentType].cache; var categoryText = category.captionText.text; if (forceUpdate) { cache.Remove(categoryText); } if (cache.TryGetValue(categoryText, out CachedList cachedList)) { cachedList.list.gameObject.SetActive(true); } else { var scenefiles = (from s in Directory.GetFiles(GetCategoryFolder(), "*.png") select new KeyValuePair <DateTime, string>(File.GetLastWriteTime(s), s)).ToList(); scenefiles.Sort((KeyValuePair <DateTime, string> a, KeyValuePair <DateTime, string> b) => b.Key.CompareTo(a.Key)); var container = UIUtility.CreatePanel("GridContainer", imagelist.content.transform); container.transform.SetRect(0f, 0f, 1f, 1f); container.gameObject.AddComponent <ContentSizeFitter>().verticalFit = ContentSizeFitter.FitMode.PreferredSize; var gridlayout = container.gameObject.AddComponent <AutoGridLayout>(); gridlayout.spacing = new Vector2(marginSize, marginSize); gridlayout.m_IsColumn = true; gridlayout.m_Column = cardTypes[currentType].columnCount; gridlayout.aspectRatio = cardTypes[currentType].aspectRatio; StartCoroutine(LoadButtonsAsync(container.transform, scenefiles)); cache.Add(categoryText, new CachedList(container)); } IEnumerator LoadButtonsAsync(Transform parent, List <KeyValuePair <DateTime, string> > scenefiles) { foreach (var scene in scenefiles) { LoadingIcon.loadingState[categoryText] = true; using (WWW www = new WWW("file:///" + scene.Value)) { yield return(www); if (!string.IsNullOrEmpty(www.error)) { throw new Exception(www.error); } CreateSceneButton(parent, PngAssist.ChangeTextureFromByte(www.bytes), scene.Value); } } LoadingIcon.loadingState[categoryText] = false; } }
public void SetData(int _index, GameCharaFileInfo _info, Action <bool> _onClickAction) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type GameCharaFileInfoComponent.\u003CSetData\u003Ec__AnonStorey0 dataCAnonStorey0 = new GameCharaFileInfoComponent.\u003CSetData\u003Ec__AnonStorey0(); // ISSUE: reference to a compiler-generated field dataCAnonStorey0._onClickAction = _onClickAction; // ISSUE: reference to a compiler-generated field dataCAnonStorey0.\u0024this = this; bool active = _info != null; if (active) { active = _info.FullPath.IsNullOrEmpty() || !_info.FullPath.IsNullOrEmpty() && File.Exists(_info.FullPath) || _info.pngData != null; } ((Component)this.rows[_index].tgl).get_gameObject().SetActiveIfDifferent(active); ((UnityEventBase)this.rows[_index].tgl.onValueChanged).RemoveAllListeners(); if (!active) { return; } ((UnityEventBase)this.rows[_index].tgl.onValueChanged).RemoveAllListeners(); // ISSUE: method pointer ((UnityEvent <bool>) this.rows[_index].tgl.onValueChanged).AddListener(new UnityAction <bool>((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__0))); this.rows[_index].tgl.SetIsOnWithoutCallback(false); ((Selectable)this.rows[_index].tgl).set_interactable(!_info.isInSaveData); this.rows[_index].objEntry.SetActiveIfDifferent(_info.isInSaveData); this.rows[_index].objNurturing.SetActiveIfDifferent(_info.gameRegistration); if (Object.op_Inequality((Object)this.rows[_index].imgThumb.get_texture(), (Object)null) && Object.op_Inequality((Object)this.rows[_index].imgThumb.get_texture(), (Object)this.texEmpty)) { Object.Destroy((Object)this.rows[_index].imgThumb.get_texture()); this.rows[_index].imgThumb.set_texture((Texture)null); } if (_info.pngData != null || !_info.FullPath.IsNullOrEmpty()) { this.rows[_index].imgThumb.set_texture((Texture)PngAssist.ChangeTextureFromByte(_info.pngData ?? PngFile.LoadPngBytes(_info.FullPath), 0, 0, (TextureFormat)5, false)); } else { this.rows[_index].imgThumb.set_texture((Texture)this.texEmpty); } this.rows[_index].objSelect.SetActiveIfDifferent(false); // ISSUE: reference to a compiler-generated field dataCAnonStorey0.sel = _index; // ISSUE: method pointer this.rows[_index].pointerAction.listActionEnter.Add(new UnityAction((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__1))); // ISSUE: method pointer this.rows[_index].pointerAction.listActionExit.Add(new UnityAction((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__2))); this.rows[_index].info = _info; }
private void SetPlayerParameter(GameCharaFileInfo _data) { this.objPlayerParameterWindow.SetActiveIfDifferent(true); this.txtPlayerCharaName.set_text(_data.name); this.riPlayerCard.set_texture((Texture)PngAssist.ChangeTextureFromByte(PngFile.LoadPngBytes(_data.FullPath), 0, 0, (TextureFormat)5, false)); int languageInt = Singleton <GameSystem> .Instance.languageInt; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(_data.sex != 0 ? this.localizeFemale[languageInt] : this.localizeMale[languageInt]); if (_data.sex == 1 && _data.futanari) { stringBuilder.Append(this.localizeFutanari[languageInt]); } this.txtPlayerSex.set_text(stringBuilder.ToString()); }
public static Texture2D LoadResourceTexture(string resourceName) { try { using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)) { byte[] buffer = new byte[16 * 1024]; var pngData = ReadFully(stream); return(PngAssist.ChangeTextureFromByte(pngData)); } } catch (Exception) { Console.WriteLine("Error accessing resources"); throw; } }
IEnumerator ResaveScene() { if (bSavingInProgress) { yield break; } SaveScene(currentPath, true); bSavingInProgress = true; string file_path = currentPath; // (currentPath updated in onBtnClick event.) Transform curr_btn_trans = optionspanel.transform.parent; // Mod Orginizer fix if (!File.Exists(file_path)) { file_path = ModOrginizerPathFix(file_path); } Color orig_color = curr_btn_trans.gameObject.GetComponent <Image>().color; curr_btn_trans.gameObject.GetComponent <Image>().color = new Color(0f, 0f, 0f, 1f); yield return(new WaitForSeconds(0.3f)); curr_btn_trans.gameObject.GetComponent <Image>().color = orig_color; using (WWW www = new WWW("file:///" + file_path)) { yield return(www); if (!string.IsNullOrEmpty(www.error)) { throw new Exception(www.error); } Texture2D texture = PngAssist.ChangeTextureFromByte(www.bytes); var sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f)); curr_btn_trans.gameObject.GetComponent <Image>().sprite = sprite; bSavingInProgress = false; } optionspanel.gameObject.SetActive(false); confirmpanel.gameObject.SetActive(false); confirmpanel2.gameObject.SetActive(false); SetLastLoadedMarkParentObj(curr_btn_trans, true); }
IEnumerator LoadButtonsAsync(Transform parent, List <KeyValuePair <DateTime, string> > scenefiles) { string categoryText = category.captionText.text; foreach (var scene in scenefiles) { LoadingIcon.loadingState[categoryText] = true; using (WWW www = new WWW("file:///" + scene.Value)) { yield return(www); if (!string.IsNullOrEmpty(www.error)) { throw new Exception(www.error); } CreateSceneButton(parent, PngAssist.ChangeTextureFromByte(www.bytes), scene.Value); } } LoadingIcon.loadingState[categoryText] = false; }
private IEnumerator LoadButtonsAsync(Transform parent, List <KeyValuePair <DateTime, string> > scenefiles) { foreach (var scene in scenefiles) { LoadingIcon.loadingState[currentCategoryFolder] = true; #pragma warning disable CS0618 // Type or member is obsolete using (var www = new WWW("file:///" + scene.Value)) #pragma warning restore CS0618 { yield return(www); if (!string.IsNullOrEmpty(www.error)) { throw new Exception(www.error); } CreateSceneButton(parent, PngAssist.ChangeTextureFromByte(www.bytes), scene.Value); } } LoadingIcon.loadingState[currentCategoryFolder] = false; }
public void SetData( int _index, CustomCharaScrollController.ScrollData _data, Action <bool> _onClickAction, Action <string> _onPointerEnter, Action _onPointerExit) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type CustomCharaScrollViewInfo.\u003CSetData\u003Ec__AnonStorey0 dataCAnonStorey0 = new CustomCharaScrollViewInfo.\u003CSetData\u003Ec__AnonStorey0(); // ISSUE: reference to a compiler-generated field dataCAnonStorey0._onClickAction = _onClickAction; // ISSUE: reference to a compiler-generated field dataCAnonStorey0._onPointerEnter = _onPointerEnter; // ISSUE: reference to a compiler-generated field dataCAnonStorey0._onPointerExit = _onPointerExit; // ISSUE: reference to a compiler-generated field dataCAnonStorey0._info = _data?.info; // ISSUE: reference to a compiler-generated field bool active = dataCAnonStorey0._info != null; ((Component)this.rows[_index].tgl).get_gameObject().SetActiveIfDifferent(active); ((UnityEventBase)this.rows[_index].tgl.onValueChanged).RemoveAllListeners(); if (!active) { return; } ((UnityEventBase)this.rows[_index].tgl.onValueChanged).RemoveAllListeners(); // ISSUE: method pointer ((UnityEvent <bool>) this.rows[_index].tgl.onValueChanged).AddListener(new UnityAction <bool>((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__0))); EventTriggerNoScroll eventTriggerNoScroll = (EventTriggerNoScroll)((Component)this.rows[_index].tgl).get_gameObject().GetComponent <EventTriggerNoScroll>(); if (Object.op_Equality((Object)null, (Object)eventTriggerNoScroll)) { eventTriggerNoScroll = (EventTriggerNoScroll)((Component)this.rows[_index].tgl).get_gameObject().AddComponent <EventTriggerNoScroll>(); } eventTriggerNoScroll.triggers = new List <EventTriggerNoScroll.Entry>(); EventTriggerNoScroll.Entry entry1 = new EventTriggerNoScroll.Entry(); entry1.eventID = (EventTriggerType)0; // ISSUE: method pointer entry1.callback.AddListener(new UnityAction <BaseEventData>((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__1))); eventTriggerNoScroll.triggers.Add(entry1); EventTriggerNoScroll.Entry entry2 = new EventTriggerNoScroll.Entry(); entry2.eventID = (EventTriggerType)1; // ISSUE: method pointer entry2.callback.AddListener(new UnityAction <BaseEventData>((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__2))); eventTriggerNoScroll.triggers.Add(entry2); this.rows[_index].tgl.SetIsOnWithoutCallback(false); // ISSUE: reference to a compiler-generated field ((Selectable)this.rows[_index].tgl).set_interactable(!dataCAnonStorey0._info.isInSaveData); Color white = Color.get_white(); if (Object.op_Implicit((Object)this.rows[_index].imgEntry)) { // ISSUE: reference to a compiler-generated field ((Component)this.rows[_index].imgEntry).get_gameObject().SetActiveIfDifferent(dataCAnonStorey0._info.isInSaveData); // ISSUE: reference to a compiler-generated field if (dataCAnonStorey0._info.isInSaveData) { ((Color) ref white).\u002Ector(0.7843137f, 0.7843137f, 0.7843137f, 0.5019608f); } } if (Object.op_Implicit((Object)this.rows[_index].imgNurturing)) { // ISSUE: reference to a compiler-generated field ((Component)this.rows[_index].imgNurturing).get_gameObject().SetActiveIfDifferent(dataCAnonStorey0._info.gameRegistration); ((Graphic)this.rows[_index].imgNurturing).set_color(white); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field if (dataCAnonStorey0._info.pngData != null || !dataCAnonStorey0._info.FullPath.IsNullOrEmpty()) { if (Object.op_Implicit((Object)this.rows[_index].imgThumb.get_texture())) { Object.Destroy((Object)this.rows[_index].imgThumb.get_texture()); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field this.rows[_index].imgThumb.set_texture((Texture)PngAssist.ChangeTextureFromByte(dataCAnonStorey0._info.pngData ?? PngFile.LoadPngBytes(dataCAnonStorey0._info.FullPath), 0, 0, (TextureFormat)5, false)); } else { this.rows[_index].imgThumb.set_texture((Texture)this.texEmpty); } // ISSUE: reference to a compiler-generated field this.rows[_index].info = dataCAnonStorey0._info; }
public void CreateUI() { UISystem = UIUtility.CreateNewUISystem("BetterSceneLoaderCanvas"); UISystem.GetComponent <CanvasScaler>().referenceResolution = new Vector2(1920f / UIScale, 1080f / UIScale); ShowWindow(false); mainPanel = UIUtility.CreatePanel("Panel", UISystem.transform); mainPanel.color = backgroundColor; UIUtility.AddOutlineToObject(mainPanel.transform, outlineColor); var drag = UIUtility.CreatePanel("Draggable", mainPanel.transform); drag.transform.SetRect(0f, 1f, 1f, 1f, 0f, -headerSize); drag.color = dragColor; UIUtility.MakeObjectDraggable(drag.rectTransform, mainPanel.rectTransform); nametext = UIUtility.CreateText("Nametext", drag.transform, "Scenes"); nametext.transform.SetRect(0f, 0f, 1f, 1f, 340f, 0f, -buttonSize * 2f); nametext.alignment = TextAnchor.MiddleCenter; var close = UIUtility.CreateButton("CloseButton", drag.transform, ""); close.transform.SetRect(1f, 0f, 1f, 1f, -buttonSize * 2f); close.onClick.AddListener(() => ShowWindow(false)); var x1 = UIUtility.CreatePanel("x1", close.transform); x1.transform.SetRect(0f, 0f, 1f, 1f, 8f, 0f, -8f); x1.rectTransform.eulerAngles = new Vector3(0f, 0f, 45f); x1.color = new Color(0f, 0f, 0f, 1f); var x2 = UIUtility.CreatePanel("x2", close.transform); x2.transform.SetRect(0f, 0f, 1f, 1f, 8f, 0f, -8f); x2.rectTransform.eulerAngles = new Vector3(0f, 0f, -45f); x2.color = new Color(0f, 0f, 0f, 1f); var category = UIUtility.CreateDropdown("Dropdown", drag.transform, "Categories"); category.transform.SetRect(0f, 0f, 0f, 1f, 0f, 0f, 100f); category.captionText.transform.SetRect(0f, 0f, 1f, 1f, 0f, 2f, -15f, -2f); category.captionText.alignment = TextAnchor.MiddleCenter; category.options = GetCategories(); category.onValueChanged.AddListener(x => { currentCategoryFolder = CategoryFolders[category.options[x].text]; imagelist.content.GetComponentInChildren <Image>().gameObject.SetActive(false); imagelist.content.anchoredPosition = new Vector2(0f, 0f); PopulateGrid(); }); var refresh = UIUtility.CreateButton("RefreshButton", drag.transform, "Refresh"); refresh.transform.SetRect(0f, 0f, 0f, 1f, 100f, 0f, 180f); refresh.onClick.AddListener(ReloadImages); var save = UIUtility.CreateButton("SaveButton", drag.transform, "Save"); save.transform.SetRect(0f, 0f, 0f, 1f, 180f, 0f, 260f); save.interactable = false; save.onClick.AddListener(() => { string path = Path.Combine(currentCategoryFolder, DateTime.Now.ToString("yyyy_MMdd_HHmm_ss_fff") + ".png"); OnSaveButtonClick(path); var button = CreateSceneButton(imagelist.content.GetComponentInChildren <Image>().transform, PngAssist.LoadTexture(path), path); button.transform.SetAsFirstSibling(); }); var folder = UIUtility.CreateButton("FolderButton", drag.transform, "Folder"); folder.transform.SetRect(0f, 0f, 0f, 1f, 260f, 0f, 340f); folder.onClick.AddListener(() => OnFolderButtonClick(scenePath)); var loadingPanel = UIUtility.CreatePanel("LoadingIconPanel", drag.transform); loadingPanel.transform.SetRect(0f, 0f, 0f, 1f, 340f, 0f, 340f + headerSize); loadingPanel.color = new Color(0f, 0f, 0f, 0f); var loadingIcon = UIUtility.CreatePanel("LoadingIcon", loadingPanel.transform); loadingIcon.transform.SetRect(0.1f, 0.1f, 0.9f, 0.9f); var loadiconTex = PngAssist.ChangeTextureFromByte(Resource.GetResourceAsBytes(typeof(SceneLoaderUI).Assembly, "Resources.loadicon")); loadingIcon.sprite = Sprite.Create(loadiconTex, new Rect(0, 0, loadiconTex.width, loadiconTex.height), new Vector2(0.5f, 0.5f)); LoadingIcon.Init(loadingIcon, -5f); imagelist = UIUtility.CreateScrollView("Imagelist", mainPanel.transform); imagelist.transform.SetRect(0f, 0f, 1f, 1f, marginSize, marginSize, -marginSize, -headerSize - marginSize / 2f); imagelist.gameObject.AddComponent <Mask>(); imagelist.content.gameObject.AddComponent <VerticalLayoutGroup>(); imagelist.content.gameObject.AddComponent <ContentSizeFitter>().verticalFit = ContentSizeFitter.FitMode.PreferredSize; imagelist.verticalScrollbar.GetComponent <RectTransform>().offsetMin = new Vector2(scrollOffsetX, 0f); imagelist.viewport.offsetMax = new Vector2(scrollOffsetX, 0f); imagelist.movementType = ScrollRect.MovementType.Clamped; optionspanel = UIUtility.CreatePanel("ButtonPanel", imagelist.transform); optionspanel.gameObject.SetActive(false); confirmpanel = UIUtility.CreatePanel("ConfirmPanel", imagelist.transform); confirmpanel.gameObject.SetActive(false); yesbutton = UIUtility.CreateButton("YesButton", confirmpanel.transform, "Y"); yesbutton.transform.SetRect(0f, 0f, 0.5f, 1f); yesbutton.onClick.AddListener(() => OnDeleteButtonClick(currentPath)); nobutton = UIUtility.CreateButton("NoButton", confirmpanel.transform, "N"); nobutton.transform.SetRect(0.5f, 0f, 1f, 1f); nobutton.onClick.AddListener(() => confirmpanel.gameObject.SetActive(false)); var loadbutton = UIUtility.CreateButton("LoadButton", optionspanel.transform, "Load"); loadbutton.transform.SetRect(0f, 0f, 0.3f, 1f); loadbutton.onClick.AddListener(() => { confirmpanel.gameObject.SetActive(false); optionspanel.gameObject.SetActive(false); OnLoadButtonClick(currentPath); if (BetterSceneLoaderCore.AutoClose.Value) { ShowWindow(false); } }); var importbutton = UIUtility.CreateButton("ImportButton", optionspanel.transform, "Import"); importbutton.transform.SetRect(0.35f, 0f, 0.65f, 1f); importbutton.onClick.AddListener(() => { OnImportButtonClick(currentPath); confirmpanel.gameObject.SetActive(false); optionspanel.gameObject.SetActive(false); }); var deletebutton = UIUtility.CreateButton("DeleteButton", optionspanel.transform, "Delete"); deletebutton.transform.SetRect(0.7f, 0f, 1f, 1f); deletebutton.onClick.AddListener(() => { confirmpanel.gameObject.SetActive(true); currentButton.gameObject.SetActive(false); confirmpanel.gameObject.SetActive(false); optionspanel.gameObject.SetActive(false); }); var pluginiconTex = PngAssist.ChangeTextureFromByte(Resource.GetResourceAsBytes(typeof(SceneLoaderUI).Assembly, "Resources.pluginicon")); toolbarToggle = CustomToolbarButtons.AddLeftToolbarToggle(pluginiconTex, false, ShowWindow); UpdateWindow(); PopulateGrid(); }
protected override void OnBeforeStart() { ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.OnActiveChangedAsObservable(), (Action <M0>)(active => this.SetActiveControl(active))); ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.OnActiveParameterChangedAsObservable(), (Action <M0>)(active => this.SetActiveParameter(active))); this._selectFolder = new BoolReactiveProperty(); ObservableExtensions.Subscribe <bool>((IObservable <M0>) this._selectFolder, (Action <M0>)(x => { if (x) { ((Component)this._buttonInput).get_gameObject().SetActiveIfDifferent(true); ((Component)this._buttonOutput).get_gameObject().SetActiveIfDifferent(false); ((ReactiveProperty <bool>) this._isActiveParameter).set_Value(true); } else { ((ReactiveProperty <bool>) this._isActiveParameter).set_Value(false); } })); this._selectSaveData = new BoolReactiveProperty(); ObservableExtensions.Subscribe <bool>((IObservable <M0>) this._selectSaveData, (Action <M0>)(x => { if (x) { ((Component)this._buttonInput).get_gameObject().SetActiveIfDifferent(false); ((Component)this._buttonOutput).get_gameObject().SetActiveIfDifferent(true); ((ReactiveProperty <bool>) this._isActiveParameter).set_Value(true); } else { ((ReactiveProperty <bool>) this._isActiveParameter).set_Value(false); } })); this._folderCoordinateListUI.OnChangeItemFunc = (CoordinateListUI.ChangeItemFunc)(dat => { this._selectInfo = dat; if (dat == null) { return; } this._rawImageCoordinateCard.set_texture((Texture)PngAssist.ChangeTextureFromByte(PngFile.LoadPngBytes(dat.FullPath), 0, 0, (TextureFormat)5, false)); }); this._savedataCoordinateListUI.OnChangeItemFunc = (CoordinateListUI.ChangeItemFunc)(dat => { this._selectInfo = dat; if (dat == null) { return; } this._rawImageCoordinateCard.set_texture((Texture)PngAssist.ChangeTextureFromByte(PngFile.LoadPngBytes(dat.FullPath), 0, 0, (TextureFormat)5, false)); }); this._folderCoordinateListUI.OnChangeItem = (Action <bool>)(isOn => { if (isOn) { ((ReactiveProperty <bool>) this._selectSaveData).set_Value(!isOn); this._savedataCoordinateListUI.SelectDataClear(); this._savedataCoordinateListUI.SetNowSelectToggle(); ((ReactiveProperty <bool>) this._selectFolder).set_Value(isOn); } else { ((ReactiveProperty <bool>) this._selectFolder).set_Value(false); ((ReactiveProperty <bool>) this._selectSaveData).set_Value(false); } }); this._savedataCoordinateListUI.OnChangeItem = (Action <bool>)(isOn => { if (isOn) { ((ReactiveProperty <bool>) this._selectFolder).set_Value(!isOn); this._folderCoordinateListUI.SelectDataClear(); this._folderCoordinateListUI.SetNowSelectToggle(); ((ReactiveProperty <bool>) this._selectSaveData).set_Value(isOn); } else { ((ReactiveProperty <bool>) this._selectFolder).set_Value(false); ((ReactiveProperty <bool>) this._selectSaveData).set_Value(false); } }); if (Object.op_Implicit((Object)this._buttonInput)) { // ISSUE: method pointer ((UnityEvent)this._buttonInput.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__8))); } if (Object.op_Implicit((Object)this._buttonOutput)) { // ISSUE: method pointer ((UnityEvent)this._buttonOutput.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__9))); } KeyCodeDownCommand keyCodeDownCommand = new KeyCodeDownCommand() { KeyCode = (KeyCode)324 }; // ISSUE: method pointer keyCodeDownCommand.TriggerEvent.AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__A))); this._keyCommands.Add(keyCodeDownCommand); if (!Object.op_Implicit((Object)this._buttonClose)) { return; } // ISSUE: method pointer ((UnityEvent)this._buttonClose.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__B))); ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this._buttonClose), (Action <M0>)(_ => Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Select))); ((Component)this._buttonClose).get_gameObject().SetActiveIfDifferent(!this._hideClose); }
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); }
private void SetFemaleParameter(GameCharaFileInfo _data) { if (!_data.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.objFemalParameterRoots.Length; ++index) { this.objFemalParameterRoots[index].SetActiveIfDifferent(index == 0); } } this.txtFemaleCharaName.set_text(_data.name); this.riFemaleCard.set_texture((Texture)PngAssist.ChangeTextureFromByte(PngFile.LoadPngBytes(_data.FullPath), 0, 0, (TextureFormat)5, false)); for (int index = 0; index < this.sccStateOfProgress.Length; ++index) { this.sccStateOfProgress[index].OnChangeValue(_data.phase >= index ? 1 : 0); } string empty = string.Empty; this.txtLifeStyle.set_text(!Lifestyle.LifestyleName.TryGetValue(_data.lifeStyle, out empty) ? "--------------------" : (_data.lifeStyle != 4 ? empty : "E・シーカー")); string str1 = "--------"; this.txtGirlPower.set_text(!_data.gameRegistration ? str1 : _data.flavorState[0].ToString()); this.txtTrust.set_text(!_data.gameRegistration ? str1 : _data.flavorState[1].ToString()); this.txtHumanNature.set_text(!_data.gameRegistration ? str1 : _data.flavorState[2].ToString()); this.txtInstinct.set_text(!_data.gameRegistration ? str1 : _data.flavorState[3].ToString()); this.txtHentai.set_text(!_data.gameRegistration ? str1 : _data.flavorState[4].ToString()); this.txtVigilance.set_text(!_data.gameRegistration ? str1 : _data.flavorState[5].ToString()); this.txtSocial.set_text(!_data.gameRegistration ? str1 : _data.flavorState[7].ToString()); this.txtDarkness.set_text(!_data.gameRegistration ? str1 : _data.flavorState[6].ToString()); int languageInt = Singleton <GameSystem> .Instance.languageInt; List <string> stringList; for (int key = 0; key < this.txtNormalSkillSlots.Length; ++key) { string str2 = "--------------------"; if (_data.normalSkill.ContainsKey(key)) { str2 = !this.dicSkill.TryGetValue(_data.normalSkill[key], out stringList) ? "--------------------" : stringList[languageInt]; } this.txtNormalSkillSlots[key].set_text(str2); } for (int key = 0; key < this.txtHSkillSlots.Length; ++key) { string str2 = "--------------------"; if (_data.hSkill.ContainsKey(key)) { str2 = !this.dicHSkill.TryGetValue(_data.hSkill[key], out stringList) ? "--------------------" : stringList[languageInt]; } this.txtHSkillSlots[key].set_text(str2); } } 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(_data.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); } } }