void ClickDown(Vector3 pos) { sdata.s_itemtypeInfo Info = ItemM.GetItemInfo(m_iItemID); if (Info != null) { string Name = Info.name; int Level = Info.level; string Description = Info.title.Replace("\\n", System.Environment.NewLine); int Money = Info.money; int HaveCount = ItemDC.GetItemCount(m_iItemID); m_wnd = WndManager.GetDialog <StageTipWnd>(); if (Info.gtype == 0) { m_wnd.SetTipData(pos, StageClickType.Item, Info.icon, Info.quality, Name, Level, Description, HaveCount, Money, Info.gtype); } else if (Info.gtype == 1) { m_wnd.SetTipData(pos, StageClickType.Item, Info.gid, Info.quality, Name, Level, Description, HaveCount, Money, Info.gtype); } if (Info.gtype == 2) { m_wnd.SetTipData(pos, StageClickType.Item, Info.gid, Info.quality, Name, Level, Description, HaveCount, Money, Info.gtype); } if (Info.gtype == 3) { m_wnd.SetTipData(pos, StageClickType.Item, Info.gid, Info.quality, Name, Level, Description, HaveCount, Money, Info.gtype); } } }
void JoinCombat() { MainCameraM.s_Instance.EnableDrag(true); WndManager.DestoryDialog <SelectSoldierwnd>(); CombatInfoWnd wndInfo = WndManager.GetDialog <CombatInfoWnd>(); if (wndInfo != null) { wndInfo.SetWndMode(CombatInfoMode.combat); } CombatWnd wnd = WndManager.GetDialog <CombatWnd>(); if (wnd != null) { wnd.InitSoldierUI(); } if (m_SelectedBlackScienceCaptainID != 0) //黑科技设置 { CmCarbon.AddGodSkill(true, m_SelectedBlackScienceCaptainID, ConfigM.GetInitMana()); GodSkillWnd gsw = WndManager.GetDialog <GodSkillWnd>(); if (gsw != null) { gsw.SetCurMana(CmCarbon.GetGodSkillMana(true)); gsw.SetRequireMana(CmCarbon.GetGodSkill(true).GetRequireMana()); } } CombatScheduler.SetCSState(CSState.Combat); }
/// <summary> /// 战前NPC对话 /// </summary> private void DoStartTalks(List <CounterPartDialogUnit> ltalk) { if (ltalk.Count == 0) { return; } MyHead.btnCombat.enabled = false; List <int> lNpcID = new List <int>(); List <string> lStrTalks = new List <string>(); List <NpcDirection> lWndDirs = new List <NpcDirection>(); foreach (CounterPartDialogUnit t in ltalk) { lNpcID.Add(t.npcid); lStrTalks.Add(t.talk); lWndDirs.Add((NpcDirection)t.position); } NpcTalksWnd wnd = WndManager.GetDialog <NpcTalksWnd>(); wnd.SetData(lNpcID, lStrTalks, lWndDirs); ViewStageScene scene = SceneM.GetCurIScene() as ViewStageScene; if (scene != null && scene.GoldTransform != null) { Transform tGoldRoom = scene.GoldTransform; LifeObj obj = tGoldRoom.GetComponent <LifeObj>(); if (obj != null) { Vector3 pos = obj.GetLife().GetLifeProp().HelpPoint.GetVauleByKey(BuildHelpPointName.guidePos).transform.position; wnd.SetWndStyle(2, pos); } } }
void BtnGetSoulStone_OnClickEventHandler(UIButton sender) { sdata.s_itemtypeInfo itemInfo = ItemM.GetItemInfo(m_Info.fragmentTypeID);//当前灵魂石 ItemComeFromWnd wnd = WndManager.GetDialog <ItemComeFromWnd>(); wnd.SetData(itemInfo, null, m_Info, 4); }
/// <summary> /// 伤害后死亡返回false,否则true /// </summary> /// <param name="damage"></param> /// <param name="attackgo"></param> /// <param name="InterruptSkill">是否打断技能</param> /// <returns>伤害后死亡返回false,否则true</returns> public virtual bool ApplyDamage(SkillReleaseInfo Info, Transform attackgo) { if (m_isDead) { return(false); } HP += Info.m_Damage; if (HP >= fullHP) { HP = fullHP; } if ((Info.Result == AttackResult.Normal && Info.m_Damage != 0) || Info.Result == AttackResult.Miss || Info.Result == AttackResult.Crit || Info.Result == AttackResult.Fire) { ShowHp(HP, fullHP, Info.m_Damage, Info.Result); } if (HP <= 0) { if (attackgo != null) { Life target = attackgo.GetComponent <LifeObj>().GetLife(); if (m_Core.m_type == LifeMType.SOLDIER && target.m_Core.m_type == LifeMType.SOLDIER) { BattleKillLogWnd wnd = WndManager.GetDialog <BattleKillLogWnd>(); wnd.Show(target.m_SceneID, m_SceneID); } } Dead(); return(false); } return(true); }
public override void WndStart() { base.WndStart(); if (MyHead.BtnReturn) { MyHead.BtnReturn.OnClickEventHandler += BtnReturn_OnClickEventHandler; } if (MyHead.BtnNext) { MyHead.BtnNext.OnClickEventHandler += BtnNext_OnClickEventHandler; } MainCameraM.s_Instance.EnableDrag(false); m_IsSaving = false; PutCanvasM.CanOperate = true; //TouchMove.s_CanOperate = true; //TouchMoveManager.HideDeckCanvasUnit(); CangKuWnd wnd = WndManager.GetDialog <CangKuWnd>(); ShipPlan P = ShipPlanDC.GetCurShipPlan(); P.BackupPlan(); LoadShipDesign(); //LoadCanvasBox(); }
public bool ShowCaptionUpWnd() { CombatScene combat = SceneM.GetCurIScene() as CombatScene; if (combat != null) { UserInfo old = combat.m_oldUserInfo; if (old.Level < UserDC.GetLevel()) { CaptionUpgradeWnd cuw = WndManager.GetDialog <CaptionUpgradeWnd>(); int oldMaxPhysical = UserM.GetMaxPhysical(old.Level); int newMaxPhysical = UserM.GetMaxPhysical(UserDC.GetLevel()); int oldMaxherolevel = UserM.GetUserMaxHeroLevel(old.Level); int newMaxherolevel = UserM.GetUserMaxHeroLevel(UserDC.GetLevel()); cuw.SetData(old.Level, UserDC.GetLevel(), StageDC.GetStageResult().win ? old.Physical - StageDC.GetCounterPartInfo().win_physical : old.Physical - StageDC.GetCounterPartInfo().lose_physical, UserDC.GetPhysical(), oldMaxPhysical, newMaxPhysical, oldMaxherolevel, newMaxherolevel); cuw.MyHead.BtnBg.OnClickEventHandler += BackMainScence; cuw.MyHead.BtnClose.OnClickEventHandler += BackMainScence; return(true); } } return(false); }
public bool ShowTropAction() { List <StageDC.ScriptDropItem> items = StageDC.GetStageScriptDrops(); if ((m_lRewardInfo != null && m_lRewardInfo.Count > 0) || items.Count > 0) { TrophiesActionWnd TropWnd = WndManager.GetDialog <TrophiesActionWnd>(); if (TropWnd) { TropWnd.ClearTropiesData(); TropWnd.AddTropiesData(m_lRewardInfo); //List<StageDC.ScriptDropItem> items = StageDC.GetStageScriptDrops(); foreach (StageDC.ScriptDropItem item in items) { ItemUIInterface.ItemIconInfo iconInfo = ItemUIInterface.GetIconInfo((ItemUIInterface.IconType)item.mType, item.mID, item.mIsSoul, item.mIsBook); iconInfo.mCount = item.mCount; TropWnd.AddTropiesData(iconInfo.mName, (int)iconInfo.mType, iconInfo.mID, iconInfo.mIsSoul, iconInfo.mIsBook, true, item.mCount); } TropWnd.SetWndType(3); TropWnd.GetTropies(1, ShowStageResult); TropWnd.MyHead.LblDes.gameObject.SetActive(false); TropWnd.FinalEventClikHandler += BackMainScence; return(true); } } return(false); }
void BtnItemClick_OnClickHander(UIButton sender) { if (m_counterInfo != null) { bool Open = StageDC.CheckOpenStage((StageType)m_counterInfo.type, m_counterInfo.id); if (!Open) { NGUIUtil.ShowTipWndByKey(10000175); return; } StageMapWnd wnd = WndManager.GetDialog <StageMapWnd>(); if (wnd != null) { wnd.SetMainMenuTop(false); int stageNode = StageDC.GetStageNode(m_counterInfo.id); int chapter = StageDC.GetStageChapter(m_counterInfo.id); wnd.GotoChapter((StageType)m_counterInfo.type, chapter, stageNode); ItemComeFromWnd itemComeWnd = WndManager.FindDialog <ItemComeFromWnd>(); if (itemComeWnd != null) { WndManager.SetBeforeWnd(wnd, itemComeWnd); } } } }
void Start() { PlayWarning(); mBattleIncomingWnd = WndManager.GetDialog <BattleIncomingWnd>(); mBattleIncomingWnd.MonsterCount = CmCarbon.GetFireSoldierCount(); }
/// <summary> /// 开始出战 /// </summary> /// <param name="sender"></param> void StartCombat(UIButton sender) { if (m_SelectedSoldier.Count == 0) { NGUIUtil.ShowTipWndByKey(88800090); return; } //出战人员是否满员判定 (玩家所有兵都参战时不做提示) if (m_SelectedSoldier.Count < Mathf.Min(maxSelect, m_CrewList.Count) && m_SelectedSoldier.Count < m_iSoldiersCount) //&& m_iTotalSoldiersCount != m_BtnGoSelectedList.Count) { DialogWnd dialogWnd = WndManager.GetDialog <DialogWnd>(); if (dialogWnd) { dialogWnd.SetDialogLable(NGUIUtil.GetStringByKey(88800067), NGUIUtil.GetStringByKey(88800068), NGUIUtil.GetStringByKey(10000044)); dialogWnd.YESButtonOnClick = YESToCombat; } else { Debug.Log("dialogWnd fail"); } } else { GoCombat(); } }
void BtnClick_OnClickHander(UIButton sender) { // ItemComeFromWnd wnd = WndManager.GetDialog<ItemComeFromWnd>(); sdata.s_itemtypeInfo itemInfo = ItemM.GetItemInfo(m_itemType); //当前灵魂石 ItemComeFromWnd wnd = WndManager.GetDialog <ItemComeFromWnd>(); wnd.SetData(itemInfo, null, null, 1); }
public void Load() { if (mLoadingWnd == null) { mLoadingWnd = WndManager.GetDialog <LoadingWnd>(); } mLoadingWnd.Loading(); }
public void FadeOut() { if (mLoadingWnd == null) { mLoadingWnd = WndManager.GetDialog <LoadingWnd>(); } mLoadingWnd.FadeOut(); }
void BtnSure_OnClickEventHandler(UIButton sender) { switch (m_wndType) { case 1: //确定 BtnWndBg_OnClickEventHandler(null); break; case 2: //合成公式 TweenLeft(); EquipComposeWnd wnd = WndManager.GetDialog <EquipComposeWnd>(); if (wnd) { EnableBtn(false); wnd.SetData(m_iItemTypeID); } break; case 3: //穿装备 PdbycWnd wnd1 = WndManager.FindDialog <PdbycWnd>(); if (wnd1) { wnd1.SetEquipDataNoReady(); } MyHead.BtnSure.isEnabled = false; SoldierDC.Send_SoldierEquipRequest(m_soldierInfo.ID, m_posIndex); WndManager.DestoryDialog <EquipmentInfoWnd>(); break; case 4: //购买 //堆叠数量上限判定 bool overLimit = ItemDC.CheckItemOverLimit(m_iItemTypeID, m_iBuyCount); if (overLimit) { NGUIUtil.ShowTipWndByKey(30000030); break; } //持有代币是否足够 bool currencyEnough = UserDC.CheckCurrencyEnough(m_iBuyCurrency, m_iBuyPrice); if (currencyEnough) { } else { string currencyName = NGUIUtil.GetStringByKey(99700000 + m_iBuyCurrency); string tipText = string.Format(NGUIUtil.GetStringByKey(30000029), currencyName); //NGUIUtil.ShowTipWnd(tipText); NGUIUtil.ShowFreeSizeTipWnd(tipText); } break; case 5: //获得途径 ItemComeFromWnd Formwnd = WndManager.GetDialog <ItemComeFromWnd>(); s_itemtypeInfo info = ItemM.GetItemInfo(m_iItemTypeID); Formwnd.SetData(info, m_soldierInfo, null); break; } }
void BtnClickSkill_OnPressDownEventHandler(UIButton sender) { ClickSkillDescWnd wnd = WndManager.GetDialog <ClickSkillDescWnd>(); if (wnd) { wnd.SetData(m_soldierSkill.m_description1, m_soldierSkill.m_description2, gameObject); } }
void ShowUpQuilityWndCallBack(object o) { TrapUpQualityWnd Wnd = WndManager.GetDialog <TrapUpQualityWnd>(); if (Wnd != null) { Wnd.SetData(m_Info, m_backUpBuild, this); } }
public void BtnDesign_OnClickEventHandler(UIButton sender) { ShipDesignWnd wnd = WndManager.GetDialog <ShipDesignWnd>(); if (wnd != null) { wnd.SetData(WndType.ShipEdit); } }
void BtnSell_OnClickEventHandler(UIButton sender) { if (m_ItemInfo == null || m_parent == null) { return; } EquipSellWnd wnd = WndManager.GetDialog <EquipSellWnd>(); wnd.SetData(m_ItemInfo, m_parent); }
void ShowUpStarWndCallBack(object o) { SoldierUpStarWnd Wnd = WndManager.GetDialog <SoldierUpStarWnd>(); if (Wnd != null) { Wnd.SetData(m_preSoldierInfo, m_soldierInfo); } m_preSoldierInfo.Copy(m_soldierInfo); EnablePrevNextBtn(true); }
/// <summary> /// 一键解体(全部清除) /// </summary> void BtnDeleteAll_OnClickEventHandler(UIButton sender) { DialogWnd dialogWnd = WndManager.GetDialog <DialogWnd>(); if (dialogWnd) { dialogWnd.SetDialogLable(NGUIUtil.GetStringByKey("30000039"), NGUIUtil.GetStringByKey("88800063"), NGUIUtil.GetStringByKey("88800064")); dialogWnd.YESButtonOnClick = YesReAuth; dialogWnd.ShowDialog(); } }
void ShowSweepResult(int nErrorCode) { UpdateStageInfo(); UpdateSweepInfo(); List <StageDC.StageSweepReward> sweepRewards = StageDC.GetStageSweepRewards(); StageWipeWnd wnd = WndManager.GetDialog <StageWipeWnd>(); wnd.Init(m_ClickSweepTimes); wnd.SetWipeResult(sweepRewards); //DataCenter.AntiRegisterHooks((int)gate.Command.CMD.CMD_718, ShowSweepResult); }
/// <summary> /// 黑科技 /// </summary> void BtnBlackScience_OnClickEventHandler(UIButton sender) { if (BlackScienceDC.CheckHaveCaption() == false) { NGUIUtil.ShowTipWndByKey(30000050); return; } BlackScienceChoWnd bsWnd = WndManager.GetDialog <BlackScienceChoWnd>(); ShipPlan P = ShipPlanDC.GetCurShipPlan(); CaptionInfo captionInfo = BlackScienceDC.GetCaptionD(P.BlackScienceID); bsWnd.SetSelectCaptain(captionInfo); }
/// <summary> /// 显示获取灵魂石窗口 /// </summary> void BtnGetSoulStone_OnClickEventHandler(UIButton sender) { s_itemtypeInfo info = ItemM.GetItemInfo(m_soldierInfo.fragmentTypeID); if (info != null) { ItemComeFromWnd wnd = WndManager.GetDialog <ItemComeFromWnd>(); if (wnd != null) { wnd.SetData(info, m_soldierInfo, null, 2); } } }
private void LoadHeroIntorduct() { HeroIntroduceWnd wnd = WndManager.GetDialog <HeroIntroduceWnd>(); if (wnd != null) { wnd.transform.parent = MyHead.GoParent.transform; wnd.transform.localPosition = MyHead.GoParent.transform.localPosition; wnd.transform.localRotation = MyHead.GoParent.transform.localRotation; wnd.transform.localScale = MyHead.GoParent.transform.localScale; wnd.SetData(m_soldierInfo); } }
private void LoadAddSkillWnd() { AddSkillWnd wnd = WndManager.GetDialog <AddSkillWnd>(); if (wnd != null) { wnd.transform.parent = MyHead.GoParent.transform; wnd.transform.localPosition = MyHead.GoParent.transform.localPosition; wnd.transform.localRotation = MyHead.GoParent.transform.localRotation; wnd.transform.localScale = MyHead.GoParent.transform.localScale; wnd.SetData(m_soldierInfo); } }
public void BtnSelect_OnClickEventHandler(UIButton sender) { //NGUIUtil.DebugLog(string.Format("选取了 炮弹兵:"+Info.m_name)); if (Info == null) { NGUIUtil.DebugLog("ExistHeroItem.cs SoldierInfo == null !!!"); return; } //SoldierInfoWnd wnd = WndManager.GetDialog<SoldierInfoWnd>(); PdbycWnd wnd = WndManager.GetDialog <PdbycWnd>(); wnd.SetData(Info, true); }
private void CMD_1106(int nErrorCode) { DataCenter.AntiRegisterHooks((int)gate.Command.CMD.CMD_1106, CMD_1106); if (nErrorCode == 0) { SetUserData(); BlackScienceUpstarWnd bsuw = WndManager.GetDialog <BlackScienceUpstarWnd>(); bsuw.SetData(m_CurItem.m_caption.m_star - 1, m_CurItem.m_caption.m_star, m_CurItem.Godskill.m_explain); m_CurItem.SetCaption(m_CurItem.m_caption, this); UpStar(); } }
public override void BuildUI() { Life.Environment = LifeEnvironment.Combat; CombatScheduler.SetCSState(CSState.Ready); if (BattleEnvironmentM.GetBattleEnvironmentMode() == BattleEnvironmentMode.CombatPVE) { if (StageDC.GetPveMode() == PVEMode.Attack) { WndManager.GetDialog <SelectSoldierwnd>(); BattleEnvironmentM.BuildScene(); } else { BattleEnvironmentM.BuildScene(); WndManager.GetDialog <CombatWnd>(); CombatInfoWnd wnd = WndManager.GetDialog <CombatInfoWnd>(); if (wnd != null) { wnd.SetWndMode(CombatInfoMode.combat); } if (CmCarbon.GetGodSkill(StageDC.GetPveMode() == PVEMode.Attack) != null) { //船长技能设置 GodSkillWnd gsw = WndManager.GetDialog <GodSkillWnd>(); if (gsw != null) { gsw.SetCurMana(CmCarbon.GetGodSkillMana(true)); gsw.SetRequireMana(CmCarbon.GetGodSkill(true).GetRequireMana()); } } // } } else { WndManager.GetDialog <CombatWnd>(); WndManager.GetDialog <CombatCountDownWnd>(); CombatInfoWnd wnd = WndManager.GetDialog <CombatInfoWnd>(); if (wnd != null) { wnd.SetWndMode(CombatInfoMode.view); } BattleEnvironmentM.BuildScene(); } BattleEnvironmentM.AddFireSoldierCompent(); Screen.sleepTimeout = SleepTimeout.NeverSleep;//prevent phone from going to sleep m_oldUserInfo.Level = UserDC.GetLevel(); m_oldUserInfo.Physical = UserDC.GetPhysical(); }
/// <summary> /// 1003 金银岛掠夺 /// </summary> /// <param name="Info"></param> void CanRob(int nErrorCode) { if (nErrorCode == 0) { CmCarbon.ReadyCombat(); BattleEnvironmentM.BuildScene(); JoinCombat(); } else { WndManager.GetDialog <TreasureCanNotRobWnd>(); } DataCenter.AntiRegisterHooks((int)gate.Command.CMD.CMD_1004, CanRob); }