Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
2 文件已复制
15个文件已删除
1 文件已重命名
11个文件已添加
39个文件已修改
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3e05761d690b75440a6be79207d0fb01 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1d70ccd06161e0443b7a802ad94292f8 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 71e878ac60c49ad4f964dd2dbc725739 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: eed34091b0568664b9fb42f0634496c1 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public ServerType socketType;
|
| | | public bool show = false;
|
| | | public string time;
|
| | | public string serverTime;
|
| | | public string content;
|
| | | public string name;
|
| | | public NetPackagetType type;
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 32ceb8b7faf99f84a8b73ce53c5e3e4d |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 77f69c2b862d1704299a32d0d8eeb71e |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fa14960fa44b0d1439bab471a764e34f |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d914565b65f8e8145988734c4d915834 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | case HazyGrassModel.Client_FairyGrassMapID: |
| | | case HazyGrassModel.Client_ReikiGrassMapID: |
| | | stage = stageGameObject.AddComponent<ClientHazyGrassStage>(); |
| | | break;
|
| | | case ClientTreasureDungeon.Client_DataMap:
|
| | | stage = stageGameObject.AddComponent<ClientTreasureDungeonStage>(); |
| | | break; |
| | | default: |
| | | stage = stageGameObject.AddComponent<DungeonStage>(); |
| | |
| | | public static void __Register(RealStatePtr L) |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(BuyItemPopModel); |
| | | System.Type type = typeof(BuyItemController); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 6, 2, 1); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetModel", _m_SetModel); |
| | |
| | | if(LuaAPI.lua_gettop(L) == 1) |
| | | { |
| | | |
| | | BuyItemPopModel gen_ret = new BuyItemPopModel(); |
| | | BuyItemController gen_ret = new BuyItemController(); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | return 1; |
| | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1); |
| | | BuyItemController gen_to_be_invoked = (BuyItemController)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1); |
| | | BuyItemController gen_to_be_invoked = (BuyItemController)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1); |
| | | BuyItemController gen_to_be_invoked = (BuyItemController)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1); |
| | | BuyItemController gen_to_be_invoked = (BuyItemController)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1); |
| | | BuyItemController gen_to_be_invoked = (BuyItemController)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1); |
| | | BuyItemController gen_to_be_invoked = (BuyItemController)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1); |
| | | BuyItemController gen_to_be_invoked = (BuyItemController)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.storeConfig); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1); |
| | | BuyItemController gen_to_be_invoked = (BuyItemController)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.vipBuyCntDict); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1); |
| | | BuyItemController gen_to_be_invoked = (BuyItemController)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.vipBuyCntDict = (System.Collections.Generic.Dictionary<int, int>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary<int, int>)); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnBeforePlayerDataInitialize", _m_OnBeforePlayerDataInitialize); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnPlayerLoginOk", _m_OnPlayerLoginOk); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "UnInit", _m_UnInit); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetTrialTokenCount", _m_GetTrialTokenCount); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "LineToTokenClass", _m_LineToTokenClass); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryGetTrialExchanges", _m_TryGetTrialExchanges); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryGetTrialRewards", _m_TryGetTrialRewards); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetTotalClass", _m_GetTotalClass); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "TrialSendExchange", _m_TrialSendExchange); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ProcessTrialError", _m_ProcessTrialError); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "CompleteTrialFloor", _m_CompleteTrialFloor); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ProcessOpenTrialExchangeError", _m_ProcessOpenTrialExchangeError); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "EquipCompare", _m_EquipCompare); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetExchangeItemByJob", _m_GetExchangeItemByJob); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetDungeonRequirePetHorseLevel", _m_GetDungeonRequirePetHorseLevel); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetPetHorseLevel", _m_GetPetHorseLevel); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryGetSatisfyExchange", _m_TryGetSatisfyExchange); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "SatisfyExchangeBetter", _m_SatisfyExchangeBetter); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsAnySatisfyExchangeBetterEquip", _m_IsAnySatisfyExchangeBetterEquip); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsAnySatisfyExchangeBetter", _m_IsAnySatisfyExchangeBetter); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "SelectEquipClassEvent", _e_SelectEquipClassEvent); |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "trialExchangeRemindLevel", _g_get_trialExchangeRemindLevel); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "trialSweepGradeLimit", _g_get_trialSweepGradeLimit); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "selectEquipClass", _g_get_selectEquipClass); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "openFromTask", _g_get_openFromTask); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "trialClassTokens", _g_get_trialClassTokens); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "trialTokens", _g_get_trialTokens); |
| | | |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "selectEquipClass", _s_set_selectEquipClass); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "openFromTask", _s_set_openFromTask); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "trialClassTokens", _s_set_trialClassTokens); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "trialTokens", _s_set_trialTokens); |
| | | |
| | | |
| | | Utils.EndObjectRegister(type, L, translator, null, null, |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetTrialTokenCount(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int _itemId = LuaAPI.xlua_tointeger(L, 2); |
| | | |
| | | int gen_ret = gen_to_be_invoked.GetTrialTokenCount( _itemId ); |
| | | LuaAPI.xlua_pushinteger(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_LineToTokenClass(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int _line = LuaAPI.xlua_tointeger(L, 2); |
| | | |
| | | int gen_ret = gen_to_be_invoked.LineToTokenClass( _line ); |
| | | LuaAPI.xlua_pushinteger(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_TryGetTrialExchanges(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int _lv = LuaAPI.xlua_tointeger(L, 2); |
| | | System.Collections.Generic.List<TrialExchangeConfig> _list; |
| | | |
| | | bool gen_ret = gen_to_be_invoked.TryGetTrialExchanges( _lv, out _list ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | translator.Push(L, _list); |
| | | |
| | | |
| | | |
| | | |
| | | return 2; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_TryGetTrialRewards(RealStatePtr L) |
| | | { |
| | | try { |
| | |
| | | bool gen_ret = gen_to_be_invoked.TryGetTrialRewards( _lineId, _grade, out _rewards ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | translator.Push(L, _rewards); |
| | | |
| | | |
| | | |
| | | |
| | | return 2; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetTotalClass(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | | System.Collections.Generic.List<int> gen_ret = gen_to_be_invoked.GetTotalClass( ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_TrialSendExchange(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int __id = LuaAPI.xlua_tointeger(L, 2); |
| | | int _error; |
| | | |
| | | bool gen_ret = gen_to_be_invoked.TrialSendExchange( __id, out _error ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | LuaAPI.xlua_pushinteger(L, _error); |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_ProcessOpenTrialExchangeError(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | | gen_to_be_invoked.ProcessOpenTrialExchangeError( ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_EquipCompare(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int __itemId = LuaAPI.xlua_tointeger(L, 2); |
| | | |
| | | int gen_ret = gen_to_be_invoked.EquipCompare( __itemId ); |
| | | LuaAPI.xlua_pushinteger(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetExchangeItemByJob(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | TrialExchangeConfig _config = (TrialExchangeConfig)translator.GetObject(L, 2, typeof(TrialExchangeConfig)); |
| | | |
| | | int gen_ret = gen_to_be_invoked.GetExchangeItemByJob( _config ); |
| | | LuaAPI.xlua_pushinteger(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetDungeonRequirePetHorseLevel(RealStatePtr L) |
| | | { |
| | | try { |
| | |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_TryGetSatisfyExchange(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int _maxClass; |
| | | |
| | | bool gen_ret = gen_to_be_invoked.TryGetSatisfyExchange( out _maxClass ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | LuaAPI.xlua_pushinteger(L, _maxClass); |
| | | |
| | | |
| | | |
| | | |
| | | return 2; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_SatisfyExchangeBetter(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int __id = LuaAPI.xlua_tointeger(L, 2); |
| | | |
| | | bool gen_ret = gen_to_be_invoked.SatisfyExchangeBetter( __id ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_IsAnySatisfyExchangeBetterEquip(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int __class = LuaAPI.xlua_tointeger(L, 2); |
| | | int __id; |
| | | |
| | | bool gen_ret = gen_to_be_invoked.IsAnySatisfyExchangeBetterEquip( __class, out __id ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | LuaAPI.xlua_pushinteger(L, __id); |
| | | |
| | | |
| | | |
| | | |
| | | return 2; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_IsAnySatisfyExchangeBetter(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int __itemId = LuaAPI.xlua_tointeger(L, 2); |
| | | |
| | | bool gen_ret = gen_to_be_invoked.IsAnySatisfyExchangeBetter( __itemId ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_trialExchangeRemindLevel(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.trialExchangeRemindLevel); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_trialSweepGradeLimit(RealStatePtr L) |
| | |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_selectEquipClass(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.selectEquipClass); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_openFromTask(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushboolean(L, gen_to_be_invoked.openFromTask); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_trialClassTokens(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.trialClassTokens); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_trialTokens(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.trialTokens); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_selectEquipClass(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.selectEquipClass = LuaAPI.xlua_tointeger(L, 2); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_openFromTask(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.openFromTask = LuaAPI.lua_toboolean(L, 2); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_trialClassTokens(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.trialClassTokens = (System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<int>>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<int>>)); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_trialTokens(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.trialTokens = (System.Collections.Generic.List<int>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List<int>)); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _e_SelectEquipClassEvent(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | int gen_param_count = LuaAPI.lua_gettop(L); |
| | | Snxxz.UI.TrialDungeonModel gen_to_be_invoked = (Snxxz.UI.TrialDungeonModel)translator.FastGetCSObj(L, 1); |
| | | System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3); |
| | | if (gen_delegate == null) { |
| | | return LuaAPI.luaL_error(L, "#3 need System.Action!"); |
| | | } |
| | | |
| | | if (gen_param_count == 3) |
| | | { |
| | | |
| | | if (LuaAPI.xlua_is_eq_str(L, 2, "+")) { |
| | | gen_to_be_invoked.SelectEquipClassEvent += gen_delegate; |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | if (LuaAPI.xlua_is_eq_str(L, 2, "-")) { |
| | | gen_to_be_invoked.SelectEquipClassEvent -= gen_delegate; |
| | | return 0; |
| | | } |
| | | |
| | | } |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | LuaAPI.luaL_error(L, "invalid arguments to Snxxz.UI.TrialDungeonModel.SelectEquipClassEvent!"); |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | translator.DelayWrapLoader(typeof(TreasureUpConfig), TreasureUpConfigWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(TrialExchangeConfig), TrialExchangeConfigWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(TrialRewardsConfig), TrialRewardsConfigWrap.__Register); |
| | | |
| | | |
| | |
| | | translator.DelayWrapLoader(typeof(CoroutineMgr), CoroutineMgrWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(BuyItemPopModel), BuyItemPopModelWrap.__Register); |
| | | translator.DelayWrapLoader(typeof(BuyItemController), BuyItemPopModelWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.BuySuccessModel), SnxxzUIBuySuccessModelWrap.__Register); |
| | |
| | | int addBuyCnt = 0;
|
| | | int curVipIndex = -1;
|
| | | int nextVipIndex = -1;
|
| | | bool isVipBuy = BuyItemPopModel.Instance.CheckIsVipBuy(storeConfig, out curVipIndex, out nextVipIndex);
|
| | | bool isLimitBuy = BuyItemPopModel.Instance.CheckIsLimitBuyCnt(storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isVipBuy = BuyItemController.Instance.CheckIsVipBuy(storeConfig, out curVipIndex, out nextVipIndex);
|
| | | bool isLimitBuy = BuyItemController.Instance.CheckIsLimitBuyCnt(storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isShowBuyPrice = true;
|
| | | if(isVipBuy)
|
| | | {
|
| | |
| | | {
|
| | | if (data != null)
|
| | | {
|
| | | switch ((DailyQuestType)data.id)
|
| | | {
|
| | | case DailyQuestType.Trial:
|
| | | if (!trialDungeonModel.CompleteTrialFloor(0))
|
| | | {
|
| | | trialDungeonModel.ProcessOpenTrialExchangeError();
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<TrialExchangeWin>();
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | case HazyGrassModel.Client_ReikiGrassMapID:
|
| | | ModelCenter.Instance.GetModel<HazyGrassModel>().RequestExitClientDungeon();
|
| | | break;
|
| | | case ClientTreasureDungeon.Client_DataMap:
|
| | | ClientTreasureDungeon.RequestExit();
|
| | | break;
|
| | | default:
|
| | | model.ExitCurrentDungeon();
|
| | | break;
|
| | |
| | | {
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | switch (ClientDungeonStageUtility.clientMapId)
|
| | | {
|
| | | case ClientTreasureDungeon.Client_DataMap:
|
| | | ClientTreasureDungeon.RequestExit();
|
| | | break;
|
| | | }
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | ConfirmCancel.ShowRuneTowerPopConfirm(
|
| | | Language.Get("Mail101"),
|
| | | Language.Get("RuneTower25", config.Fightpower),
|
| | | (Action<bool>)((bool ok) =>
|
| | | (Action<bool>)((bool ok) =>
|
| | | {
|
| | | if (ok)
|
| | | {
|
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI |
| | | { |
| | | public class DungeonGetTreasureVictoryWin : DungeonVictoryWin |
| | | { |
| | | protected override void Display() |
| | | { |
| | | base.RequireDungeonExit(); |
| | | m_ContainerPoivt.gameObject.SetActive(true); |
| | | base.DrawGetExp(); |
| | | base.DrawPassTime(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class DungeonGetTreasureVictoryWin : DungeonVictoryWin
|
| | | {
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Exit.SetListener(OnExit);
|
| | | }
|
| | |
|
| | | private void OnExit()
|
| | | {
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | ClientTreasureDungeon.RequestExit();
|
| | | }
|
| | | else
|
| | | {
|
| | | dungeonModel.ExitCurrentDungeon();
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void Display()
|
| | | {
|
| | | base.RequireDungeonExit();
|
| | | m_ContainerPoivt.gameObject.SetActive(true);
|
| | | base.DrawGetExp();
|
| | | base.DrawPassTime();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | UpdateCoolDown(DungeonCoolDownType.LeaveMap, 7 * 1000);
|
| | | }
|
| | | WindowCenter.Instance.Open<DungeonGetTreasureVictoryWin>();
|
| | | WindowCenter.Instance.Open<TreasureDungeonVictoryWin>();
|
| | | break;
|
| | |
| | | [XLua.LuaCallCSharp]
|
| | | public class TrialDungeonModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, List<TrialExchangeConfig>> trialTokenExchangeDict = new Dictionary<int, List<TrialExchangeConfig>>();
|
| | | Dictionary<int, int> lineToTokenClassDict;
|
| | | Dictionary<int, Dictionary<int, Item[]>> trialRewardDict = new Dictionary<int, Dictionary<int, Item[]>>();
|
| | | Dictionary<int, int> trialDungeonPetHorseLevels = null;
|
| | | public Dictionary<int, List<int>> trialClassTokens = new Dictionary<int, List<int>>();
|
| | | public List<int> trialTokens = new List<int>();
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | PetModel petModel { get { return ModelCenter.Instance.GetModel<PetModel>(); } }
|
| | | MountModel horseModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
|
| | |
|
| | | public event Action SelectEquipClassEvent;
|
| | |
|
| | | bool serverInited = false;
|
| | |
|
| | | public const int TRIALEXCHANGE_GUIDE = 91;
|
| | | public const int TRIALDUNGOEN_MAPID = 60010;
|
| | |
|
| | | int m_TrialExchangeRemindLevel = 250;
|
| | | public int trialExchangeRemindLevel
|
| | | {
|
| | | get { return m_TrialExchangeRemindLevel; }
|
| | | }
|
| | |
|
| | | public int trialSweepGradeLimit { get; private set; }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | | packModel.refreshItemCountEvent += RefreshItemCountAct;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | dungeonModel.dungeonRecordChangeEvent += DungeonRecordChangeEvent;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshInfoEvent;
|
| | | }
|
| | |
|
| | | private void DungeonRecordChangeEvent(int _dungeonId)
|
| | | {
|
| | | if (_dungeonId == 60010)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | serverInited = true;
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | var configs = TrialExchangeConfig.GetValues();
|
| | | for (int i = 0; i < configs.Count; i++)
|
| | | {
|
| | | List<TrialExchangeConfig> list;
|
| | | var itemConfig = ItemConfig.Get(configs[i].tokenId);
|
| | | if (!trialTokenExchangeDict.TryGetValue(itemConfig.LV, out list))
|
| | | {
|
| | | list = new List<TrialExchangeConfig>();
|
| | | trialTokenExchangeDict.Add(itemConfig.LV, list);
|
| | | }
|
| | | list.Add(configs[i]);
|
| | | if (!trialTokens.Contains(configs[i].tokenId))
|
| | | {
|
| | | trialTokens.Add(configs[i].tokenId);
|
| | | List<int> _tokens;
|
| | | if (!trialClassTokens.TryGetValue(itemConfig.LV, out _tokens))
|
| | | {
|
| | | _tokens = new List<int>();
|
| | | trialClassTokens.Add(itemConfig.LV, _tokens);
|
| | | }
|
| | | if (!_tokens.Contains(configs[i].tokenId))
|
| | | {
|
| | | _tokens.Add(configs[i].tokenId);
|
| | | }
|
| | | }
|
| | | }
|
| | | var funcConfig = FuncConfigConfig.Get("LineToItemStage");
|
| | | lineToTokenClassDict = ConfigParse.GetDic<int, int>(funcConfig.Numerical1);
|
| | |
|
| | | var trialRewards = TrialRewardsConfig.GetValues();
|
| | | for (int i = 0; i < trialRewards.Count; i++)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | funcConfig = FuncConfigConfig.Get("MunekadoRedPoint");
|
| | | if (funcConfig != null)
|
| | | {
|
| | | m_TrialExchangeRemindLevel = int.Parse(funcConfig.Numerical1);
|
| | | }
|
| | |
|
| | | funcConfig = FuncConfigConfig.Get("TrialSweepGradeLimit");
|
| | | var funcConfig = FuncConfigConfig.Get("TrialSweepGradeLimit");
|
| | | if (funcConfig != null)
|
| | | {
|
| | | trialSweepGradeLimit = int.Parse(funcConfig.Numerical1);
|
| | |
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshInfoEvent;
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataType refreshType)
|
| | | {
|
| | | if (refreshType == PlayerDataType.LV ||
|
| | | refreshType == PlayerDataType.LV2 ||
|
| | | refreshType == PlayerDataType.LVEx)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshItemCountAct(PackType packType, int arg2, int itemId)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (packType == PackType.Item)
|
| | | {
|
| | | if (trialTokens.Contains(itemId) || config.EquipPlace > 0)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | | else if (packType == PackType.Equip)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int _id)
|
| | | {
|
| | | if (_id == 88)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | int m_SelectEquipClass = 0;//1-全部阶数
|
| | | public int selectEquipClass
|
| | | {
|
| | | get { return m_SelectEquipClass; }
|
| | | set
|
| | | {
|
| | | if (m_SelectEquipClass != value && SelectEquipClassEvent != null)
|
| | | {
|
| | | m_SelectEquipClass = value;
|
| | | SelectEquipClassEvent();
|
| | | }
|
| | | m_SelectEquipClass = value;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool openFromTask { get; set; }
|
| | |
|
| | | public int GetTrialTokenCount(int itemId)
|
| | | {
|
| | | var count = 0;
|
| | | count += packModel.GetSinglePack(PackType.Item).GetCountById(itemId);
|
| | | return count;
|
| | | }
|
| | |
|
| | | public int LineToTokenClass(int line)
|
| | | {
|
| | | if (lineToTokenClassDict != null && lineToTokenClassDict.ContainsKey(line))
|
| | | {
|
| | | return lineToTokenClassDict[line];
|
| | | }
|
| | | return lineToTokenClassDict != null ? lineToTokenClassDict.Values.Last() : 0;
|
| | | }
|
| | |
|
| | | public bool TryGetTrialExchanges(int lv, out List<TrialExchangeConfig> list)
|
| | | {
|
| | | return trialTokenExchangeDict.TryGetValue(lv, out list);
|
| | | }
|
| | |
|
| | | public bool TryGetTrialRewards(int lineId, int grade, out Item[] rewards)
|
| | |
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public List<int> GetTotalClass()
|
| | | {
|
| | | return trialTokenExchangeDict.Keys.ToList();
|
| | | }
|
| | |
|
| | | public bool TrialSendExchange(int _id, out int error)
|
| | | {
|
| | | error = 0;
|
| | | if (!FuncOpen.Instance.IsFuncOpen(88))
|
| | | {
|
| | | error = 2;
|
| | | return false;
|
| | | }
|
| | | var config = TrialExchangeConfig.Get(_id);
|
| | | if (config == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var count = GetTrialTokenCount(config.tokenId);
|
| | | if (count < config.tokenCount)
|
| | | {
|
| | | error = 1;
|
| | | return false;
|
| | | }
|
| | | //if (!NewBieCenter.Instance.completeGuidesBuf.Contains(TRIALEXCHANGE_GUIDE))
|
| | | //{
|
| | | // NewBieCenter.Instance.RemoveNewBieGuide(TRIALEXCHANGE_GUIDE);
|
| | | //}
|
| | | //var tokenConfig = ItemConfig.Get(config.tokenId);
|
| | | //ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
|
| | | // Language.Get("TokenUseConfirm", config.tokenCount, tokenConfig.ItemName, config.description), (bool isOk) =>
|
| | | // {
|
| | | // if (isOk)
|
| | | // {
|
| | | CA32F_tagCMTrialExchange pak = new CA32F_tagCMTrialExchange();
|
| | | pak.ID = (uint)_id;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | // }
|
| | | // });
|
| | | return true;
|
| | | }
|
| | |
|
| | | public void ProcessTrialError(int error)
|
| | |
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void ProcessOpenTrialExchangeError()
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("TrialExchangeLimit");
|
| | | }
|
| | |
|
| | | public int EquipCompare(int _itemId)
|
| | | {
|
| | | var config = ItemConfig.Get(_itemId);
|
| | | var equipPlace = config.EquipPlace;
|
| | | if (equipPlace == 0)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | var singlepack = packModel.GetSinglePack(PackType.Item);
|
| | | if (singlepack != null)
|
| | | {
|
| | | var dict = singlepack.GetAllItems();
|
| | | if (dict != null)
|
| | | {
|
| | | var badCompare = 1;
|
| | | foreach (var itemModel in dict.Values)
|
| | | {
|
| | | if (itemModel.config.EquipPlace == config.EquipPlace
|
| | | && ItemLogicUtility.Instance.IsJobCompatibleItem(itemModel.itemId)
|
| | | && !ItemLogicUtility.Instance.IsOverdue(itemModel.guid))
|
| | | {
|
| | | var compare = EquipCompare(itemModel, config);
|
| | | if (compare == 0)
|
| | | {
|
| | | badCompare = compare;
|
| | | }
|
| | | if (compare == -1)
|
| | | {
|
| | | return compare;
|
| | | }
|
| | | }
|
| | | }
|
| | | if (badCompare == 0)
|
| | | {
|
| | | return badCompare;
|
| | | }
|
| | | }
|
| | | }
|
| | | singlepack = packModel.GetSinglePack(PackType.Equip);
|
| | | if (singlepack == null)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | var equipItem = singlepack.GetItemByIndex(equipPlace);
|
| | | if (equipItem == null)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | return EquipCompare(equipItem, config);
|
| | | }
|
| | |
|
| | | int EquipCompare(ItemModel compareItem, ItemConfig config)
|
| | | {
|
| | | var compareConfig = ItemConfig.Get(compareItem.itemId);
|
| | | if (compareConfig == null)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | if (compareConfig.ItemColor != config.ItemColor)
|
| | | {
|
| | | return compareConfig.ItemColor > config.ItemColor ? -1 : 1;
|
| | | }
|
| | | if (compareConfig.StarLevel != config.StarLevel)
|
| | | {
|
| | | return compareConfig.StarLevel > config.StarLevel ? -1 : 1;
|
| | | }
|
| | | if (compareConfig.LV != config.LV)
|
| | | {
|
| | | return compareConfig.LV > config.LV ? -1 : 1;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public int GetExchangeItemByJob(TrialExchangeConfig config)
|
| | | {
|
| | | if (config == null)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | if (config.exchangeItemID.Length == 1)
|
| | | {
|
| | | return config.exchangeItemID[0];
|
| | | }
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | if (job - 1 < config.exchangeItemID.Length && job - 1 >= 0)
|
| | | {
|
| | | return config.exchangeItemID[job - 1];
|
| | | }
|
| | | return config.exchangeItemID[0];
|
| | | }
|
| | |
|
| | | public int GetDungeonRequirePetHorseLevel(int lineId)
|
| | |
| | | }
|
| | | return level;
|
| | | }
|
| | |
|
| | | #region 红点
|
| | | void UpdateRedpoint()
|
| | | {
|
| | | //dailyQuestModel.trialExchangeRedpoint.state = RedPointState.None;
|
| | | //if (!FuncOpen.Instance.IsFuncOpen(88) ||
|
| | | // PlayerDatas.Instance.baseData.LV >= trialExchangeRemindLevel)
|
| | | //{
|
| | | // return;
|
| | | //}
|
| | | //var maxClass = 0;
|
| | | //if (TryGetSatisfyExchange(out maxClass))
|
| | | //{
|
| | | // dailyQuestModel.trialExchangeRedpoint.state = RedPointState.Simple;
|
| | | //}
|
| | | }
|
| | |
|
| | | public bool TryGetSatisfyExchange(out int maxClass)
|
| | | {
|
| | | maxClass = 0;
|
| | | foreach (var _class in trialTokenExchangeDict.Keys)
|
| | | {
|
| | | List<TrialExchangeConfig> list;
|
| | | if (TryGetTrialExchanges(_class, out list))
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | if (SatisfyExchangeBetter(list[i].id))
|
| | | {
|
| | | var itemConfig = ItemConfig.Get(list[i].tokenId);
|
| | | if (itemConfig.LV > maxClass)
|
| | | {
|
| | | maxClass = itemConfig.LV;
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return maxClass != 0;
|
| | | }
|
| | |
|
| | | public bool SatisfyExchangeBetter(int _id)
|
| | | {
|
| | | if (!CompleteTrialFloor(0))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var config = TrialExchangeConfig.Get(_id);
|
| | | if (config == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var count = GetTrialTokenCount(config.tokenId);
|
| | | if (count < config.tokenCount)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var exchangeItemConfig = ItemConfig.Get(GetExchangeItemByJob(config));
|
| | | if (exchangeItemConfig.EquipPlace == 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | if (EquipCompare(GetExchangeItemByJob(config)) == 1)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsAnySatisfyExchangeBetterEquip(int _class, out int _id)
|
| | | {
|
| | | _id = -1;
|
| | | List<TrialExchangeConfig> list;
|
| | | if (TryGetTrialExchanges(_class, out list))
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | var itemConfig = ItemConfig.Get(GetExchangeItemByJob(list[i]));
|
| | | if (SatisfyExchangeBetter(list[i].id) && itemConfig.EquipPlace != 0)
|
| | | {
|
| | | _id = list[i].id;
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsAnySatisfyExchangeBetter(int _itemId)
|
| | | {
|
| | | return false;
|
| | | if (PlayerDatas.Instance.baseData.LV >= trialExchangeRemindLevel)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (!trialTokens.Contains(_itemId))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var config = ItemConfig.Get(_itemId);
|
| | | List<TrialExchangeConfig> list;
|
| | | if (TryGetTrialExchanges(config.LV, out list))
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | if (list[i].tokenId == _itemId && SatisfyExchangeBetter(list[i].id))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | itemCell.Init(cellModel);
|
| | | int canBuyCnt = 0;
|
| | | int addBuyCnt = 0;
|
| | | bool isLimitBuy = BuyItemPopModel.Instance.CheckIsLimitBuyCnt(storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isLimitBuy = BuyItemController.Instance.CheckIsLimitBuyCnt(storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | if (canBuyCnt > 0)
|
| | | {
|
| | | itemCell.countText.gameObject.SetActive(true);
|
| | |
| | | { |
| | | public int itemId; |
| | | public string guid; |
| | | public int goodId; |
| | | |
| | | public BaseInfo baseInfo; |
| | | public BaseProperty baseProperty; |
| | |
| | | public int count; |
| | | public bool isAuction; |
| | | public bool isEquiped; |
| | | public bool isPreview; |
| | | |
| | | public int star; |
| | | public int strengthenLevel; |
| | |
| | | static MountModel mountModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } } |
| | | static PetModel petModel { get { return ModelCenter.Instance.GetModel<PetModel>(); } } |
| | | static ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } } |
| | | static StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } } |
| | | |
| | | public static TipType tipType { get; private set; } |
| | | public static TipData mainTipData { get; private set; } |
| | | public static TipData secondaryData { get; private set; } |
| | | |
| | | public static void Show(int itemId, TipType type = TipType.Normal) |
| | | public static void Show(int itemId) |
| | | { |
| | | tipType = type; |
| | | secondaryData = null; |
| | | |
| | | var isEquip = ItemLogicUtility.Instance.IsEquip(itemId); |
| | |
| | | } |
| | | |
| | | var config = ItemConfig.Get(itemId); |
| | | switch (type) |
| | | if (isEquip) |
| | | { |
| | | case TipType.Normal: |
| | | if (isEquip) |
| | | { |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | } |
| | | else |
| | | { |
| | | switch (config.Type) |
| | | { |
| | | case 26: |
| | | case 41: |
| | | case 42: |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | case 113: |
| | | WindowCenter.Instance.Open<WingTipWin>(); |
| | | break; |
| | | case 114: |
| | | WindowCenter.Instance.Open<GuardTipWin>(); |
| | | break; |
| | | default: |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case TipType.Good: |
| | | WindowCenter.Instance.Open<GoodTipWin>(); |
| | | break; |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | } |
| | | else |
| | | { |
| | | switch (config.Type) |
| | | { |
| | | case 26: |
| | | case 41: |
| | | case 42: |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | case 113: |
| | | WindowCenter.Instance.Open<WingTipWin>(); |
| | | break; |
| | | case 114: |
| | | WindowCenter.Instance.Open<GuardTipWin>(); |
| | | break; |
| | | default: |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | break; |
| | | } |
| | | |
| | | switch (tipType) |
| | | if (isEquip) |
| | | { |
| | | case TipType.Normal: |
| | | if (isEquip) |
| | | { |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | } |
| | | else |
| | | { |
| | | switch (item.config.Type) |
| | | { |
| | | case 26: |
| | | case 41: |
| | | case 42: |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | case 113: |
| | | WindowCenter.Instance.Open<WingTipWin>(); |
| | | break; |
| | | case 114: |
| | | WindowCenter.Instance.Open<GuardTipWin>(); |
| | | break; |
| | | default: |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case TipType.Good: |
| | | WindowCenter.Instance.Open<GoodTipWin>(); |
| | | break; |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | } |
| | | else |
| | | { |
| | | switch (item.config.Type) |
| | | { |
| | | case 26: |
| | | case 41: |
| | | case 42: |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | case 113: |
| | | WindowCenter.Instance.Open<WingTipWin>(); |
| | | break; |
| | | case 114: |
| | | WindowCenter.Instance.Open<GuardTipWin>(); |
| | | break; |
| | | default: |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static void ShowGood(int goodId, int itemId) |
| | | { |
| | | secondaryData = null; |
| | | |
| | | var isEquip = ItemLogicUtility.Instance.IsEquip(itemId); |
| | | if (isEquip) |
| | | { |
| | | mainTipData = CreateGoodEquipData(itemId, goodId); |
| | | } |
| | | else |
| | | { |
| | | mainTipData = CreateGoodItemData(itemId, goodId); |
| | | } |
| | | |
| | | var itemConfig = ItemConfig.Get(itemId); |
| | | if (isEquip) |
| | | { |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | } |
| | | else |
| | | { |
| | | switch (itemConfig.Type) |
| | | { |
| | | case 26: |
| | | case 41: |
| | | case 42: |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | case 113: |
| | | WindowCenter.Instance.Open<WingTipWin>(); |
| | | break; |
| | | case 114: |
| | | WindowCenter.Instance.Open<GuardTipWin>(); |
| | | break; |
| | | default: |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | gemInfo = GetGemInfo(itemId), |
| | | starInfo = GetStarInfo(itemId), |
| | | getWay = GetGetWay(itemId) |
| | | }; |
| | | } |
| | | |
| | | static TipData CreateGoodEquipData(int itemId, int goodId) |
| | | { |
| | | return new TipData() |
| | | { |
| | | itemId = itemId, |
| | | guid = string.Empty, |
| | | goodId = goodId, |
| | | |
| | | baseInfo = GetBaseInfo(itemId), |
| | | baseProperty = GetBaseProperty(itemId), |
| | | legendProperty = GetLegendProperty(itemId), |
| | | skillInfo = GetSkillInfo(itemId), |
| | | suitInfo = GetSuitInfo(itemId), |
| | | gemInfo = GetGemInfo(itemId), |
| | | starInfo = GetStarInfo(itemId), |
| | | operates = GetGoodOperates(goodId) |
| | | }; |
| | | } |
| | | |
| | |
| | | baseProperty = GetBaseProperty(itemId), |
| | | legendProperty = GetLegendProperty(itemId), |
| | | petMountBaseProperty = GetPetMountBaseProperty(itemId), |
| | | getWay = GetGetWay(itemId) |
| | | getWay = GetGetWay(itemId), |
| | | }; |
| | | } |
| | | |
| | | static TipData CreateGoodItemData(int itemId, int goodId) |
| | | { |
| | | return new TipData() |
| | | { |
| | | itemId = itemId, |
| | | goodId = goodId, |
| | | baseInfo = GetBaseInfo(itemId), |
| | | baseProperty = GetBaseProperty(itemId), |
| | | legendProperty = GetLegendProperty(itemId), |
| | | petMountBaseProperty = GetPetMountBaseProperty(itemId), |
| | | operates = GetGoodOperates(goodId), |
| | | }; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public static void GoodOperate(ItemOperateType type, int goodId, int count) |
| | | { |
| | | var config = StoreConfig.Get(goodId); |
| | | storeModel.SendBuyShopItem(config, count); |
| | | } |
| | | |
| | | private static BaseInfo GetBaseInfo(int itemId) |
| | | { |
| | | var config = ItemConfig.Get(itemId); |
| | |
| | | itemId = itemId, |
| | | isAuction = false, |
| | | isEquiped = false, |
| | | isPreview = true, |
| | | score = ItemLogicUtility.Instance.GetEquipScore(PackType.Item, itemId, null, true), |
| | | auctionSurplusTime = 0, |
| | | levelLimit = config.UseLV, |
| | |
| | | count = item.count, |
| | | isAuction = item.isAuction, |
| | | isEquiped = isEquiped, |
| | | isPreview = false, |
| | | score = item.score, |
| | | auctionSurplusTime = item.isAuction ? item.auctionSurplusTime : 0, |
| | | overdueSurplusTime = item.overdueSurplusTime, |
| | |
| | | return operates; |
| | | } |
| | | |
| | | private static List<ItemOperateType> GetGoodOperates(int goodId) |
| | | { |
| | | var operates = new List<ItemOperateType>(); |
| | | var countLimit = BuyItemController.Instance.GetBuyCountLimit(goodId, PlayerDatas.Instance.baseData.VIPLv); |
| | | if (countLimit == -1 || countLimit > 0) |
| | | { |
| | | operates.Add(ItemOperateType.buy); |
| | | } |
| | | |
| | | return operates; |
| | | } |
| | | |
| | | private static bool IsEquipGemHoleOpen(Int2 equipPosition, int maxStar, int hole) |
| | | { |
| | | GemHoleCondition condition; |
| | |
| | | [SerializeField] WidgetGroup m_MainWidgetGroup; |
| | | [SerializeField] WidgetGroup m_SecondaryWidgetGroup; |
| | | |
| | | [SerializeField] OperateButton[] m_OpreateButtons; |
| | | [SerializeField] TipOperateButton[] m_OpreateButtons; |
| | | [SerializeField] Button m_Close; |
| | | |
| | | #region Built-in |
| | |
| | | if (i < operates.Count) |
| | | { |
| | | button.SetActive(true); |
| | | button.Bind(operates[i], guid); |
| | | button.Bind("EquipTipWin", operates[i], guid); |
| | | } |
| | | else |
| | | { |
| | |
| | | public TipJobAndPlaceWidget jobAndPlaceWidget; |
| | | public TipGetWayEntranceWidget getWayEntranceWidget; |
| | | public TipGetWaysWidget getWaysWidget; |
| | | public TipBuyItemWidget buyItemWidget; |
| | | |
| | | public void SetActive(bool active) |
| | | { |
| | |
| | | |
| | | jobAndPlaceWidget.Display(data.itemId); |
| | | |
| | | if (buyItemWidget != null) |
| | | { |
| | | buyItemWidget.gameObject.SetActive(data.goodId > 0); |
| | | if (data.goodId > 0) |
| | | { |
| | | buyItemWidget.Display(data.goodId); |
| | | } |
| | | } |
| | | |
| | | if (getWayEntranceWidget != null && getWaysWidget != null) |
| | | { |
| | | var getWay = EquipTipUtility.mainTipData.getWay; |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | [Serializable] |
| | | public class OperateButton |
| | | { |
| | | public RectTransform container; |
| | | public Button button; |
| | | public Text title; |
| | | |
| | | ItemOperateType operateType; |
| | | string guid; |
| | | |
| | | public void SetActive(bool active) |
| | | { |
| | | container.gameObject.SetActive(active); |
| | | } |
| | | |
| | | public void Bind(ItemOperateType type, string guid) |
| | | { |
| | | operateType = type; |
| | | this.guid = guid; |
| | | switch (type) |
| | | { |
| | | case ItemOperateType.putOn: |
| | | this.title.text = "穿上"; |
| | | break; |
| | | case ItemOperateType.putOff: |
| | | this.title.text = "脱下"; |
| | | break; |
| | | case ItemOperateType.putAway: |
| | | this.title.text = "上架"; |
| | | break; |
| | | case ItemOperateType.strength: |
| | | this.title.text = "强化"; |
| | | break; |
| | | case ItemOperateType.star: |
| | | this.title.text = "升星"; |
| | | break; |
| | | case ItemOperateType.inlay: |
| | | this.title.text = "镶嵌"; |
| | | break; |
| | | case ItemOperateType.train: |
| | | this.title.text = "洗炼"; |
| | | break; |
| | | case ItemOperateType.sell: |
| | | this.title.text = "出售"; |
| | | break; |
| | | case ItemOperateType.putOut: |
| | | this.title.text = "取出"; |
| | | break; |
| | | case ItemOperateType.putIn: |
| | | this.title.text = "放入"; |
| | | break; |
| | | default: |
| | | this.title.text = ""; |
| | | break; |
| | | } |
| | | |
| | | button.SetListener(() => |
| | | { |
| | | WindowCenter.Instance.Close<EquipTipWin>(); |
| | | EquipTipUtility.Operate(operateType, this.guid); |
| | | }); |
| | | } |
| | | |
| | | } |
| | |
| | | [SerializeField] TipItemBaseInfoWidget m_BaseInfoWidget; |
| | | [SerializeField] TipBasePropertyWidget m_BasePropertyWidget; |
| | | [SerializeField] TipItemDescriptionWidget m_DescriptionWidget; |
| | | [SerializeField] TipBuyItemWidget m_BuyItemWidget; |
| | | [SerializeField] TipGetWayEntranceWidget m_GetWayEntranceWidget; |
| | | [SerializeField] TipGetWaysWidget m_GetWaysWidget; |
| | | [SerializeField] TipJobAndPlaceWidget m_JobAndPlaceWidget; |
| | | [SerializeField] OperateButton[] m_OperateButtons; |
| | | [SerializeField] TipOperateButton[] m_OperateButtons; |
| | | [SerializeField] Button m_Close; |
| | | |
| | | #region Built-in |
| | |
| | | DisplayBaseInfo(); |
| | | DisplayBaseProperty(); |
| | | DisplayItemDescription(); |
| | | DisplayBuyItem(); |
| | | DisplayJobAndPlace(); |
| | | DisplayGetWays(); |
| | | DisplayOperateButton(); |
| | |
| | | { |
| | | var itemId = EquipTipUtility.mainTipData.baseInfo.itemId; |
| | | m_DescriptionWidget.Display(itemId); |
| | | } |
| | | |
| | | private void DisplayBuyItem() |
| | | { |
| | | m_BuyItemWidget.gameObject.SetActive(EquipTipUtility.mainTipData.goodId > 0); |
| | | if (EquipTipUtility.mainTipData.goodId > 0) |
| | | { |
| | | m_BuyItemWidget.Display(EquipTipUtility.mainTipData.goodId); |
| | | } |
| | | } |
| | | |
| | | private void DisplayGetWays() |
| | |
| | | if (i < operates.Count) |
| | | { |
| | | button.SetActive(true); |
| | | button.Bind(operates[i], guid); |
| | | button.Bind("GuardTipWin", operates[i], guid); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | [Serializable] |
| | | public class OperateButton |
| | | { |
| | | [SerializeField] RectTransform m_Container; |
| | | [SerializeField] Button m_Button; |
| | | [SerializeField] Text m_Title; |
| | | |
| | | ItemOperateType operateType; |
| | | string guid; |
| | | |
| | | public void SetActive(bool active) |
| | | { |
| | | this.m_Container.gameObject.SetActive(active); |
| | | } |
| | | |
| | | public void Bind(ItemOperateType type, string guid) |
| | | { |
| | | operateType = type; |
| | | this.guid = guid; |
| | | switch (type) |
| | | { |
| | | case ItemOperateType.putOn: |
| | | this.m_Title.text = "穿上"; |
| | | break; |
| | | case ItemOperateType.putOff: |
| | | this.m_Title.text = "脱下"; |
| | | break; |
| | | case ItemOperateType.sell: |
| | | this.m_Title.text = "出售"; |
| | | break; |
| | | case ItemOperateType.putOut: |
| | | this.m_Title.text = "取出"; |
| | | break; |
| | | case ItemOperateType.putIn: |
| | | this.m_Title.text = "放入"; |
| | | break; |
| | | default: |
| | | this.m_Title.text = ""; |
| | | break; |
| | | } |
| | | |
| | | m_Button.SetListener(() => |
| | | { |
| | | WindowCenter.Instance.Close<GuardTipWin>(); |
| | | EquipTipUtility.Operate(operateType, this.guid); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | [SerializeField] TipItemDescriptionWidget m_DescriptionWidget; |
| | | [SerializeField] TipAuctionTipWidget m_AuctionWidget; |
| | | [SerializeField] TipModelWidget m_ModelWidget; |
| | | [SerializeField] TipBuyItemWidget m_BuyItemWidget; |
| | | [SerializeField] TipGetWayEntranceWidget m_GetWayEntranceWidget; |
| | | [SerializeField] TipGetWaysWidget m_GetWaysWidget; |
| | | |
| | | [SerializeField] OperateButton[] m_OperateButtons; |
| | | [SerializeField] TipOperateButton[] m_OperateButtons; |
| | | |
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | |
| | |
| | | DisplayItemDescription(); |
| | | DisplayItemUseState(); |
| | | DisplayAuctionInfo(); |
| | | DisplayBuyItem(); |
| | | DisplayGetWays(); |
| | | DisplayOperateButton(); |
| | | DisplayModel(); |
| | |
| | | |
| | | } |
| | | |
| | | private void DisplayBuyItem() |
| | | { |
| | | m_BuyItemWidget.gameObject.SetActive(EquipTipUtility.mainTipData.goodId > 0); |
| | | if (EquipTipUtility.mainTipData.goodId > 0) |
| | | { |
| | | m_BuyItemWidget.Display(EquipTipUtility.mainTipData.goodId); |
| | | } |
| | | } |
| | | |
| | | private void DisplayGetWays() |
| | | { |
| | | var getWay = EquipTipUtility.mainTipData.getWay; |
| | |
| | | if (i < operates.Count) |
| | | { |
| | | button.SetActive(true); |
| | | button.Bind(operates[i], guid); |
| | | button.Bind("ItemTipWin", operates[i], guid); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | [Serializable] |
| | | public class OperateButton |
| | | { |
| | | [SerializeField] RectTransform m_Container; |
| | | [SerializeField] Button m_Button; |
| | | [SerializeField] Text m_Title; |
| | | |
| | | ItemOperateType operateType; |
| | | string guid; |
| | | |
| | | public void SetActive(bool active) |
| | | { |
| | | this.m_Container.gameObject.SetActive(active); |
| | | } |
| | | |
| | | public void Bind(ItemOperateType type, string guid) |
| | | { |
| | | operateType = type; |
| | | this.guid = guid; |
| | | switch (type) |
| | | { |
| | | case ItemOperateType.putAway: |
| | | this.m_Title.text = "上架"; |
| | | break; |
| | | case ItemOperateType.sell: |
| | | this.m_Title.text = "出售"; |
| | | break; |
| | | case ItemOperateType.makeUse: |
| | | this.m_Title.text = "使用"; |
| | | break; |
| | | case ItemOperateType.split: |
| | | this.m_Title.text = "拆分"; |
| | | break; |
| | | case ItemOperateType.inlay: |
| | | this.m_Title.text = "镶嵌"; |
| | | break; |
| | | case ItemOperateType.putOut: |
| | | this.m_Title.text = "取出"; |
| | | break; |
| | | case ItemOperateType.putIn: |
| | | this.m_Title.text = "放入"; |
| | | break; |
| | | case ItemOperateType.compose: |
| | | this.m_Title.text = "合成"; |
| | | break; |
| | | default: |
| | | this.m_Title.text = ""; |
| | | break; |
| | | } |
| | | |
| | | m_Button.SetListener(() => |
| | | { |
| | | WindowCenter.Instance.Close<ItemTipWin>(); |
| | | EquipTipUtility.Operate(operateType, this.guid); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | [SerializeField] TipPetMountSkillWidget m_PetMountSkill; |
| | | [SerializeField] TipAuctionTipWidget m_AuctionWidget; |
| | | [SerializeField] TipPetMountDescriptionWidget m_DescriptionWidget; |
| | | [SerializeField] TipBuyItemWidget m_BuyItemWidget; |
| | | [SerializeField] TipGetWayEntranceWidget m_GetWayEntranceWidget; |
| | | [SerializeField] TipGetWaysWidget m_GetWaysWidget; |
| | | [SerializeField] TipModelWidget m_Model; |
| | | [SerializeField] OperateButton[] m_OperateButtons; |
| | | [SerializeField] TipOperateButton[] m_OperateButtons; |
| | | |
| | | [SerializeField] Button m_Close; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private void DisplayBuyItem() |
| | | { |
| | | m_BuyItemWidget.gameObject.SetActive(EquipTipUtility.mainTipData.goodId > 0); |
| | | if (EquipTipUtility.mainTipData.goodId > 0) |
| | | { |
| | | m_BuyItemWidget.Display(EquipTipUtility.mainTipData.goodId); |
| | | } |
| | | } |
| | | |
| | | private void DisplayModel() |
| | | { |
| | | var baseInfo = EquipTipUtility.mainTipData.baseInfo; |
| | |
| | | if (i < operates.Count) |
| | | { |
| | | button.SetActive(true); |
| | | button.Bind(operates[i], guid); |
| | | button.Bind("PetMountTipWin", operates[i], guid); |
| | | } |
| | | else |
| | | { |
| | |
| | | DisplaySkills(); |
| | | DisplayAuctionInfo(); |
| | | DisplayDescription(); |
| | | DisplayBuyItem(); |
| | | DisplayGetWays(); |
| | | DisplayModel(); |
| | | DisplayOperateButton(); |
| | | } |
| | | |
| | | [Serializable] |
| | | public class OperateButton |
| | | { |
| | | [SerializeField] RectTransform m_Container; |
| | | [SerializeField] Button m_Button; |
| | | [SerializeField] Text m_Title; |
| | | |
| | | ItemOperateType operateType; |
| | | string guid; |
| | | |
| | | public void SetActive(bool active) |
| | | { |
| | | this.m_Container.gameObject.SetActive(active); |
| | | } |
| | | |
| | | public void Bind(ItemOperateType type, string guid) |
| | | { |
| | | operateType = type; |
| | | this.guid = guid; |
| | | switch (type) |
| | | { |
| | | case ItemOperateType.putAway: |
| | | this.m_Title.text = "上架"; |
| | | break; |
| | | case ItemOperateType.sell: |
| | | this.m_Title.text = "出售"; |
| | | break; |
| | | case ItemOperateType.makeUse: |
| | | this.m_Title.text = "使用"; |
| | | break; |
| | | case ItemOperateType.putOut: |
| | | this.m_Title.text = "取出"; |
| | | break; |
| | | case ItemOperateType.putIn: |
| | | this.m_Title.text = "放入"; |
| | | break; |
| | | default: |
| | | this.m_Title.text = ""; |
| | | break; |
| | | } |
| | | |
| | | m_Button.SetListener(() => |
| | | { |
| | | WindowCenter.Instance.Close<PetMountTipWin>(); |
| | | EquipTipUtility.Operate(operateType, this.guid); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | public enum ShowType |
| | |
| | | |
| | | public class TipBuyItemWidget : MonoBehaviour |
| | | { |
| | | [SerializeField] Text m_VipInfo; |
| | | [SerializeField] Text m_LimitInfo; |
| | | [SerializeField] Text m_Count; |
| | | [SerializeField] Button m_Reduce; |
| | | [SerializeField] Button m_Add; |
| | | [SerializeField] Button m_SetBuyCount; |
| | | |
| | | [SerializeField] Image m_MoneyIcon; |
| | | [SerializeField] Text m_Money; |
| | | |
| | | [SerializeField] NumKeyBoard m_KeyBoard; |
| | | |
| | | int goodId = 0; |
| | | |
| | | public void Display(int goodId) |
| | | { |
| | | this.goodId = goodId; |
| | | BuyItemController.Instance.SetGood(goodId); |
| | | var isVipLimit = BuyItemController.Instance.IsVipLimitGood(); |
| | | if (isVipLimit) |
| | | { |
| | | m_LimitInfo.gameObject.SetActive(true); |
| | | var limitCount = BuyItemController.Instance.GetBuyCountLimit(PlayerDatas.Instance.baseData.VIPLv); |
| | | var nextVipLevel = BuyItemController.Instance.GetNextCanbuyVipLevel(PlayerDatas.Instance.baseData.VIPLv); |
| | | if (nextVipLevel == 999) |
| | | { |
| | | m_LimitInfo.text = Language.Get("StoreWin109"); |
| | | } |
| | | else |
| | | { |
| | | var nextVipLimitCount = BuyItemController.Instance.GetBuyCountLimit(nextVipLevel); |
| | | m_LimitInfo.text = Language.Get("StoreWin108", limitCount, nextVipLevel, nextVipLimitCount); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var limitCount = BuyItemController.Instance.GetBuyCountLimit(PlayerDatas.Instance.baseData.VIPLv); |
| | | if (limitCount != -1 && limitCount <= 0) |
| | | { |
| | | m_LimitInfo.gameObject.SetActive(true); |
| | | m_LimitInfo.text = Language.Get("StoreWin109"); |
| | | } |
| | | else |
| | | { |
| | | m_LimitInfo.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | var config = StoreConfig.Get(goodId); |
| | | m_MoneyIcon.SetIconWithMoneyType(config.MoneyType); |
| | | m_MoneyIcon.SetNativeSize(); |
| | | m_KeyBoard.gameObject.SetActive(false); |
| | | |
| | | DisplayDynamicInfo(true); |
| | | } |
| | | |
| | | private void LateUpdate() |
| | | { |
| | | DisplayDynamicInfo(false); |
| | | } |
| | | |
| | | private void DisplayDynamicInfo(bool force) |
| | | { |
| | | if (force || BuyItemController.Instance.wannaBuyCount.dirty) |
| | | { |
| | | DisplayCountAndPrice(BuyItemController.Instance.wannaBuyCount.Fetch()); |
| | | } |
| | | } |
| | | |
| | | private void DisplayCountAndPrice(int count) |
| | | { |
| | | m_Count.text = count.ToString(); |
| | | var limitCount = BuyItemController.Instance.GetBuyCountLimit(PlayerDatas.Instance.baseData.VIPLv); |
| | | m_Count.color = UIHelper.GetUIColor(limitCount != -1 && limitCount <= 0 ? TextColType.Red : TextColType.Green); |
| | | |
| | | var config = StoreConfig.Get(this.goodId); |
| | | var moneyOwn = UIHelper.GetMoneyCnt(config.MoneyType); |
| | | var totalPrice = BuyItemController.Instance.GetTotalPrice(count); |
| | | m_Money.text = totalPrice.ToString(); |
| | | m_Money.color = UIHelper.GetUIColor((ulong)totalPrice > moneyOwn ? TextColType.Red : TextColType.Green); |
| | | } |
| | | |
| | | private void AddBuyCount() |
| | | { |
| | | BuyItemController.Instance.SetBuyCount(BuyItemController.Instance.wannaBuyCount.value + 1); |
| | | } |
| | | |
| | | private void ReduceBuyCount() |
| | | { |
| | | BuyItemController.Instance.SetBuyCount(BuyItemController.Instance.wannaBuyCount.value - 1); |
| | | } |
| | | |
| | | private void SetBuyCount(bool value) |
| | | { |
| | | m_KeyBoard.gameObject.SetActive(false); |
| | | if (value) |
| | | { |
| | | BuyItemController.Instance.SetBuyCount(int.Parse(m_KeyBoard.Value)); |
| | | } |
| | | } |
| | | |
| | | private void Start() |
| | | { |
| | | m_Add.SetListener(AddBuyCount); |
| | | m_Reduce.SetListener(ReduceBuyCount); |
| | | m_SetBuyCount.SetListener(() => { m_KeyBoard.gameObject.SetActive(true); }); |
| | | m_KeyBoard.onConfirm.AddListener(SetBuyCount); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | var myMoney = UIHelper.GetMoneyCnt(1); |
| | | m_Condition.text = Language.Get("OpenBoxCostMoney", baseInfo.moneyLimit); |
| | | m_Condition.color = UIHelper.GetUIColor(myMoney <(ulong) baseInfo.moneyLimit ? TextColType.Red : TextColType.Green); |
| | | m_Condition.color = UIHelper.GetUIColor(myMoney < (ulong)baseInfo.moneyLimit ? TextColType.Red : TextColType.Green); |
| | | } |
| | | else if (baseInfo.realmLimit > 0) |
| | | { |
| | |
| | | m_Condition.color = UIHelper.GetUIColor(playerLevel < itemConfig.UseLV ? TextColType.Red : TextColType.Green); |
| | | } |
| | | |
| | | if (baseInfo.isAuction) |
| | | if (baseInfo.isPreview) |
| | | { |
| | | m_SurplusTimeContainer.gameObject.SetActive(true); |
| | | if (baseInfo.auctionSurplusTime > 0) |
| | | { |
| | | m_SurplusTime.text = TimeUtility.SecondsToHMSCHSRetain(baseInfo.auctionSurplusTime); |
| | | } |
| | | else |
| | | { |
| | | m_SurplusTime.text = "已过期"; |
| | | } |
| | | } |
| | | else if (itemConfig.ExpireTime > 0) |
| | | { |
| | | m_SurplusTimeContainer.gameObject.SetActive(true); |
| | | if (baseInfo.overdueSurplusTime > 0) |
| | | { |
| | | m_SurplusTime.text = TimeUtility.SecondsToConsumeRebate(baseInfo.overdueSurplusTime); |
| | | } |
| | | else |
| | | { |
| | | m_SurplusTime.text = "已过期"; |
| | | } |
| | | m_SurplusTimeContainer.gameObject.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | m_SurplusTimeContainer.gameObject.SetActive(false); |
| | | if (baseInfo.isAuction) |
| | | { |
| | | m_SurplusTimeContainer.gameObject.SetActive(true); |
| | | if (baseInfo.auctionSurplusTime > 0) |
| | | { |
| | | m_SurplusTime.text = TimeUtility.SecondsToHMSCHSRetain(baseInfo.auctionSurplusTime); |
| | | } |
| | | else |
| | | { |
| | | m_SurplusTime.text = "已过期"; |
| | | } |
| | | } |
| | | else if (itemConfig.ExpireTime > 0) |
| | | { |
| | | m_SurplusTimeContainer.gameObject.SetActive(true); |
| | | if (baseInfo.overdueSurplusTime > 0) |
| | | { |
| | | m_SurplusTime.text = TimeUtility.SecondsToConsumeRebate(baseInfo.overdueSurplusTime); |
| | | } |
| | | else |
| | | { |
| | | m_SurplusTime.text = "已过期"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | m_SurplusTimeContainer.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | [SerializeField] Button m_Button; |
| | | [SerializeField] Text m_Title; |
| | | |
| | | string windowName; |
| | | ItemOperateType operateType; |
| | | string guid; |
| | | |
| | |
| | | this.gameObject.SetActive(active); |
| | | } |
| | | |
| | | public void Bind(ItemOperateType type, string guid) |
| | | public void Bind(string windowName, ItemOperateType type, string guid) |
| | | { |
| | | operateType = type; |
| | | this.windowName = windowName; |
| | | this.operateType = type; |
| | | this.guid = guid; |
| | | switch (type) |
| | | { |
| | |
| | | case ItemOperateType.makeUse: |
| | | this.m_Title.text = "使用"; |
| | | break; |
| | | case ItemOperateType.split: |
| | | this.m_Title.text = "拆分"; |
| | | break; |
| | | case ItemOperateType.inlay: |
| | | this.m_Title.text = "镶嵌"; |
| | | break; |
| | | case ItemOperateType.putOut: |
| | | this.m_Title.text = "取出"; |
| | | break; |
| | | case ItemOperateType.putIn: |
| | | this.m_Title.text = "放入"; |
| | | break; |
| | | case ItemOperateType.compose: |
| | | this.m_Title.text = "合成"; |
| | | break; |
| | | case ItemOperateType.buy: |
| | | this.m_Title.text = "购买"; |
| | | break; |
| | | case ItemOperateType.putOn: |
| | | this.m_Title.text = "穿上"; |
| | | break; |
| | | case ItemOperateType.putOff: |
| | | this.m_Title.text = "脱下"; |
| | | break; |
| | | case ItemOperateType.strength: |
| | | this.m_Title.text = "强化"; |
| | | break; |
| | | case ItemOperateType.star: |
| | | this.m_Title.text = "升星"; |
| | | break; |
| | | case ItemOperateType.train: |
| | | this.m_Title.text = "洗炼"; |
| | | break; |
| | | default: |
| | | this.m_Title.text = ""; |
| | | break; |
| | |
| | | |
| | | m_Button.SetListener(() => |
| | | { |
| | | WindowCenter.Instance.Close<EquipTipWin>(); |
| | | EquipTipUtility.Operate(operateType, this.guid); |
| | | WindowCenter.Instance.Close(windowName); |
| | | if (this.operateType==ItemOperateType.buy) |
| | | { |
| | | EquipTipUtility.GoodOperate(operateType, BuyItemController.Instance.goodId, BuyItemController.Instance.wannaBuyCount.value); |
| | | } |
| | | else |
| | | { |
| | | EquipTipUtility.Operate(operateType, this.guid); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | [SerializeField] TipLegendPropertyWidget m_LegendPropertyWidget; |
| | | [SerializeField] TipWingRefineMaterialsWidget m_RefineMaterialsWidget; |
| | | [SerializeField] TipItemDescriptionWidget m_DescriptionWidget; |
| | | [SerializeField] TipBuyItemWidget m_BuyItemWidget; |
| | | [SerializeField] TipGetWayEntranceWidget m_GetWayEntranceWidget; |
| | | [SerializeField] TipGetWaysWidget m_GetWaysWidget; |
| | | [SerializeField] TipJobAndPlaceWidget m_JobAndPlaceWidget; |
| | | [SerializeField] OperateButton[] m_OperateButtons; |
| | | [SerializeField] TipOperateButton[] m_OperateButtons; |
| | | [SerializeField] Button m_Close; |
| | | |
| | | #region Built-in |
| | |
| | | DisplayLegendProperty(); |
| | | DisplayRefineMaterials(); |
| | | DisplayItemDescription(); |
| | | DisplayBuyItem(); |
| | | DisplayJobAndPlace(); |
| | | DisplayGetWays(); |
| | | DisplayOperateButton(); |
| | |
| | | { |
| | | var itemId = EquipTipUtility.mainTipData.baseInfo.itemId; |
| | | m_DescriptionWidget.Display(itemId); |
| | | } |
| | | |
| | | private void DisplayBuyItem() |
| | | { |
| | | m_BuyItemWidget.gameObject.SetActive(EquipTipUtility.mainTipData.goodId > 0); |
| | | if (EquipTipUtility.mainTipData.goodId > 0) |
| | | { |
| | | m_BuyItemWidget.Display(EquipTipUtility.mainTipData.goodId); |
| | | } |
| | | } |
| | | |
| | | private void DisplayGetWays() |
| | |
| | | if (i < operates.Count) |
| | | { |
| | | button.SetActive(true); |
| | | button.Bind(operates[i], guid); |
| | | button.Bind("WingTipWin", operates[i], guid); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | [Serializable] |
| | | public class OperateButton |
| | | { |
| | | [SerializeField] RectTransform m_Container; |
| | | [SerializeField] Button m_Button; |
| | | [SerializeField] Text m_Title; |
| | | |
| | | ItemOperateType operateType; |
| | | string guid; |
| | | |
| | | public void SetActive(bool active) |
| | | { |
| | | this.m_Container.gameObject.SetActive(active); |
| | | } |
| | | |
| | | public void Bind(ItemOperateType type, string guid) |
| | | { |
| | | operateType = type; |
| | | this.guid = guid; |
| | | switch (type) |
| | | { |
| | | case ItemOperateType.putOn: |
| | | this.m_Title.text = "穿上"; |
| | | break; |
| | | case ItemOperateType.putOff: |
| | | this.m_Title.text = "脱下"; |
| | | break; |
| | | case ItemOperateType.sell: |
| | | this.m_Title.text = "出售"; |
| | | break; |
| | | case ItemOperateType.putOut: |
| | | this.m_Title.text = "取出"; |
| | | break; |
| | | case ItemOperateType.putIn: |
| | | this.m_Title.text = "放入"; |
| | | break; |
| | | default: |
| | | this.m_Title.text = ""; |
| | | break; |
| | | } |
| | | |
| | | m_Button.SetListener(() => |
| | | { |
| | | WindowCenter.Instance.Close<WingTipWin>(); |
| | | EquipTipUtility.Operate(operateType, this.guid); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | case ItemWinType.boxWin:
|
| | | if (curAttrData.isPreview)
|
| | | {
|
| | | EquipTipUtility.Show(curAttrData.itemId, TipType.Normal);
|
| | | EquipTipUtility.Show(curAttrData.itemId);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | if (curAttrData.isPreview)
|
| | | {
|
| | | EquipTipUtility.Show(curAttrData.itemId, TipType.Normal);
|
| | | EquipTipUtility.Show(curAttrData.itemId);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | case ItemWinType.petMatWin:
|
| | | if (curAttrData.isPreview)
|
| | | {
|
| | | EquipTipUtility.Show(curAttrData.itemId, TipType.Normal);
|
| | | EquipTipUtility.Show(curAttrData.itemId);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | var runeModel = ModelCenter.Instance.GetModel<RuneModel>();
|
| | | var propertyValue = runeModel.GetRunePropertyDescription(runeId, 1);
|
| | |
|
| | | EquipTipUtility.Show(runeId,TipType.Normal);
|
| | | EquipTipUtility.Show(runeId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | shopItemCell.coinsIcon.SetIconWithMoneyType(shopInfo.MoneyType);
|
| | | ulong shopCost = (ulong)(shopInfo.MoneyNumber);
|
| | | shopItemCell.coinNumText.text = UIHelper.ReplaceLargeNum(shopCost);
|
| | | BuyItemPopModel buyItem = BuyItemPopModel.Instance;
|
| | | BuyItemController buyItem = BuyItemController.Instance;
|
| | | int curVipIndex = -1;
|
| | | int nextVipIndex = -1;
|
| | | bool isVipBuy = buyItem.CheckIsVipBuy(shopInfo, out curVipIndex, out nextVipIndex);
|
| | |
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using System.Text;
|
| | |
|
| | | using UnityEngine;
|
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | | public class BuyItemPopModel : Singleton<BuyItemPopModel>
|
| | | |
| | | public class BuyItemController : Singleton<BuyItemController>
|
| | | {
|
| | | public StoreConfig storeConfig { get; private set; }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | public Dictionary<int, int> vipBuyCntDict = new Dictionary<int, int>();
|
| | | public bool CheckIsVipBuy(StoreConfig model,out int curVipIndex,out int nextVipIndex)
|
| | | public bool CheckIsVipBuy(StoreConfig model, out int curVipIndex, out int nextVipIndex)
|
| | | {
|
| | | vipBuyCntDict.Clear();
|
| | | curVipIndex = -1;
|
| | |
| | | isVipBuy = true;
|
| | | }
|
| | |
|
| | | if(isVipBuy)
|
| | | if (isVipBuy)
|
| | | {
|
| | | for (int i = model.VIPLV.Length-1; i > -1; i--)
|
| | | for (int i = model.VIPLV.Length - 1; i > -1; i--)
|
| | | {
|
| | | vipBuyCntDict.Add(model.VIPLV[i], model.PurchaseNumber[i]);
|
| | | }
|
| | |
| | | {
|
| | | nextVipIndex = i;
|
| | | }
|
| | | else if(model.VIPLV[i] <= playerVip)
|
| | | else if (model.VIPLV[i] <= playerVip)
|
| | | {
|
| | | curVipIndex = i;
|
| | | break;
|
| | |
| | | return isVipBuy;
|
| | | }
|
| | |
|
| | | public bool CheckIsLimitBuyCnt(StoreConfig model,out int canBuyCnt,out int addBuyCnt)
|
| | | public bool CheckIsLimitBuyCnt(StoreConfig model, out int canBuyCnt, out int addBuyCnt)
|
| | | {
|
| | | canBuyCnt = 0;
|
| | | addBuyCnt = 0;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public int GetCurBuyCnt(int buyCnt,int remainBuyCnt,out bool IsReachUpper)
|
| | | public int GetCurBuyCnt(int buyCnt, int remainBuyCnt, out bool IsReachUpper)
|
| | | {
|
| | | int count = 0;
|
| | | IsReachUpper = false;
|
| | | if(remainBuyCnt == 0)
|
| | | if (remainBuyCnt == 0)
|
| | | {
|
| | | IsReachUpper = true;
|
| | | count = 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | if(buyCnt <= remainBuyCnt)
|
| | | if (buyCnt <= remainBuyCnt)
|
| | | {
|
| | | count = buyCnt;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if(count < 0)
|
| | | if (count < 0)
|
| | | {
|
| | | count = 0;
|
| | | }
|
| | | return count;
|
| | | }
|
| | |
|
| | | public int GetRemainBuyCnt(int canBuyCnt,BuyShopItemLimit shopItemLimit,bool isVipBuy)
|
| | | public int GetRemainBuyCnt(int canBuyCnt, BuyShopItemLimit shopItemLimit, bool isVipBuy)
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if (shopItemLimit != null)
|
| | |
| | | return 0;
|
| | | }
|
| | | }
|
| | | public int GetBuyPrice(StoreConfig model,int buyCnt)
|
| | |
|
| | | public int GetBuyPrice(StoreConfig model, int buyCnt)
|
| | | {
|
| | | if (model == null) return 0;
|
| | |
|
| | | int buyItemPrice = model.MoneyNumber * buyCnt;
|
| | | return buyItemPrice;
|
| | | }
|
| | |
|
| | |
|
| | | public int goodId { get; private set; }
|
| | | public readonly LogicInt wannaBuyCount = new LogicInt();
|
| | |
|
| | | StoreModel model { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | | BuyShopItemLimit goodLimit;
|
| | |
|
| | | public void SetGood(int goodId)
|
| | | {
|
| | | this.goodId = goodId;
|
| | | wannaBuyCount.value = 1;
|
| | | goodLimit = model.GetBuyShopLimit((uint)goodId);
|
| | | }
|
| | |
|
| | | public void SetBuyCount(int count)
|
| | | {
|
| | | var countLimit = GetBuyCountLimit(count);
|
| | | if (countLimit == -1)
|
| | | {
|
| | | wannaBuyCount.value = Mathf.Clamp(count, 1, 999);
|
| | | }
|
| | | else
|
| | | {
|
| | | wannaBuyCount.value = Mathf.Clamp(count, 1, countLimit);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsVipLimitGood()
|
| | | {
|
| | | var config = StoreConfig.Get(goodId);
|
| | | return config != null && config.VIPLV.Length > 1 && config.VIPLV[0] > 0;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 返回值为-1,表示没有vip限制,返回值为999表示已经没有下一个vip限制
|
| | | /// </summary>
|
| | | /// <param name="goodId"></param>
|
| | | /// <param name="vipLevel"></param>
|
| | | /// <returns></returns>
|
| | | public int GetNextCanbuyVipLevel(int vipLevel)
|
| | | {
|
| | | if (!IsVipLimitGood())
|
| | | {
|
| | | return -1;
|
| | | }
|
| | |
|
| | | var config = StoreConfig.Get(goodId);
|
| | | var nextLevel = 999;
|
| | | for (int i = 0; i < config.VIPLV.Length; i++)
|
| | | {
|
| | | if (config.VIPLV[i] > vipLevel)
|
| | | {
|
| | | nextLevel = config.VIPLV[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | return nextLevel;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 返回值如果是-1,表示无限制
|
| | | /// </summary>
|
| | | /// <param name="goodId"></param>
|
| | | /// <returns></returns>
|
| | | public int GetBuyCountLimit(int vipLevel)
|
| | | {
|
| | | return GetBuyCountLimit(this.goodId, vipLevel);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 返回值如果是-1,表示无限制
|
| | | /// </summary>
|
| | | /// <param name="goodId"></param>
|
| | | /// <returns></returns>
|
| | | public int GetBuyCountLimit(int goodId, int vipLevel)
|
| | | {
|
| | | var config = StoreConfig.Get(goodId);
|
| | | if (config.PurchaseNumber.Length == 0 || config.PurchaseNumber[0] == 0)
|
| | | {
|
| | | return -1;
|
| | | }
|
| | |
|
| | | var isVipLimitGood = config != null && config.VIPLV.Length > 1 && config.VIPLV[0] > 0;
|
| | | var canBuy = 0;
|
| | | if (isVipLimitGood)
|
| | | {
|
| | | var index = -1;
|
| | | for (var i = config.VIPLV.Length - 1; i >= 0; i--)
|
| | | {
|
| | | if (config.VIPLV[i] <= vipLevel)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (index != -1)
|
| | | {
|
| | | canBuy = config.PurchaseNumber[index];
|
| | | }
|
| | | else
|
| | | {
|
| | | canBuy = 0;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | canBuy = config.PurchaseNumber[0];
|
| | | }
|
| | |
|
| | | var haveBuy = goodLimit != null ? goodLimit.BuyCnt : 0;
|
| | | return canBuy - haveBuy;
|
| | | }
|
| | |
|
| | | public int GetTotalPrice(int count)
|
| | | {
|
| | | var config = StoreConfig.Get(goodId);
|
| | | return config.MoneyNumber * count;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); }
|
| | | }
|
| | |
|
| | | BuyItemPopModel buyItem;
|
| | | BuyItemController buyItem;
|
| | | BuyShopItemLimit shopItemLimit;
|
| | | int canBuyCnt = 0;
|
| | | int buyCnt = 0;
|
| | |
| | | }
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | buyItem = BuyItemPopModel.Instance;
|
| | | buyItem = BuyItemController.Instance;
|
| | | shopItemLimit = m_storeModel.GetBuyShopLimit((uint)buyItem.storeConfig.ID);
|
| | | tipAlpha.alpha = 0;
|
| | | bottomPart.SetActive(false);
|
| | |
| | | StoreModel m_storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | |
|
| | | ItemAttrData itemAttrData;
|
| | | BuyItemPopModel buyItem;
|
| | | BuyItemController buyItem;
|
| | | BuyShopItemLimit shopItemLimit;
|
| | | int canBuyCnt = 0;
|
| | | int buyCnt = 0;
|
| | |
| | | public void InitModel(ItemAttrData attrData)
|
| | | {
|
| | | itemAttrData = attrData;
|
| | | buyItem = BuyItemPopModel.Instance;
|
| | | buyItem = BuyItemController.Instance;
|
| | | shopItemLimit = m_storeModel.GetBuyShopLimit((uint)buyItem.storeConfig.ID);
|
| | | InitUI();
|
| | | closeBtn.AddListener(OnClickCloseBtn);
|
| | |
| | | ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | StoreModel m_storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | |
|
| | | BuyItemPopModel buyItem;
|
| | | BuyItemController buyItem;
|
| | | BuyShopItemLimit shopItemLimit;
|
| | | int canBuyCnt = 0;
|
| | | int buyCnt = 0;
|
| | |
| | | }
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | buyItem = BuyItemPopModel.Instance;
|
| | | buyItem = BuyItemController.Instance;
|
| | | shopItemLimit = m_storeModel.GetBuyShopLimit((uint)buyItem.storeConfig.ID);
|
| | | tipAlpha.alpha = 0;
|
| | | bottomPart.SetActive(false);
|
| | |
| | | PetModel petmodel { get { return ModelCenter.Instance.GetModel<PetModel>(); } }
|
| | | MountModel mountModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
|
| | |
|
| | | BuyItemPopModel buyItem;
|
| | | BuyItemController buyItem;
|
| | | BuyShopItemLimit shopItemLimit;
|
| | | int canBuyCnt = 0;
|
| | | int buyCnt = 0;
|
| | |
| | | }
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | buyItem = BuyItemPopModel.Instance;
|
| | | buyItem = BuyItemController.Instance;
|
| | | shopItemLimit = m_storeModel.GetBuyShopLimit((uint)buyItem.storeConfig.ID);
|
| | | tipAlpha.alpha = 0;
|
| | | topPart.SetActive(false);
|
| | |
| | | }
|
| | |
|
| | | ItemAttrData itemAttrData;
|
| | | BuyItemPopModel buyItem;
|
| | | BuyItemController buyItem;
|
| | | BuyShopItemLimit shopItemLimit;
|
| | | int canBuyCnt = 0;
|
| | | int buyCnt = 0;
|
| | |
| | | {
|
| | | curAttrTypeNum = 0;
|
| | | itemAttrData = attrData;
|
| | | buyItem = BuyItemPopModel.Instance;
|
| | | buyItem = BuyItemController.Instance;
|
| | | shopItemLimit = m_storeModel.GetBuyShopLimit((uint)buyItem.storeConfig.ID);
|
| | | InitUI();
|
| | | closeBtn.AddListener(OnClickCloseBtn);
|
| | |
| | | #region 点击商店物品逻辑
|
| | | public void OnClickShopCell(StoreConfig shopInfo)
|
| | | {
|
| | | BuyItemPopModel.Instance.SetModel(shopInfo.ID);
|
| | | int itemId = GetReplaceId(shopInfo.ID, shopInfo.ItemID);
|
| | | ItemAttrData attrData = new ItemAttrData(itemId, true, (ulong)shopInfo.ItemCnt, -1, true, PackType.Deleted
|
| | | , "", null, ItemTipChildType.Buy);
|
| | | itemTipsModel.SetItemTipsModel(attrData, false);
|
| | | attrData.SetTipsFuncBtn(ItemOperateType.buy, (ItemOperateType type, string id) => { OnClickBuyBtn(ItemOperateType.buy, shopInfo.ID); });
|
| | | itemTipsModel.ShowTip();
|
| | | EquipTipUtility.ShowGood(shopInfo.ID ,itemId);
|
| | | }
|
| | |
|
| | | public int BuyCnt { get; private set; }
|
| | | public void SetBuyCnt(int buyCnt)
|
| | | {
|
| | | BuyCnt = buyCnt;
|
| | | }
|
| | | private void OnClickBuyBtn(ItemOperateType type, int shopId)
|
| | | {
|
| | | BuyShopItemLimit shopItemLimit = GetBuyShopLimit((uint)shopId);
|
| | | StoreConfig storeConfig = StoreConfig.Get(shopId);
|
| | | int curVipIndex = -1;
|
| | | int nextVipIndex = -1;
|
| | | bool isVipBuy = TryGetVipBuy(storeConfig, out curVipIndex, out nextVipIndex);
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | int remainNum = 0;
|
| | | if (isVipBuy)
|
| | | {
|
| | | remainNum = storeConfig.PurchaseNumber[curVipIndex] - shopItemLimit.BuyCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | remainNum = storeConfig.PurchaseNumber[0] - shopItemLimit.BuyCnt;
|
| | | }
|
| | | if (remainNum < 1)
|
| | | {
|
| | | ServerTipDetails.DisplayNormalTip(Language.Get("StoreWin109"));
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | | SendBuyShopItem(storeConfig, BuyCnt);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | shopItemCell.coinsIcon.SetIconWithMoneyType(shopInfo.MoneyType);
|
| | | ulong shopCost = (ulong)(shopInfo.MoneyNumber);
|
| | | shopItemCell.coinNumText.text = UIHelper.ReplaceLargeNum(shopCost);
|
| | | BuyItemPopModel buyItem = BuyItemPopModel.Instance;
|
| | | BuyItemController buyItem = BuyItemController.Instance;
|
| | | int curVipIndex = -1;
|
| | | int nextVipIndex = -1;
|
| | | bool isVipBuy = buyItem.CheckIsVipBuy(shopInfo, out curVipIndex, out nextVipIndex);
|
| | |
| | | shopItemCell.coinsIcon.SetIconWithMoneyType(shopInfo.MoneyType);
|
| | | ulong shopCost = (ulong)(shopInfo.MoneyNumber);
|
| | | shopItemCell.coinNumText.text = UIHelper.ReplaceLargeNum(shopCost);
|
| | | BuyItemPopModel buyItem = BuyItemPopModel.Instance;
|
| | | BuyItemController buyItem = BuyItemController.Instance;
|
| | | int curVipIndex = -1;
|
| | | int nextVipIndex = -1;
|
| | | bool isVipBuy = buyItem.CheckIsVipBuy(shopInfo, out curVipIndex, out nextVipIndex);
|
| New file |
| | |
| | | using Snxxz.UI;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class ClientTreasureDungeon
|
| | | {
|
| | | public const int Client_DataMap = 4000;
|
| | |
|
| | | public static int challengeTreasureId = 0;
|
| | |
|
| | | public static void RequestEnter(int treasureId)
|
| | | {
|
| | | challengeTreasureId = treasureId;
|
| | |
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null)
|
| | | {
|
| | | hero.StopAll();
|
| | | }
|
| | |
|
| | | MapTransferUtility.Instance.Clear();
|
| | | ClientDungeonStageUtility.SetClientDungeon(true, (ushort)Client_DataMap);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(0, 0);
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | toMapId = Client_DataMap,
|
| | | toLineId = 0,
|
| | | needEmpty = true,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true
|
| | | });
|
| | |
|
| | | PlayerDatas.Instance.baseData.mainServerMapIdRecord = PlayerDatas.Instance.baseData.MapID;
|
| | | PlayerDatas.Instance.baseData.MapID = (ushort)Client_DataMap;
|
| | | }
|
| | |
|
| | | public static void RequestExit()
|
| | | {
|
| | | ClientDungeonStageUtility.SetClientDungeon(false, 0);
|
| | | ClientDungeonStageUtility.RequestExitClientDungeon();
|
| | | PlayerDatas.Instance.extersion.pkState = 0;
|
| | | ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData();
|
| | |
|
| | | PlayerDatas.Instance.baseData.MapID = PlayerDatas.Instance.baseData.mainServerMapIdRecord;
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | toMapId = PlayerDatas.Instance.baseData.MapID,
|
| | | toLineId = 0,
|
| | | needEmpty = true,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true,
|
| | | refreshPlayerDatas = true
|
| | | });
|
| | | }
|
| | | } |
| File was renamed from System/Dungeon/TrialExchangeTitleCell.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 62d21c0bcc1b7ad4e8528d2bfb9f7b91 |
| | | timeCreated: 1534303452 |
| | | guid: 189ce34976654c34da06b3239c45076d |
| | | timeCreated: 1556000158 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class ClientTreasureDungeonStage : DungeonStage
|
| | | { |
| | | static readonly Vector3 PlayerBornPosition = new Vector3(24.496f, 0.048f, 8.258f); |
| | | static readonly Vector3 NpcBornPosition = new Vector3(9.45f, 0.04f, 8.258f); |
| | | |
| | | bool initialized = false; |
| | | |
| | | int dialogueNpcId = 0; |
| | | int[] speakTypes = null; |
| | | string[] dialogues = null;
|
| | |
|
| | | static GA_NpcClientFunc m_Npc; |
| | | |
| | | public override void Initialize()
|
| | | {
|
| | | base.Initialize();
|
| | |
|
| | | if (!initialized)
|
| | | {
|
| | | var funcConfig = FuncConfigConfig.Get("ClientTreasureDungeon");
|
| | | dialogueNpcId = int.Parse(funcConfig.Numerical1);
|
| | | speakTypes = ConfigParse.GetMultipleStr<int>(funcConfig.Numerical2);
|
| | | dialogues = ConfigParse.GetMultipleStr(funcConfig.Numerical3);
|
| | | initialized = true;
|
| | | }
|
| | |
|
| | | UnInitializedNpc();
|
| | |
|
| | | NormalDialogueWin.onDialogueComplete -= OnDialogueComplete;
|
| | | NormalDialogueWin.onDialogueComplete += OnDialogueComplete;
|
| | | } |
| | | |
| | | protected override void OnStageLoadFinish()
|
| | | {
|
| | | base.OnStageLoadFinish();
|
| | |
|
| | | InitializePlayer();
|
| | | InitializeNpc();
|
| | | } |
| | | |
| | | void InitializePlayer()
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | hero.Pos = PlayerBornPosition;
|
| | | CameraController.Instance.Apply();
|
| | | } |
| | | |
| | | void InitializeNpc()
|
| | | {
|
| | | m_Npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientFunc>((uint)dialogueNpcId, E_ActorGroup.FuncNpc); |
| | | m_Npc.Pos = NpcBornPosition; |
| | | NPCInteractProcessor.s_NpcInteractEvent -= OnNpcTalkEvent; |
| | | NPCInteractProcessor.s_NpcInteractEvent += OnNpcTalkEvent;
|
| | | }
|
| | |
|
| | | private void OnNpcTalkEvent(E_NpcType arg1, int arg2, uint arg3)
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | NormalDialogueWin.dialogues = dialogues;
|
| | | NormalDialogueWin.speakTypes = speakTypes;
|
| | | NormalDialogueWin.npcId = dialogueNpcId;
|
| | | WindowCenter.Instance.Open<NormalDialogueWin>();
|
| | | }
|
| | |
|
| | | private void OnDialogueComplete()
|
| | | {
|
| | | var pak = new CA50E_tagCMOpenMagicWeapon();
|
| | | pak.MWID = (uint)ClientTreasureDungeon.challengeTreasureId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | void UnInitializedNpc()
|
| | | {
|
| | | if (m_Npc != null)
|
| | | {
|
| | | GAMgr.Instance.ServerDie(m_Npc.ServerInstID);
|
| | | GAMgr.Instance.Release(m_Npc);
|
| | | m_Npc = null;
|
| | | }
|
| | | } |
| | | |
| | | public override void UnInitialize()
|
| | | {
|
| | | base.UnInitialize();
|
| | |
|
| | | UnInitializedNpc();
|
| | |
|
| | | NPCInteractProcessor.s_NpcInteractEvent -= OnNpcTalkEvent;
|
| | | NormalDialogueWin.onDialogueComplete -= OnDialogueComplete; |
| | | }
|
| | | } |
copy from System/Dungeon/TrialExchangeTitleCell.cs.meta
copy to System/Treasure/ClientTreasureDungeonStage.cs.meta
| File was copied from System/Dungeon/TrialExchangeTitleCell.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 62d21c0bcc1b7ad4e8528d2bfb9f7b91 |
| | | timeCreated: 1534303452 |
| | | guid: 9f12818a53b6cb74f8cf93b6748ea869 |
| | | timeCreated: 1556000059 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | var config = TreasureConfig.Get(model.selectedTreasure);
|
| | | if (config != null)
|
| | | {
|
| | | if (model.selectedTreasure == 101)
|
| | | {
|
| | | ClientTreasureDungeon.RequestEnter(101);
|
| | | return;
|
| | | }
|
| | | if (PlayerDatas.Instance.baseData.LV >= config.ChallengeLevel)
|
| | | {
|
| | | model.collectingHuman = model.selectedTreasure;
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, April 23, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class NormalDialogueWin : Window
|
| | | {
|
| | | [SerializeField] Button m_Skip;
|
| | | [SerializeField] Button m_EmptyAccepter;
|
| | |
|
| | | [SerializeField] Transform m_ContainerNpc;
|
| | | [SerializeField] RawImage m_RawNpc;
|
| | | [SerializeField] Text m_NpcName;
|
| | | [SerializeField] Text m_NpcDialogue;
|
| | |
|
| | | [SerializeField] Transform m_ContainerPlayer;
|
| | | [SerializeField] RawImage m_RawPlayer;
|
| | | [SerializeField] Text m_PlayerName;
|
| | | [SerializeField] Text m_PlayerDialogue;
|
| | |
|
| | | int dialogueIndex = 0;
|
| | |
|
| | | public static int npcId = 0;
|
| | | public static int[] speakTypes = null;
|
| | | public static string[] dialogues = null;
|
| | |
|
| | | public static event Action onDialogueComplete;
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_EmptyAccepter.AddListener(OnClickEmpty);
|
| | | m_Skip.AddListener(OnSkip);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | dialogueIndex = 0;
|
| | |
|
| | | DisplayDialogue();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | |
|
| | | }
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | if (!WindowCenter.Instance.IsOpen<MainInterfaceWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | if (_hero == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (_hero.LockTarget == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | float _chkDistSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _hero.LockTarget.Pos);
|
| | | if (_chkDistSqrt > Mathf.Pow(GeneralDefine.FarawayNpcDist, 2))
|
| | | {
|
| | | _hero.LockTarget = null;
|
| | | Close();
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | private void DisplayDialogue()
|
| | | {
|
| | | if (speakTypes == null || dialogues == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var speakType = speakTypes[dialogueIndex];
|
| | |
|
| | | m_ContainerNpc.gameObject.SetActive(speakType == 0);
|
| | | m_ContainerPlayer.gameObject.SetActive(speakType == 1);
|
| | |
|
| | | switch (speakType)
|
| | | {
|
| | | case 1:
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | UI3DModelExhibition.Instance.ShowPlayer(m_RawPlayer, job, true);
|
| | | m_PlayerName.text = PlayerDatas.Instance.baseData.PlayerName;
|
| | | m_PlayerDialogue.text = Language.Get(dialogues[dialogueIndex]);
|
| | | break;
|
| | | case 0:
|
| | | var npcConfig = NPCConfig.Get(npcId);
|
| | | m_NpcName.text = npcConfig.charName;
|
| | | m_NpcDialogue.text = Language.Get(dialogues[dialogueIndex]);
|
| | | var data = new UI3DNPCExhibitionData()
|
| | | {
|
| | | npcId = npcId,
|
| | | isDialogue = true,
|
| | | };
|
| | | UI3DModelExhibition.Instance.ShowNPC(m_RawNpc, data);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnSkip()
|
| | | {
|
| | | Close();
|
| | | if (onDialogueComplete != null)
|
| | | {
|
| | | onDialogueComplete();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickEmpty()
|
| | | {
|
| | | if (dialogues != null && dialogueIndex < dialogues.Length - 1)
|
| | | {
|
| | | dialogueIndex += 1;
|
| | | DisplayDialogue();
|
| | | }
|
| | | else
|
| | | {
|
| | | Close();
|
| | | if (onDialogueComplete != null)
|
| | | {
|
| | | onDialogueComplete();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
copy from System/Dungeon/TrialExchangeTitleCell.cs.meta
copy to System/Treasure/NormalDialogueWin.cs.meta
| File was copied from System/Dungeon/TrialExchangeTitleCell.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 62d21c0bcc1b7ad4e8528d2bfb9f7b91 |
| | | timeCreated: 1534303452 |
| | | guid: b3d826a302403c34eb13d555a51f733e |
| | | timeCreated: 1556002605 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | { |
| | | base.OnActived(); |
| | | |
| | | var dataMapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID); |
| | | var config = DungeonOpenTimeConfig.Get(dataMapId); |
| | | |
| | | StartCoroutine(Co_DelayDisplay(config.DelayTime * 0.001f)); |
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | StartCoroutine(Co_DelayDisplay(1f));
|
| | | } |
| | | else
|
| | | {
|
| | | var dataMapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | var config = DungeonOpenTimeConfig.Get(dataMapId);
|
| | | StartCoroutine(Co_DelayDisplay(config.DelayTime * 0.001f));
|
| | | } |
| | | } |
| | | |
| | | #endregion |
| | |
| | | m_TreasureName.gameObject.SetActive(true); |
| | | m_TreasureIcon.gameObject.SetActive(true); |
| | | m_ContainerCommon.gameObject.SetActive(true); |
| | | var mapId = PlayerDatas.Instance.baseData.MapID; |
| | | var lineId = dungeonModel.dungeonResult.lineID; |
| | | var treasureId = ModelCenter.Instance.GetModel<TreasureModel>().GetTreasureIdByMapIdAndLineId(mapId, lineId); |
| | | |
| | | var treasureId = 0; |
| | | if (!ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var lineId = dungeonModel.dungeonResult.lineID;
|
| | | treasureId = ModelCenter.Instance.GetModel<TreasureModel>().GetTreasureIdByMapIdAndLineId(mapId, lineId);
|
| | | } |
| | | else
|
| | | {
|
| | | treasureId = ClientTreasureDungeon.challengeTreasureId;
|
| | | }
|
| | |
|
| | | var config = TreasureConfig.Get(treasureId); |
| | | m_TreasureName.text = config.Name; |
| | | m_TreasureIcon.SetSprite(config.Icon); |
| | |
| | | && !IsOpen("DialogueDuidanceWin")
|
| | | && !IsOpen("TaskBoxBGMWin")
|
| | | && !IsOpen("WelcomeWin")
|
| | | && !IsOpen("HazyRegionDialogueWin");
|
| | | && !IsOpen("HazyRegionDialogueWin")
|
| | | && !IsOpen("NormalDialogueWin");
|
| | |
|
| | | if (exceptOpen != IsOpen("MainInterfaceWin"))
|
| | | {
|
| | |
| | | case JumpUIType.XBWarehouseType2:
|
| | | SetJumpLogic<HappyXBWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.TrialExchange:
|
| | | SetJumpLogic<TrialExchangeWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.TrialExchange2:
|
| | | ModelCenter.Instance.GetModel<TrialDungeonModel>().openFromTask = true;
|
| | | SetJumpLogic<TrialExchangeWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.ComposeTicketFairy:
|
| | | case JumpUIType.ComposeTicketGod:
|
| | | case JumpUIType.ComposeTicketIce:
|
| | |
| | | break;
|
| | | case JumpUIType.TrialExchange:
|
| | | case JumpUIType.TrialExchange2:
|
| | | if (!trialDungeonModel.CompleteTrialFloor(0))
|
| | | {
|
| | | trialDungeonModel.ProcessOpenTrialExchangeError();
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | return false;
|
| | | case JumpUIType.Kylin:
|
| | | case JumpUIType.Kylin1:
|
| | | case JumpUIType.Kylin2:
|
| | |
| | | |
| | | public class Clock |
| | | { |
| | | public bool stopped { get; set; } |
| | | DateTime alarmTime; |
| | | UnityAction alarmCallBack; |
| | | |
| | |
| | | { |
| | | if (clocks.Contains(clock)) |
| | | { |
| | | clocks.Remove(clock); |
| | | clock.stopped = true; |
| | | } |
| | | } |
| | | |
| | |
| | | for (var i = clocks.Count - 1; i >= 0; i--) |
| | | { |
| | | var clock = clocks[i]; |
| | | if (clock.stopped) |
| | | { |
| | | clocks.RemoveAt(i); |
| | | continue; |
| | | } |
| | | |
| | | if (clock.CanAlarm()) |
| | | { |
| | | try |
| | | { |
| | | clock.Execute(); |
| | | clocks.RemoveAt(i); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Debug.LogException(e); |
| | | } |
| | | finally |
| | | { |
| | | clocks.RemoveAt(i); |
| | | } |
| | | } |
| | | } |
| | |
| | | normalTasks.Add(new ConfigInitTask("TreasureRefineConfig", () => { TreasureRefineConfig.Init(); }, () => { return TreasureRefineConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("TreasureSkillConfig", () => { TreasureSkillConfig.Init(); }, () => { return TreasureSkillConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("TreasureUpConfig", () => { TreasureUpConfig.Init(); }, () => { return TreasureUpConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("TrialExchangeConfig", () => { TrialExchangeConfig.Init(); }, () => { return TrialExchangeConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("TrialRewardsConfig", () => { TrialRewardsConfig.Init(); }, () => { return TrialRewardsConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("UnionLivenConfig", () => { UnionLivenConfig.Init(); }, () => { return UnionLivenConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("ViewRoleFuncConfig", () => { ViewRoleFuncConfig.Init(); }, () => { return ViewRoleFuncConfig.inited; })); |