Esempio n. 1
0
 public void InitWithBaseScene(bool isCheck, ElfBtnItem data)
 {
     this.mIsChecked = isCheck;
     this.btnData = data;
     this.CreateObjects();
     this.Text = this.btnData.strName;
 }
Esempio n. 2
0
 public void RefreshBtnTab(ElfBtnItem[] btnData)
 {
     for (int i = 0; i < btnData.Length; i++)
     {
         this.InitElfCheckBtn(btnData[i]);
     }
     this.btnsTable.repositionNow = true;
 }
Esempio n. 3
0
 public void InitWithBaseScene(GameUIFairyTalePopUp baseScene, ElfBtnItem data)
 {
     this.mBaseScene = baseScene;
     this.initData = data;
     this.CreateObjects();
 }
Esempio n. 4
0
 private GUIElfCheckBtn InitElfCheckBtn(ElfBtnItem data)
 {
     if (this.mElfCheckBtnPrefab == null)
     {
         this.mElfCheckBtnPrefab = Res.LoadGUI("GUI/GUIElfCheckBtn");
     }
     if (this.mElfCheckBtnPrefab == null)
     {
         global::Debug.LogError(new object[]
         {
             "Res.Load GUI/GUIElfCheckBtn error"
         });
         return null;
     }
     GameObject gameObject = Tools.AddChild(this.btnsTable.gameObject, this.mElfCheckBtnPrefab);
     GUIElfCheckBtn gUIElfCheckBtn = gameObject.AddComponent<GUIElfCheckBtn>();
     gUIElfCheckBtn.InitWithBaseScene(false, data);
     gUIElfCheckBtn.name = string.Format("{0:D2}", this.btnsTable.transform.childCount);
     return gUIElfCheckBtn;
 }
Esempio n. 5
0
 private FairyTaleTabItem AddFairyTaleTabItem(ElfBtnItem initData)
 {
     if (this.mTabItemOriginal == null)
     {
         this.mTabItemOriginal = Res.LoadGUI("GUI/FairyTaleTabItem");
     }
     if (this.mTabItemOriginal == null)
     {
         global::Debug.LogError(new object[]
         {
             "Res.Load GUI/FairyTaleTabItem error"
         });
         return null;
     }
     GameObject gameObject = Tools.AddChild(this.winBG.gameObject, this.mTabItemOriginal);
     FairyTaleTabItem fairyTaleTabItem = gameObject.AddComponent<FairyTaleTabItem>();
     fairyTaleTabItem.InitWithBaseScene(this, initData);
     return fairyTaleTabItem;
 }
Esempio n. 6
0
 private static ElfBtnItem[] ParseElfBtnData(string result)
 {
     ElfBtnItem[] array = null;
     try
     {
         string[] array2 = result.Split(new char[]
         {
             '|'
         });
         char[] trimChars = new char[]
         {
             '\n'
         };
         array = new ElfBtnItem[array2.Length];
         for (int i = 0; i < array2.Length; i++)
         {
             string text = array2[i].Trim(trimChars);
             int num = text.IndexOf('@');
             string strName = text;
             string strQuest = text;
             if (num >= 0)
             {
                 strName = text.Substring(0, num);
                 strQuest = text.Substring(num + 1);
             }
             array[i] = new ElfBtnItem();
             array[i].strName = strName;
             array[i].strQuest = strQuest;
         }
     }
     catch (Exception ex)
     {
         global::Debug.LogError(new object[]
         {
             string.Format("Parse ElfQuery Error, {0}", ex.Message)
         });
     }
     return array;
 }
Esempio n. 7
0
 public void InitFairyTale(ElfBtnItem[] initData)
 {
     TextAsset textAsset = StringManager.LoadTextRes("FairyTaleCodeTable");
     StringManager.ParseString(ref GameUIFairyTalePopUp.codeDict, textAsset.text);
     int num = (initData.Length > 4) ? 4 : initData.Length;
     for (int i = num - 1; i >= 0; i--)
     {
         FairyTaleTabItem fairyTaleTabItem = this.AddFairyTaleTabItem(initData[i]);
         fairyTaleTabItem.btnTab.transform.localPosition = new Vector3((float)(-194 + i * 162), 230f, 0f);
     }
     this.AddElfAnswerLine(new ElfAnswerItem
     {
         strAnswer = this.ParseStrData(Singleton<StringManager>.Instance.GetString("FairyTxt_9")).Insert(0, "[feeebd]")
     });
     for (int j = 0; j < GameUIFairyTalePopUp.cacheLineData.Count; j++)
     {
         object obj = GameUIFairyTalePopUp.cacheLineData[j];
         if (obj is ElfQuestItem)
         {
             ElfQuestItem elfQuestItem = (ElfQuestItem)obj;
             this.lastQueryQuest = elfQuestItem.strQuest;
             this.AddElfQuestLine(elfQuestItem);
         }
         else
         {
             this.AddElfAnswerLine((ElfAnswerItem)obj);
         }
     }
     this.RefreshChatPanel();
 }