3675 【BUG】【2.0】骑宠争夺已被击杀Boss血量显示异常,前往按钮无反馈信息
| | |
| | | public static void Init()
|
| | | {
|
| | | // 登记相应的数据体及对应的数据转逻辑类
|
| | | Register(typeof(HAC07_tagGCHorsePetBossInfo), typeof(DTCAC07_tagGCHorsePetBossInfo));
|
| | | Register(typeof(HB216_tagMCStartCustomSceneResult), typeof(DTCB216_tagMCStartCustomSceneResult));
|
| | | Register(typeof(HA905_tagGCNotifyEquipDetailInfo), typeof(DTCA905_tagGCNotifyEquipDetailInfo));
|
| | | Register(typeof(HA719_tagSCPlayerEquipCacheResult) ,typeof(DTCA719_tagSCPlayerEquipCacheResult));
|
| | |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetRidingPetBossLineDictAction", _e_GetRidingPetBossLineDictAction); |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "isActivityOver", _g_get_isActivityOver); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "BossIDArray", _g_get_BossIDArray); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "Boss1RewardIDArray", _g_get_Boss1RewardIDArray); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "Boss2RewardIDArray", _g_get_Boss2RewardIDArray); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_isActivityOver(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.RidingPetBossModel gen_to_be_invoked = (Snxxz.UI.RidingPetBossModel)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushboolean(L, gen_to_be_invoked.isActivityOver); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_BossIDArray(RealStatePtr L) |
| | |
| | | [SerializeField] RawImage m_BossRawImage;
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | |
|
| | | RidingPetBossModel ridingPetMdoel { get { return ModelCenter.Instance.GetModel<RidingPetBossModel>(); } }
|
| | | RidingPetBossModel model { get { return ModelCenter.Instance.GetModel<RidingPetBossModel>(); } }
|
| | | //public int RawImagetestBossID = 50103006;
|
| | | public RewardPositionType rewardPositonType;
|
| | | [SerializeField] ItemCell[] m_RewardArray;
|
| | |
| | |
|
| | | public void DisplayBossRawImage()
|
| | | {
|
| | | var config = NPCConfig.Get(ridingPetMdoel.BossIDArray[0]);
|
| | | UI3DModelExhibition.Instance.ShowNPC(ridingPetMdoel.BossIDArray[0], config.UIModeLOffset, config.UIModelRotation, m_BossRawImage);
|
| | | var config = NPCConfig.Get(model.BossIDArray[0]);
|
| | | UI3DModelExhibition.Instance.ShowNPC(model.BossIDArray[0], config.UIModeLOffset, config.UIModelRotation, m_BossRawImage);
|
| | | }
|
| | |
|
| | | public void StopShowBossRawImage()
|
| | |
| | |
|
| | | public void DisplayAnotherBossRawImage()
|
| | | {
|
| | | var config = NPCConfig.Get(ridingPetMdoel.BossIDArray[1]);
|
| | | UI3DModelExhibition.InstanceClone1.ShowNPC(ridingPetMdoel.BossIDArray[1], config.UIModeLOffset, config.UIModelRotation, m_BossRawImage);
|
| | | var config = NPCConfig.Get(model.BossIDArray[1]);
|
| | | UI3DModelExhibition.InstanceClone1.ShowNPC(model.BossIDArray[1], config.UIModeLOffset, config.UIModelRotation, m_BossRawImage);
|
| | | }
|
| | |
|
| | | public void DisplaySpiritPetHP()
|
| | | {
|
| | | m_ActivityInfo.text = Language.Get("RidingPetBossRemainHP", ModelCenter.Instance.GetModel<RidingPetBossModel>().GetBossRemianedHP(bossIdIndex));
|
| | | var hp = model.GetBossRemianedHP(bossIdIndex);
|
| | | var alive = model.IsBossAlive(bossIdIndex);
|
| | | if (!alive)
|
| | | {
|
| | | m_ActivityInfo.text = Language.Get("AllianceBoss_1");
|
| | | m_ActivityInfo.color = UIHelper.GetUIColor(TextColType.Red);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ActivityInfo.text = Language.Get("RidingPetBossRemainHP", hp);
|
| | | m_ActivityInfo.color = UIHelper.GetUIColor(TextColType.White);
|
| | | }
|
| | | }
|
| | |
|
| | | public void DisplayActivityTime()
|
| | |
| | | HourMinute hourMin;
|
| | | dailyQuestOpentime.TryGetNextOpenTime(out hourMin);
|
| | | m_ActivityInfo.text = Language.Get("RidingPetBossQuestTime", "<color=red>"+hourMin.hourBegin+":"+hourMin.minuteBegin+"</color>");
|
| | | m_ActivityInfo.color = UIHelper.GetUIColor(TextColType.White);
|
| | | }
|
| | |
|
| | | public void DisplayRewardItem()
|
| | |
| | | [XLua.Hotfix]
|
| | | public class RidingPetBossModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, bool> m_BossAliceStates = new Dictionary<int, bool>();
|
| | |
|
| | | public const int RIDINGPETBOSS_MAP = 31200;
|
| | |
|
| | | public int[] BossIDArray;
|
| | | public int[] Boss1RewardIDArray;
|
| | | public int[] Boss2RewardIDArray;
|
| | | public bool isActivityOver { get; private set; }
|
| | | public const int RIDINGPETBOSS_MAP = 31200;
|
| | |
|
| | | Dictionary<int, RidingPetBossLine> RidingPetBossLineDict = new Dictionary<int, RidingPetBossLine>();
|
| | | private string m_MountsBossID;
|
| | | private string m_Boss1RewardID;
|
| | | private string m_Boss2RewardID;
|
| | |
|
| | | public event Action GetRidingPetBossLineDictAction;
|
| | | public event Action onBossStateRefresh;
|
| | |
|
| | |
|
| | |
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | m_BossAliceStates.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | |
| | |
|
| | | public void ReceivePackage(HAC07_tagGCHorsePetBossInfo package)
|
| | | {
|
| | | if (package.IsEnd == 1)
|
| | | m_BossAliceStates[0] = !MathUtility.GetBitValue(package.IsEnd, 0);
|
| | | m_BossAliceStates[1] = !MathUtility.GetBitValue(package.IsEnd, 1);
|
| | | if (onBossStateRefresh != null)
|
| | | {
|
| | | isActivityOver = true;
|
| | | onBossStateRefresh();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return RidingPetBossLineDict[index].remainedHP;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsBossAlive(int index)
|
| | | {
|
| | | return m_BossAliceStates.ContainsKey(index) ? m_BossAliceStates[index] : false;
|
| | | }
|
| | | }
|
| | |
|
| | | public struct RidingPetBossLine
|
| | |
| | | using System.Collections; |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | |
| | | protected override void OnPreClose()
|
| | | {
|
| | | ridingPetBossModel.GetRidingPetBossLineDictAction -= GetRidingBossDictPackageAction;
|
| | | ridingPetBossModel.onBossStateRefresh -= OnBossStateRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | |
| | | m_ContainerMounts.bossIdIndex = 0;
|
| | | m_ContainerSpiritPet.bossIdIndex = 1;
|
| | |
|
| | | m_ContainerMounts.DisplayBossName();
|
| | | m_ContainerSpiritPet.DisplayBossName();
|
| | |
|
| | |
| | | mapModel.RequestQueryMapLineState(RidingPetBossModel.RIDINGPETBOSS_MAP);
|
| | | GetRidingBossDictPackageAction();
|
| | |
|
| | |
|
| | | m_ContainerMounts.DisplayBossRawImage();
|
| | | m_ContainerSpiritPet.DisplayAnotherBossRawImage();
|
| | |
|
| | | m_ContainerMounts.DisplayRewardItem();
|
| | | m_ContainerSpiritPet.DisplayRewardItem();
|
| | | WindowCenter.Instance.windowBeforeCloseEvent += WindowBeforeCloseEvent;
|
| | |
|
| | | ridingPetBossModel.onBossStateRefresh += OnBossStateRefresh;
|
| | |
|
| | | UpdateRidingPetBottomTip();
|
| | | }
|
| | |
|
| | | private void OnBossStateRefresh()
|
| | | {
|
| | | GetRidingBossDictPackageAction();
|
| | | }
|
| | |
|
| | | private void WindowBeforeCloseEvent(Window _window)
|
| | |
| | | case DailyQuestModel.DailyQuestState.Normal:
|
| | | m_ContainerMounts.DisplaySpiritPetHP();
|
| | | m_ContainerSpiritPet.DisplaySpiritPetHP();
|
| | | m_MountsGoToButton.SetInteractable(m_MountGotoLabel, true);
|
| | | m_SpiritPetGoToButton.SetInteractable(m_PetGotoLabel, true);
|
| | |
|
| | | var isMountAlive = ridingPetBossModel.IsBossAlive(m_ContainerMounts.bossIdIndex);
|
| | | var isPetAlive = ridingPetBossModel.IsBossAlive(m_ContainerSpiritPet.bossIdIndex);
|
| | |
|
| | | m_MountsGoToButton.SetInteractable(m_MountGotoLabel, isMountAlive);
|
| | | m_SpiritPetGoToButton.SetInteractable(m_PetGotoLabel, isPetAlive);
|
| | | break;
|
| | | default:
|
| | | m_ContainerMounts.DisplayActivityTime();
|