| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906 | 
							- using System;
 
- using System.Collections;
 
- using System.Collections.Generic;
 
- using I2.Loc;
 
- using UnityEngine;
 
- using wf;
 
- using Yotogis;
 
- public class FreeSkillSelect : MonoBehaviour
 
- {
 
- 	public void Awake()
 
- 	{
 
- 		if (this.update_obj_dic_ != null)
 
- 		{
 
- 			return;
 
- 		}
 
- 		this.update_obj_dic_ = new Dictionary<string, FreeSkillSelect.UpdateObject>();
 
- 		Func<GameObject, FreeSkillSelect.UpdateObject> func = delegate(GameObject top_obj)
 
- 		{
 
- 			GameObject childObject = UTY.GetChildObject(top_obj, "Content", false);
 
- 			FreeSkillSelect.UpdateObject updateObject = new FreeSkillSelect.UpdateObject();
 
- 			updateObject.storage_obj = UTY.GetChildObject(childObject, "StorageRoom", true);
 
- 			updateObject.arrow_obj = UTY.GetChildObject(top_obj, "Arrow", false);
 
- 			updateObject.ui_panel = childObject.GetComponent<UIPanel>();
 
- 			updateObject.scroll_view = childObject.GetComponent<UIScrollView>();
 
- 			updateObject.button_parent = UTY.GetChildObject(childObject, "GridParent", false);
 
- 			updateObject.ui_grid = updateObject.button_parent.GetComponent<UIGrid>();
 
- 			updateObject.tab_panel = updateObject.button_parent.GetComponent<UIWFTabPanel>();
 
- 			return updateObject;
 
- 		};
 
- 		string[] array = new string[]
 
- 		{
 
- 			"TypeCategoryViewer",
 
- 			"CategoryViewer",
 
- 			"SkillSelectViewer",
 
- 			"LevelViewer",
 
- 			"StageSelectViewer"
 
- 		};
 
- 		string[] array2 = new string[]
 
- 		{
 
- 			"タイプ",
 
- 			"カテゴリー",
 
- 			"スキル",
 
- 			"レベル",
 
- 			"ステージ"
 
- 		};
 
- 		for (int i = 0; i < array.Length; i++)
 
- 		{
 
- 			this.update_obj_dic_.Add(array2[i], func(UTY.GetChildObject(base.gameObject, array[i], false)));
 
- 		}
 
- 		this.select_stage_ = (this.user_request_stage = YotogiStage.GetAllDatas(true)[0]);
 
- 	}
 
- 	public void Start()
 
- 	{
 
- 	}
 
- 	public void SetMaid(Maid maid)
 
- 	{
 
- 		this.maid_ = maid;
 
- 	}
 
- 	public void SetYotogiManager(YotogiManager yotogi_mgr)
 
- 	{
 
- 		this.yotogi_mgr_ = yotogi_mgr;
 
- 	}
 
- 	public void CreateInstanceButton()
 
- 	{
 
- 		if (this.button_data_list_ != null)
 
- 		{
 
- 			return;
 
- 		}
 
- 		FreeSkillSelect.UpdateObject updateObject = this.update_obj_dic_["ステージ"];
 
- 		FreeSkillSelect.UpdateObject updateObject2 = this.update_obj_dic_["タイプ"];
 
- 		FreeSkillSelect.UpdateObject updateObject3 = this.update_obj_dic_["レベル"];
 
- 		foreach (KeyValuePair<string, FreeSkillSelect.UpdateObject> keyValuePair in this.update_obj_dic_)
 
- 		{
 
- 			FreeSkillSelect.UpdateObject value = keyValuePair.Value;
 
- 			value.Clear();
 
- 			value.Update();
 
- 		}
 
- 		int clubGrade = GameMain.Instance.CharacterMgr.status.clubGrade;
 
- 		HashSet<int> hashSet = new HashSet<int>();
 
- 		List<YotogiStage.Data> allDatas = YotogiStage.GetAllDatas(true);
 
- 		allDatas.Sort();
 
- 		foreach (YotogiStage.Data data in allDatas)
 
- 		{
 
- 			if (data.isYotogiPlayable(this.maid_, clubGrade, false))
 
- 			{
 
- 				string a = string.Empty;
 
- 				for (int i = 0; i < 2; i++)
 
- 				{
 
- 					if (!string.IsNullOrEmpty(data.prefabName[i]) && !(a == data.prefabName[i]))
 
- 					{
 
- 						GameObject gameObject = Utility.CreatePrefab(updateObject.button_parent, "SceneYotogi/StageSelect/Prefab/StageUnit", true);
 
- 						a = (gameObject.name = data.prefabName[0]);
 
- 						YotogiStageUnit component = gameObject.GetComponent<YotogiStageUnit>();
 
- 						component.SetStageData(data, true, i == 0);
 
- 						component.SetOnSelectEvent(new YotogiStageUnit.OnSelectEvent(this.OnClickStageEvent));
 
- 						component.is_change_bg = false;
 
- 						if (!hashSet.Contains(data.id))
 
- 						{
 
- 							hashSet.Add(data.id);
 
- 						}
 
- 					}
 
- 				}
 
- 			}
 
- 		}
 
- 		updateObject.Update();
 
- 		this.button_data_list_ = FreeSkillSelect.CreateButtonData(this.maid_, hashSet);
 
- 		GameObject button_parent = updateObject3.button_parent;
 
- 		for (int j = 0; j < 3; j++)
 
- 		{
 
- 			EventDelegate onclick_event = new EventDelegate(this, "OnClickLevelBtnEvent");
 
- 			UIWFTabButton uiwftabButton = this.CreateTypeAndCategoryButton(updateObject3, "Lv." + (j + 1).ToString(), null, true, onclick_event);
 
- 			uiwftabButton.name = (j + 1).ToString();
 
- 		}
 
- 		updateObject3.Update();
 
- 		List<Transform> childList = updateObject3.ui_grid.GetChildList();
 
- 		for (int k = 0; k < childList.Count; k++)
 
- 		{
 
- 			UIWFTabButton componentInChildren = childList[k].gameObject.GetComponentInChildren<UIWFTabButton>();
 
- 			if (!(componentInChildren == null) && componentInChildren.isEnabled)
 
- 			{
 
- 				updateObject3.tab_panel.Select(componentInChildren);
 
- 				break;
 
- 			}
 
- 		}
 
- 		GameObject button_parent2 = updateObject2.button_parent;
 
- 		for (int l = 0; l < this.button_data_list_.Count; l++)
 
- 		{
 
- 			FreeSkillSelect.ButtonData buttonData = this.button_data_list_[l];
 
- 			EventDelegate eventDelegate = new EventDelegate(this, "OnClickTypeBtnEvent");
 
- 			eventDelegate.parameters[0].value = buttonData;
 
- 			if (buttonData.children_list.Count != 0)
 
- 			{
 
- 				buttonData.tab_button_obj = this.CreateTypeAndCategoryButton(updateObject2, buttonData.name, buttonData.nameTerm, 0 < this.button_data_list_[l].children_list.Count, eventDelegate);
 
- 				bool flag = false;
 
- 				foreach (FreeSkillSelect.ButtonData buttonData2 in buttonData.children_list)
 
- 				{
 
- 					foreach (FreeSkillSelect.ButtonData buttonData3 in buttonData2.children_list)
 
- 					{
 
- 						Skill.Data skill_data = buttonData3.skill_data;
 
- 						if (1 < skill_data.user_player_num && 0 < skill_data.recollectionHaremLockPersonalIds.Count)
 
- 						{
 
- 							int num = 1;
 
- 							while (num < skill_data.user_player_num && !flag)
 
- 							{
 
- 								Maid maid = GameMain.Instance.CharacterMgr.GetMaid(num);
 
- 								if (maid != null && !skill_data.recollectionHaremLockPersonalIds.Contains(maid.status.personal.id))
 
- 								{
 
- 									flag = true;
 
- 								}
 
- 								num++;
 
- 							}
 
- 						}
 
- 						else
 
- 						{
 
- 							flag = true;
 
- 						}
 
- 					}
 
- 				}
 
- 				buttonData.tab_button_obj.isEnabled = flag;
 
- 			}
 
- 		}
 
- 		updateObject2.Update();
 
- 		childList = updateObject2.ui_grid.GetChildList();
 
- 		for (int m = 0; m < childList.Count; m++)
 
- 		{
 
- 			UIWFTabButton componentInChildren2 = childList[m].gameObject.GetComponentInChildren<UIWFTabButton>();
 
- 			if (!(componentInChildren2 == null) && componentInChildren2.isEnabled)
 
- 			{
 
- 				updateObject2.tab_panel.Select(componentInChildren2);
 
- 				break;
 
- 			}
 
- 		}
 
- 	}
 
- 	public void SelectSkill(Skill.Data skill, YotogiStage.Data stage_data)
 
- 	{
 
- 		if (skill == null)
 
- 		{
 
- 			return;
 
- 		}
 
- 		FreeSkillSelect.ButtonData buttonData = null;
 
- 		FreeSkillSelect.ButtonData buttonData2 = null;
 
- 		FreeSkillSelect.ButtonData buttonData3 = null;
 
- 		bool flag = true;
 
- 		int num = 0;
 
- 		while (num < this.button_data_list_.Count && flag)
 
- 		{
 
- 			buttonData = this.button_data_list_[num];
 
- 			int num2 = 0;
 
- 			while (num2 < buttonData.children_list.Count && flag)
 
- 			{
 
- 				buttonData2 = buttonData.children_list[num2];
 
- 				int num3 = 0;
 
- 				while (num3 < buttonData2.children_list.Count && flag)
 
- 				{
 
- 					buttonData3 = buttonData2.children_list[num3];
 
- 					if (buttonData3.skill_data == skill)
 
- 					{
 
- 						flag = false;
 
- 					}
 
- 					num3++;
 
- 				}
 
- 				num2++;
 
- 			}
 
- 			num++;
 
- 		}
 
- 		if (flag)
 
- 		{
 
- 			return;
 
- 		}
 
- 		if (!buttonData.tab_button_obj.isSelected)
 
- 		{
 
- 			this.update_obj_dic_["タイプ"].tab_panel.Select(buttonData.tab_button_obj);
 
- 		}
 
- 		if (!buttonData2.tab_button_obj.isSelected)
 
- 		{
 
- 			this.update_obj_dic_["カテゴリー"].tab_panel.Select(buttonData2.tab_button_obj);
 
- 		}
 
- 		this.user_request_stage = stage_data;
 
- 		if (!buttonData3.tab_button_obj.isSelected)
 
- 		{
 
- 			this.update_obj_dic_["スキル"].tab_panel.Select(buttonData3.tab_button_obj);
 
- 		}
 
- 	}
 
- 	public void FixSkill()
 
- 	{
 
- 		if (this.yotogi_mgr_ == null || this.yotogi_mgr_.maid == null)
 
- 		{
 
- 			return;
 
- 		}
 
- 		YotogiStageSelectManager.SelectStage(this.select_stage, this.is_day_time_);
 
- 		KeyValuePair<Skill.Data, bool>[] playSkillArray = new KeyValuePair<Skill.Data, bool>[]
 
- 		{
 
- 			new KeyValuePair<Skill.Data, bool>(this.select_skill, false)
 
- 		};
 
- 		this.yotogi_mgr_.SetPlaySkillArray(playSkillArray);
 
- 	}
 
- 	private void CreateCategory(FreeSkillSelect.ButtonData type_button_data)
 
- 	{
 
- 		FreeSkillSelect.UpdateObject updateObject = this.update_obj_dic_["カテゴリー"];
 
- 		updateObject.MoveStorageRoom(true);
 
- 		updateObject.Clear();
 
- 		GameObject button_parent = updateObject.button_parent;
 
- 		bool lockNTRPlay = GameMain.Instance.CharacterMgr.status.lockNTRPlay;
 
- 		int i = 0;
 
- 		while (i < type_button_data.children_list.Count)
 
- 		{
 
- 			FreeSkillSelect.ButtonData buttonData = type_button_data.children_list[i];
 
- 			if (!lockNTRPlay)
 
- 			{
 
- 				goto IL_87;
 
- 			}
 
- 			Yotogi.Category category = (Yotogi.Category)Enum.Parse(typeof(Yotogi.Category), buttonData.name);
 
- 			if (category != Yotogi.Category.交換 && category != Yotogi.Category.乱交)
 
- 			{
 
- 				goto IL_87;
 
- 			}
 
- 			IL_EE:
 
- 			i++;
 
- 			continue;
 
- 			IL_87:
 
- 			bool flag = buttonData.children_list != null && 0 < buttonData.children_list.Count;
 
- 			EventDelegate eventDelegate = null;
 
- 			if (flag)
 
- 			{
 
- 				eventDelegate = new EventDelegate(this, "OnClickCategoryBtnEvent");
 
- 				eventDelegate.parameters[0].value = buttonData;
 
- 			}
 
- 			buttonData.tab_button_obj = this.CreateTypeAndCategoryButton(updateObject, buttonData.name, buttonData.nameTerm, flag, eventDelegate);
 
- 			goto IL_EE;
 
- 		}
 
- 		updateObject.Update();
 
- 		List<Transform> childList = updateObject.ui_grid.GetChildList();
 
- 		for (int j = 0; j < childList.Count; j++)
 
- 		{
 
- 			UIWFTabButton componentInChildren = childList[j].gameObject.GetComponentInChildren<UIWFTabButton>();
 
- 			if (!(componentInChildren == null) && componentInChildren.isEnabled)
 
- 			{
 
- 				updateObject.tab_panel.Select(componentInChildren);
 
- 				break;
 
- 			}
 
- 		}
 
- 	}
 
- 	private void CreateSkill(FreeSkillSelect.ButtonData skill_button_data)
 
- 	{
 
- 		FreeSkillSelect.UpdateObject updateObject = this.update_obj_dic_["スキル"];
 
- 		updateObject.MoveStorageRoom(true);
 
- 		updateObject.Clear();
 
- 		GameObject button_parent = updateObject.button_parent;
 
- 		for (int i = 0; i < skill_button_data.children_list.Count; i++)
 
- 		{
 
- 			FreeSkillSelect.ButtonData buttonData = skill_button_data.children_list[i];
 
- 			if (buttonData.skill_data != null)
 
- 			{
 
- 				EventDelegate eventDelegate = new EventDelegate(this, "OnClickSkillBtnEvent");
 
- 				eventDelegate.parameters[0].value = buttonData;
 
- 				buttonData.tab_button_obj = this.CreateSkillButton(buttonData.skill_data, eventDelegate);
 
- 			}
 
- 		}
 
- 		updateObject.Update();
 
- 		List<Transform> childList = updateObject.ui_grid.GetChildList();
 
- 		for (int j = 0; j < childList.Count; j++)
 
- 		{
 
- 			UIWFTabButton componentInChildren = childList[j].gameObject.GetComponentInChildren<UIWFTabButton>();
 
- 			if (!(componentInChildren == null) && componentInChildren.isEnabled)
 
- 			{
 
- 				updateObject.tab_panel.Select(componentInChildren);
 
- 				break;
 
- 			}
 
- 		}
 
- 	}
 
- 	private void CreateStage(Skill.Data skill_data)
 
- 	{
 
- 		FreeSkillSelect.UpdateObject updateObject = this.update_obj_dic_["ステージ"];
 
- 		YotogiStage.Data data = this.user_request_stage;
 
- 		UIWFTabButton uiwftabButton = null;
 
- 		updateObject.tab_panel.ResetSelect();
 
- 		List<Transform> childList = updateObject.ui_grid.GetChildList();
 
- 		for (int i = 0; i < childList.Count; i++)
 
- 		{
 
- 			YotogiStageUnit component = childList[i].gameObject.GetComponent<YotogiStageUnit>();
 
- 			UIWFTabButton componentInChildren = childList[i].gameObject.GetComponentInChildren<UIWFTabButton>();
 
- 			if (componentInChildren.isSelected)
 
- 			{
 
- 				componentInChildren.SetSelect(false);
 
- 			}
 
- 			if (componentInChildren.isEnabled != skill_data.IsExecStage(component.stage_data))
 
- 			{
 
- 				componentInChildren.isEnabled = skill_data.IsExecStage(component.stage_data);
 
- 				if (componentInChildren.isEnabled)
 
- 				{
 
- 					component.thumbnail_sprite.color = new Color(1f, 1f, 1f, 1f);
 
- 				}
 
- 				else
 
- 				{
 
- 					component.thumbnail_sprite.color = new Color(0.6f, 0.6f, 0.6f, 1f);
 
- 				}
 
- 			}
 
- 			if (data == component.stage_data && componentInChildren.isEnabled)
 
- 			{
 
- 				uiwftabButton = componentInChildren;
 
- 			}
 
- 		}
 
- 		if (uiwftabButton != null)
 
- 		{
 
- 			updateObject.tab_panel.Select(uiwftabButton);
 
- 		}
 
- 		else
 
- 		{
 
- 			for (int j = 0; j < childList.Count; j++)
 
- 			{
 
- 				UIWFTabButton componentInChildren2 = childList[j].gameObject.GetComponentInChildren<UIWFTabButton>();
 
- 				if (!(componentInChildren2 == null) && componentInChildren2.isEnabled)
 
- 				{
 
- 					updateObject.tab_panel.Select(componentInChildren2);
 
- 					break;
 
- 				}
 
- 			}
 
- 			this.user_request_stage = data;
 
- 		}
 
- 	}
 
- 	private UIWFTabButton CreateSkillButton(Skill.Data skill_data, EventDelegate onclick_event)
 
- 	{
 
- 		if (skill_data == null)
 
- 		{
 
- 			return null;
 
- 		}
 
- 		FreeSkillSelect.UpdateObject updateObject = this.update_obj_dic_["スキル"];
 
- 		GameObject gameObject = updateObject.MoveButtonParent();
 
- 		if (gameObject == null)
 
- 		{
 
- 			gameObject = Utility.CreatePrefab(updateObject.button_parent, "SceneYotogi/FreeMode/FreeSkillButton", true);
 
- 		}
 
- 		UILabel component = UTY.GetChildObject(gameObject, "title", false).GetComponent<UILabel>();
 
- 		Localize component2 = component.GetComponent<Localize>();
 
- 		component.text = skill_data.name;
 
- 		gameObject.name = skill_data.name;
 
- 		if (component2 != null)
 
- 		{
 
- 			component2.SetTerm(skill_data.termName);
 
- 		}
 
- 		bool flag = true;
 
- 		if (1 < skill_data.user_player_num && 0 < skill_data.recollectionHaremLockPersonalIds.Count)
 
- 		{
 
- 			int num = 1;
 
- 			while (num < skill_data.user_player_num && flag)
 
- 			{
 
- 				Maid maid = GameMain.Instance.CharacterMgr.GetMaid(num);
 
- 				if (maid != null && skill_data.recollectionHaremLockPersonalIds.Contains(maid.status.personal.id))
 
- 				{
 
- 					flag = false;
 
- 				}
 
- 				num++;
 
- 			}
 
- 		}
 
- 		UIWFTabButton component3 = UTY.GetChildObject(gameObject, "BG", false).GetComponent<UIWFTabButton>();
 
- 		component3.isEnabled = flag;
 
- 		if (onclick_event != null)
 
- 		{
 
- 			component3.onClick.Add(onclick_event);
 
- 		}
 
- 		return component3;
 
- 	}
 
- 	private UIWFTabButton CreateTypeAndCategoryButton(FreeSkillSelect.UpdateObject update_obj, string name, string nameTerm, bool enabled, EventDelegate onclick_event)
 
- 	{
 
- 		GameObject gameObject = update_obj.MoveButtonParent();
 
- 		if (gameObject == null)
 
- 		{
 
- 			gameObject = Utility.CreatePrefab(update_obj.button_parent, "SceneYotogi/SkillSelect/Prefab/CategoryBtn", true);
 
- 		}
 
- 		UILabel component = UTY.GetChildObject(gameObject, "Label", false).GetComponent<UILabel>();
 
- 		Localize component2 = component.GetComponent<Localize>();
 
- 		component.text = name;
 
- 		if (component2 != null && !string.IsNullOrEmpty(nameTerm))
 
- 		{
 
- 			component2.SetTerm(nameTerm);
 
- 		}
 
- 		UIWFTabButton component3 = UTY.GetChildObject(gameObject, "Button", false).GetComponent<UIWFTabButton>();
 
- 		gameObject.name = name;
 
- 		component3.isEnabled = enabled;
 
- 		if (enabled && onclick_event != null)
 
- 		{
 
- 			component3.onClick.Add(onclick_event);
 
- 		}
 
- 		return component3;
 
- 	}
 
- 	private void OnClickTypeBtnEvent(FreeSkillSelect.ButtonData type_btn_data)
 
- 	{
 
- 		this.update_obj_dic_["タイプ"].UpdateArrow(type_btn_data.tab_button_obj.gameObject);
 
- 		this.CreateCategory(type_btn_data);
 
- 	}
 
- 	private void OnClickCategoryBtnEvent(FreeSkillSelect.ButtonData categorybtn_data)
 
- 	{
 
- 		this.update_obj_dic_["カテゴリー"].UpdateArrow(categorybtn_data.tab_button_obj.gameObject);
 
- 		this.CreateSkill(categorybtn_data);
 
- 	}
 
- 	private void OnClickSkillBtnEvent(FreeSkillSelect.ButtonData skill_data)
 
- 	{
 
- 		this.update_obj_dic_["スキル"].UpdateArrow(skill_data.tab_button_obj.gameObject);
 
- 		this.select_skill_ = skill_data.skill_data;
 
- 		this.CreateStage(skill_data.skill_data);
 
- 		FreeSkillSelect.ButtonData buttonData = (skill_data.parent == null) ? null : ((skill_data.parent.parent == null) ? null : skill_data.parent.parent);
 
- 		FreeSkillSelect.RootType rootType = (buttonData == null) ? FreeSkillSelect.RootType.Null : buttonData.root_type;
 
- 		if (FreeSkillSelect.RootType.GP01Harem <= rootType && rootType <= FreeSkillSelect.RootType.GP02Yuri)
 
- 		{
 
- 			List<Transform> childList = this.update_obj_dic_["レベル"].ui_grid.GetChildList();
 
- 			bool flag = true;
 
- 			for (int i = childList.Count - 1; i >= 0; i--)
 
- 			{
 
- 				UIWFTabButton componentInChildren = childList[i].gameObject.GetComponentInChildren<UIWFTabButton>();
 
- 				if (!(componentInChildren == null) && componentInChildren.isEnabled)
 
- 				{
 
- 					if (flag)
 
- 					{
 
- 						this.update_obj_dic_["レベル"].tab_panel.Select(componentInChildren);
 
- 					}
 
- 					else
 
- 					{
 
- 						componentInChildren.isEnabled = false;
 
- 					}
 
- 					flag = false;
 
- 				}
 
- 			}
 
- 		}
 
- 		else
 
- 		{
 
- 			List<Transform> childList2 = this.update_obj_dic_["レベル"].ui_grid.GetChildList();
 
- 			for (int j = 0; j < childList2.Count; j++)
 
- 			{
 
- 				UIWFTabButton componentInChildren2 = childList2[j].gameObject.GetComponentInChildren<UIWFTabButton>();
 
- 				if (!(componentInChildren2 == null))
 
- 				{
 
- 					componentInChildren2.isEnabled = true;
 
- 				}
 
- 			}
 
- 		}
 
- 	}
 
- 	private void OnClickLevelBtnEvent()
 
- 	{
 
- 		this.update_obj_dic_["レベル"].UpdateArrow(UIButton.current.gameObject);
 
- 		this.yotogi_mgr_.fix_skill_level = int.Parse(UIButton.current.gameObject.name);
 
- 	}
 
- 	private void OnClickStageEvent(YotogiStageUnit stage_unit)
 
- 	{
 
- 		this.select_stage_ = (this.user_request_stage = stage_unit.stage_data);
 
- 		this.is_day_time_ = stage_unit.is_daytime;
 
- 		this.FixSkill();
 
- 	}
 
- 	private static List<FreeSkillSelect.ButtonData> CreateButtonData(Maid maid, HashSet<int> selectableStageIds)
 
- 	{
 
- 		List<FreeSkillSelect.ButtonData> list = new List<FreeSkillSelect.ButtonData>();
 
- 		Dictionary<FreeSkillSelect.RootType, KeyValuePair<FreeSkillSelect.ButtonData, Dictionary<string, FreeSkillSelect.ButtonData>>> type_data_dic = new Dictionary<FreeSkillSelect.RootType, KeyValuePair<FreeSkillSelect.ButtonData, Dictionary<string, FreeSkillSelect.ButtonData>>>();
 
- 		List<KeyValuePair<FreeSkillSelect.RootType, string>> list2 = new List<KeyValuePair<FreeSkillSelect.RootType, string>>();
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.Null, "通常"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.Drunk, "酔い"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.Mask, "目隠し"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.Drug, "媚薬"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.Confess, "告白"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.Faint, "気絶"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.GP01Harem, "GP-01ハーレム"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.GP01Swapping, "GP-01スワッピング"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.GP01NTR, "GP-01寝取らせ"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.GP01NTRReport, "GP-01寝取らせ報告"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.GP02Harem, "GP-02ハーレム"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.GP02Swapping, "GP-02スワッピング"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.GP02NTR, "GP-02寝取らせ"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.GP02NTRReport, "GP-02寝取らせ報告"));
 
- 		list2.Add(new KeyValuePair<FreeSkillSelect.RootType, string>(FreeSkillSelect.RootType.GP02Yuri, "GP-02百合"));
 
- 		for (int i = 0; i < list2.Count; i++)
 
- 		{
 
- 			FreeSkillSelect.ButtonData buttonData = new FreeSkillSelect.ButtonData();
 
- 			buttonData.children_list = new List<FreeSkillSelect.ButtonData>();
 
- 			buttonData.name = list2[i].Value;
 
- 			buttonData.nameTerm = "SceneYotogi/スキル所属/" + buttonData.name;
 
- 			buttonData.root_type = list2[i].Key;
 
- 			list.Add(buttonData);
 
- 			type_data_dic.Add(buttonData.root_type, new KeyValuePair<FreeSkillSelect.ButtonData, Dictionary<string, FreeSkillSelect.ButtonData>>(buttonData, new Dictionary<string, FreeSkillSelect.ButtonData>()));
 
- 		}
 
- 		for (int j = 0; j < list.Count; j++)
 
- 		{
 
- 			for (int k = 0; k < 8; k++)
 
- 			{
 
- 				FreeSkillSelect.ButtonData buttonData2 = list[j];
 
- 				FreeSkillSelect.ButtonData buttonData3 = new FreeSkillSelect.ButtonData();
 
- 				buttonData3.children_list = new List<FreeSkillSelect.ButtonData>();
 
- 				FreeSkillSelect.ButtonData buttonData4 = buttonData3;
 
- 				Yotogi.Category category = (Yotogi.Category)k;
 
- 				buttonData4.name = category.ToString();
 
- 				buttonData3.nameTerm = "SceneYotogi/スキルカテゴリー/" + buttonData3.name;
 
- 				buttonData3.parent = buttonData2;
 
- 				buttonData2.children_list.Add(buttonData3);
 
- 				type_data_dic[list[j].root_type].Value.Add(buttonData3.name, buttonData3);
 
- 			}
 
- 		}
 
- 		CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
 
- 		int[] keyArray = maid.status.yotogiSkill.datas.GetKeyArray();
 
- 		Dictionary<int, List<Skill.Data>> dictionary = new Dictionary<int, List<Skill.Data>>();
 
- 		for (int l = 0; l < keyArray.Length; l++)
 
- 		{
 
- 			Skill.Data data = Skill.Get(keyArray[l]);
 
- 			if (data.specialConditionType != Skill.Data.SpecialConditionType.NewType)
 
- 			{
 
- 				bool flag = false;
 
- 				foreach (int item in data.playable_stageid_list)
 
- 				{
 
- 					flag = selectableStageIds.Contains(item);
 
- 					if (flag)
 
- 					{
 
- 						break;
 
- 					}
 
- 				}
 
- 				if (flag)
 
- 				{
 
- 					int category2 = (int)data.category;
 
- 					if (!dictionary.ContainsKey(category2))
 
- 					{
 
- 						dictionary.Add(category2, new List<Skill.Data>());
 
- 					}
 
- 					dictionary[category2].Add(data);
 
- 				}
 
- 			}
 
- 		}
 
- 		foreach (KeyValuePair<int, List<Skill.Data>> keyValuePair in dictionary)
 
- 		{
 
- 			List<Skill.Data> value = keyValuePair.Value;
 
- 			value.Sort((Skill.Data a, Skill.Data b) => a.sortId - b.sortId);
 
- 		}
 
- 		List<Skill.Data> list3 = new List<Skill.Data>();
 
- 		foreach (KeyValuePair<int, List<Skill.Data>> keyValuePair2 in dictionary)
 
- 		{
 
- 			List<Skill.Data> value2 = keyValuePair2.Value;
 
- 			foreach (Skill.Data item2 in value2)
 
- 			{
 
- 				list3.Add(item2);
 
- 			}
 
- 		}
 
- 		foreach (Skill.Data data2 in list3)
 
- 		{
 
- 			int user_player_num = data2.user_player_num;
 
- 			if (1 < user_player_num)
 
- 			{
 
- 				int num = 0;
 
- 				for (int m = 0; m < characterMgr.GetMaidCount(); m++)
 
- 				{
 
- 					if (!(characterMgr.GetMaid(m) != null))
 
- 					{
 
- 						break;
 
- 					}
 
- 					num++;
 
- 				}
 
- 				if (num < user_player_num)
 
- 				{
 
- 					continue;
 
- 				}
 
- 			}
 
- 			if (data2.IsExecMaid(maid.status))
 
- 			{
 
- 				FreeSkillSelect.RootType key;
 
- 				if (Skill.Data.SpecialConditionType.Null <= data2.specialConditionType && data2.specialConditionType <= Skill.Data.SpecialConditionType.Confess)
 
- 				{
 
- 					key = (FreeSkillSelect.RootType)data2.specialConditionType;
 
- 				}
 
- 				else if (data2.specialConditionType == Skill.Data.SpecialConditionType.GP01Recollect)
 
- 				{
 
- 					if (data2.category == Yotogi.Category.ハ\u30FCレム)
 
- 					{
 
- 						key = FreeSkillSelect.RootType.GP01Harem;
 
- 					}
 
- 					else
 
- 					{
 
- 						key = FreeSkillSelect.RootType.GP01Swapping;
 
- 						if (data2.name.Contains("報告"))
 
- 						{
 
- 							key = FreeSkillSelect.RootType.GP01NTRReport;
 
- 						}
 
- 						else if (data2.name.Contains("寝取り"))
 
- 						{
 
- 							key = FreeSkillSelect.RootType.GP01NTR;
 
- 						}
 
- 					}
 
- 				}
 
- 				else
 
- 				{
 
- 					if (data2.specialConditionType != Skill.Data.SpecialConditionType.GP02Recollect)
 
- 					{
 
- 						continue;
 
- 					}
 
- 					if (data2.category == Yotogi.Category.ハ\u30FCレム)
 
- 					{
 
- 						if (data2.name.Contains("百合"))
 
- 						{
 
- 							key = FreeSkillSelect.RootType.GP02Yuri;
 
- 						}
 
- 						else
 
- 						{
 
- 							key = FreeSkillSelect.RootType.GP02Harem;
 
- 						}
 
- 					}
 
- 					else
 
- 					{
 
- 						key = FreeSkillSelect.RootType.GP02Swapping;
 
- 						if (data2.name.Contains("報告"))
 
- 						{
 
- 							key = FreeSkillSelect.RootType.GP02NTRReport;
 
- 						}
 
- 						else if (data2.name.Contains("寝取り"))
 
- 						{
 
- 							key = FreeSkillSelect.RootType.GP02NTR;
 
- 						}
 
- 					}
 
- 				}
 
- 				FreeSkillSelect.ButtonData buttonData5 = type_data_dic[key].Value[data2.category.ToString()];
 
- 				if (buttonData5 != null)
 
- 				{
 
- 					FreeSkillSelect.ButtonData buttonData6 = new FreeSkillSelect.ButtonData();
 
- 					buttonData6.parent = buttonData5;
 
- 					buttonData6.name = data2.name;
 
- 					buttonData6.skill_data = data2;
 
- 					buttonData5.children_list.Add(buttonData6);
 
- 				}
 
- 			}
 
- 		}
 
- 		Action<FreeSkillSelect.RootType> action = delegate(FreeSkillSelect.RootType type)
 
- 		{
 
- 			Dictionary<string, FreeSkillSelect.ButtonData> value3 = type_data_dic[type].Value;
 
- 			HashSet<string> hashSet = new HashSet<string>();
 
- 			List<FreeSkillSelect.ButtonData> list4 = new List<FreeSkillSelect.ButtonData>();
 
- 			foreach (KeyValuePair<string, FreeSkillSelect.ButtonData> keyValuePair3 in value3)
 
- 			{
 
- 				if (keyValuePair3.Value.children_list != null && 1 <= keyValuePair3.Value.children_list.Count && !hashSet.Contains(keyValuePair3.Key))
 
- 				{
 
- 					hashSet.Add(keyValuePair3.Key);
 
- 					list4.Add(keyValuePair3.Value);
 
- 				}
 
- 			}
 
- 			type_data_dic[type].Key.children_list = list4;
 
- 		};
 
- 		foreach (FreeSkillSelect.ButtonData buttonData7 in list)
 
- 		{
 
- 			if (buttonData7.root_type != FreeSkillSelect.RootType.Null)
 
- 			{
 
- 				action(buttonData7.root_type);
 
- 			}
 
- 		}
 
- 		return list;
 
- 	}
 
- 	private static FreeSkillSelect.ButtonData GetButtonData(List<FreeSkillSelect.ButtonData> check_list, string name)
 
- 	{
 
- 		FreeSkillSelect.ButtonData result = null;
 
- 		if (check_list == null || string.IsNullOrEmpty(name))
 
- 		{
 
- 			return result;
 
- 		}
 
- 		for (int i = 0; i < check_list.Count; i++)
 
- 		{
 
- 			if (check_list[i] != null)
 
- 			{
 
- 				if (!string.IsNullOrEmpty(check_list[i].name) && check_list[i].name == name)
 
- 				{
 
- 					result = check_list[i];
 
- 					break;
 
- 				}
 
- 			}
 
- 		}
 
- 		return result;
 
- 	}
 
- 	public YotogiStage.Data select_stage
 
- 	{
 
- 		get
 
- 		{
 
- 			return this.select_stage_;
 
- 		}
 
- 	}
 
- 	public Skill.Data select_skill
 
- 	{
 
- 		get
 
- 		{
 
- 			return this.select_skill_;
 
- 		}
 
- 	}
 
- 	private Maid maid_;
 
- 	private List<FreeSkillSelect.ButtonData> button_data_list_;
 
- 	private Dictionary<string, FreeSkillSelect.UpdateObject> update_obj_dic_;
 
- 	private YotogiManager yotogi_mgr_;
 
- 	private Skill.Data select_skill_;
 
- 	private YotogiStage.Data select_stage_;
 
- 	private bool is_day_time_ = true;
 
- 	private YotogiStage.Data user_request_stage;
 
- 	private enum RootType
 
- 	{
 
- 		Null,
 
- 		Drunk,
 
- 		Mask,
 
- 		Drug,
 
- 		Faint,
 
- 		Confess,
 
- 		GP01Harem,
 
- 		GP01Swapping,
 
- 		GP01NTR,
 
- 		GP01NTRReport,
 
- 		GP02Harem,
 
- 		GP02Swapping,
 
- 		GP02NTR,
 
- 		GP02NTRReport,
 
- 		GP02Yuri
 
- 	}
 
- 	private class ButtonData
 
- 	{
 
- 		public UIWFTabButton tab_button_obj;
 
- 		public FreeSkillSelect.ButtonData parent;
 
- 		public List<FreeSkillSelect.ButtonData> children_list;
 
- 		public string name;
 
- 		public string nameTerm;
 
- 		public Skill.Data skill_data;
 
- 		public FreeSkillSelect.RootType root_type;
 
- 	}
 
- 	private class UpdateObject
 
- 	{
 
- 		public void Update()
 
- 		{
 
- 			this.ui_grid.Reposition();
 
- 			this.tab_panel.UpdateChildren();
 
- 			this.scroll_view.ResetPosition();
 
- 			this.ui_panel.UpdateAnchors();
 
- 		}
 
- 		public void MoveStorageRoom(bool click_event_clear)
 
- 		{
 
- 			if (this.storage_obj == null)
 
- 			{
 
- 				return;
 
- 			}
 
- 			Transform transform = this.button_parent.transform;
 
- 			Transform transform2 = this.storage_obj.transform;
 
- 			while (0 < transform.childCount)
 
- 			{
 
- 				GameObject gameObject = transform.GetChild(0).gameObject;
 
- 				UIWFTabButton componentInChildren = gameObject.GetComponentInChildren<UIWFTabButton>();
 
- 				if (componentInChildren != null)
 
- 				{
 
- 					componentInChildren.SetSelect(false);
 
- 					if (click_event_clear)
 
- 					{
 
- 						componentInChildren.onClick.Clear();
 
- 					}
 
- 				}
 
- 				gameObject.transform.SetParent(transform2, false);
 
- 				gameObject.transform.localPosition = Vector3.zero;
 
- 			}
 
- 			transform.DetachChildren();
 
- 		}
 
- 		public GameObject MoveButtonParent()
 
- 		{
 
- 			if (this.storage_obj == null)
 
- 			{
 
- 				return null;
 
- 			}
 
- 			GameObject gameObject = null;
 
- 			Transform transform = this.button_parent.transform;
 
- 			Transform transform2 = this.storage_obj.transform;
 
- 			if (0 < transform2.childCount)
 
- 			{
 
- 				gameObject = transform2.GetChild(0).gameObject;
 
- 				gameObject.transform.SetParent(transform, false);
 
- 			}
 
- 			return gameObject;
 
- 		}
 
- 		public GameObject MoveButtonParent(string object_name)
 
- 		{
 
- 			if (this.storage_obj == null || string.IsNullOrEmpty(object_name))
 
- 			{
 
- 				return null;
 
- 			}
 
- 			GameObject gameObject = null;
 
- 			Transform transform = this.button_parent.transform;
 
- 			Transform transform2 = this.storage_obj.transform;
 
- 			for (int i = 0; i < transform2.childCount; i++)
 
- 			{
 
- 				if (transform2.GetChild(i).name == object_name)
 
- 				{
 
- 					gameObject = transform2.GetChild(i).gameObject;
 
- 					gameObject.transform.SetParent(transform, false);
 
- 					break;
 
- 				}
 
- 			}
 
- 			return gameObject;
 
- 		}
 
- 		public void UpdateArrow(GameObject target_obj)
 
- 		{
 
- 			if (this.arrow_obj == null || target_obj == null)
 
- 			{
 
- 				return;
 
- 			}
 
- 			Vector3 position = target_obj.transform.TransformPoint(new Vector3(0f, 0f, 0f));
 
- 			Vector3 local_pos = this.arrow_obj.transform.parent.InverseTransformPoint(position);
 
- 			local_pos.x = this.arrow_obj.transform.localPosition.x;
 
- 			local_pos.y += 18f;
 
- 			Hashtable args = TweenHash.EaseOutQuint(TweenHash.Type.Position, local_pos, 0.3f);
 
- 			iTween.MoveTo(this.arrow_obj, args);
 
- 		}
 
- 		public void Clear()
 
- 		{
 
- 			Transform transform = this.button_parent.transform;
 
- 			for (int i = 0; i < transform.childCount; i++)
 
- 			{
 
- 				UnityEngine.Object.Destroy(transform.GetChild(i).gameObject);
 
- 			}
 
- 			transform.DetachChildren();
 
- 		}
 
- 		public GameObject button_parent;
 
- 		public UIGrid ui_grid;
 
- 		public UIWFTabPanel tab_panel;
 
- 		public UIScrollView scroll_view;
 
- 		public UIPanel ui_panel;
 
- 		public GameObject arrow_obj;
 
- 		public GameObject storage_obj;
 
- 	}
 
- }
 
 
  |