| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, November 22, 2017 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using TableConfig; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | //功能预告面板 |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class FunctionForecastWin : Window |
| | | { |
| | | [SerializeField] Button CloseBtn; |
| | | [SerializeField] Image FunctionImage; |
| | | [SerializeField] Text IconText; |
| | | [SerializeField] Text ContentText; |
| | | [SerializeField] Text ContentText1; |
| | | #region Built-in |
| | | private int OpenID = 0; |
| | | protected override void BindController() |
| | | { |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | CloseBtn.AddListener(() => { Close(); }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | if (WindowCenter.Instance.CheckOpen<CombatModeWin>()) |
| | | { |
| | | WindowCenter.Instance.Close<CombatModeWin>(); |
| | | } |
| | | OpenID = FunctionForecastTip.OpenTag; |
| | | FunctionForecastTip.FunctionOpenTagEvent += OnFunctionOpenTag; |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | Assignment(); |
| | | } |
| | | |
| | | void Assignment() |
| | | { |
| | | var functionForcecastConfig = ConfigManager.Instance.GetTemplate<FunctionForecastConfig>(OpenID); |
| | | if (functionForcecastConfig == null) |
| | | { |
| | | Close(); |
| | | } |
| | | var openLvConfig = ConfigManager.Instance.GetTemplate<FuncOpenLVConfig>(OpenID); |
| | | |
| | | FunctionImage.SetSprite(functionForcecastConfig.FuncIconKey); |
| | | IconText.text = functionForcecastConfig.FuncName; |
| | | ContentText.text = functionForcecastConfig.DetailDescribe; |
| | | if (openLvConfig.LimitMagicWeapon != 0 || openLvConfig.LimitMissionID != 0) |
| | | { |
| | | if (openLvConfig.LimitMagicWeapon != 0) |
| | | { |
| | | int faBaoID = openLvConfig.LimitMagicWeapon / 100; |
| | | TreasureConfig treasure = ConfigManager.Instance.GetTemplate<TreasureConfig>(faBaoID); |
| | | ContentText1.text = string.Format(Language.Get("FuncFBOpen"), treasure.Name); |
| | | return; |
| | | } |
| | | if (openLvConfig.LimitMissionID != 0) |
| | | { |
| | | ContentText1.text = string.Format(Language.Get("TaskFuncOpen"), openLvConfig.LimitLV); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ContentText1.text = string.Format(Language.Get("FuncLevelOpen"), openLvConfig.LimitLV); |
| | | } |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | FunctionForecastTip.FunctionOpenTagEvent -= OnFunctionOpenTag; |
| | | } |
| | | |
| | | private void OnFunctionOpenTag(int obj) |
| | | { |
| | | OpenID = obj; |
| | | Assignment(); |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, November 22, 2017
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | //功能预告面板
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class FunctionForecastWin : Window
|
| | | {
|
| | | [SerializeField] Button CloseBtn;
|
| | | [SerializeField] Image FunctionImage;
|
| | | [SerializeField] Text IconText;
|
| | | [SerializeField] Text ContentText;
|
| | | [SerializeField] Text ContentText1;
|
| | | #region Built-in
|
| | | private int OpenID = 0;
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | CloseBtn.AddListener(() => { Close(); });
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | if (WindowCenter.Instance.CheckOpen<CombatModeWin>())
|
| | | {
|
| | | WindowCenter.Instance.Close<CombatModeWin>();
|
| | | }
|
| | | OpenID = FunctionForecastTip.OpenTag;
|
| | | FunctionForecastTip.FunctionOpenTagEvent += OnFunctionOpenTag;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | Assignment();
|
| | | }
|
| | |
|
| | | void Assignment()
|
| | | {
|
| | | var functionForcecastConfig = ConfigManager.Instance.GetTemplate<FunctionForecastConfig>(OpenID);
|
| | | if (functionForcecastConfig == null)
|
| | | {
|
| | | Close();
|
| | | }
|
| | | var openLvConfig = ConfigManager.Instance.GetTemplate<FuncOpenLVConfig>(OpenID);
|
| | |
|
| | | FunctionImage.SetSprite(functionForcecastConfig.FuncIconKey);
|
| | | IconText.text = functionForcecastConfig.FuncName;
|
| | | ContentText.text = functionForcecastConfig.DetailDescribe;
|
| | | if (openLvConfig.LimitMagicWeapon != 0 || openLvConfig.LimitMissionID != 0)
|
| | | {
|
| | | if (openLvConfig.LimitMagicWeapon != 0)
|
| | | {
|
| | | int faBaoID = openLvConfig.LimitMagicWeapon / 100;
|
| | | TreasureConfig treasure = ConfigManager.Instance.GetTemplate<TreasureConfig>(faBaoID);
|
| | | ContentText1.text = string.Format(Language.Get("FuncFBOpen"), treasure.Name);
|
| | | return;
|
| | | }
|
| | | if (openLvConfig.LimitMissionID != 0)
|
| | | {
|
| | | ContentText1.text = string.Format(Language.Get("TaskFuncOpen"), openLvConfig.LimitLV);
|
| | | return;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ContentText1.text = string.Format(Language.Get("FuncLevelOpen"), openLvConfig.LimitLV);
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | FunctionForecastTip.FunctionOpenTagEvent -= OnFunctionOpenTag;
|
| | | }
|
| | |
|
| | | private void OnFunctionOpenTag(int obj)
|
| | | {
|
| | | OpenID = obj;
|
| | | Assignment();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|