From 9c060f2938430460daa60c64879aa688bf7fdfc5 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期三, 17 四月 2019 16:35:05 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
System/WorldMap/LocalMapEventPointToggle.cs | 56 +++++++++++++++++++++++++++++++++++---------------------
1 files changed, 35 insertions(+), 21 deletions(-)
diff --git a/System/WorldMap/LocalMapEventPointToggle.cs b/System/WorldMap/LocalMapEventPointToggle.cs
index 466aeb0..76c74d0 100644
--- a/System/WorldMap/LocalMapEventPointToggle.cs
+++ b/System/WorldMap/LocalMapEventPointToggle.cs
@@ -14,11 +14,9 @@
public class LocalMapEventPointToggle : ScrollItem
{
[SerializeField] RectTransform m_LayoutLeft;
- [SerializeField] RectTransform m_LayoutRight;
[SerializeField] ButtonEx m_Button;
- [SerializeField] Image m_Icon;
[SerializeField] TextEx m_Title;
- [SerializeField] Text m_Level;
+ [SerializeField] Text m_Description;
[SerializeField] Transform m_Selected;
[SerializeField] Button m_FlyBoot;
[SerializeField] Image m_MonsterType;
@@ -37,7 +35,7 @@
var mapConfig = MapConfig.Get(PlayerDatas.Instance.baseData.MapID);
m_LayoutLeft.gameObject.SetActive(mapConfig.MapFBType == (int)MapType.OpenCountry);
- DrawEventInfo();
+ DisplayEventInfo();
OnSelected(model.selectedMapEventPoint);
model.selectMapEventPointEvent += OnSelected;
}
@@ -50,41 +48,57 @@
private void Awake()
{
- this.m_Button.AddListener(SelectEventPoint);
- this.m_FlyBoot.AddListener(FlyToEventPoint);
+ this.m_Button.SetListener(SelectEventPoint);
+ this.m_FlyBoot.SetListener(FlyToEventPoint);
}
- private void DrawEventInfo()
+ private void DisplayEventInfo()
{
var config = MapEventPointConfig.Get(this.m_EventId);
- var tagChinNpcMod = NPCConfig.Get(config.NPCID);
- this.m_Title.text = tagChinNpcMod != null ? tagChinNpcMod.charName : "";
- if (config.LowLV == config.HighestLV)
+ var npcConfig = NPCConfig.Get(config.NPCID);
+ this.m_Title.text = npcConfig != null ? npcConfig.charName : "";
+
+ if (npcConfig.NPCType == 0)
{
- this.m_Level.text = Language.Get("Z1024", config.LowLV);
+ this.m_Description.text = config.NpcDescription;
+ this.m_MonsterType.gameObject.SetActive(true);
}
else
{
- this.m_Level.text = StringUtility.Contact(Language.Get("Z1024", config.LowLV), "-", config.HighestLV);
+ if (config.LowLV == config.HighestLV)
+ {
+ this.m_Description.text = Language.Get("Z1024", config.LowLV);
+ }
+ else
+ {
+ this.m_Description.text = StringUtility.Contact(Language.Get("Z1024", config.LowLV), "-", config.HighestLV);
+ }
+
+ this.m_MonsterType.gameObject.SetActive(false);
+ this.m_MonsterType.SetSprite(StringUtility.Contact("MapNPC_Colour_", config.Colour));
}
- this.m_MonsterType.SetSprite(StringUtility.Contact("MapNPC_Colour_", config.Colour));
}
private void FlyToEventPoint()
{
- var flyBootOwn = playerPack.GetItemCountByID(PackType.Item, GeneralDefine.flyBootItemId);
- var isVipFreeTransfer = ModelCenter.Instance.GetModel<VipModel>().GetVipPrivilegeCnt(VipPrivilegeType.FreeTransfer) > 0;
- if (isVipFreeTransfer || flyBootOwn > 0)
+ var free = ModelCenter.Instance.GetModel<VipModel>().GetVipPrivilegeCnt(VipPrivilegeType.FreeTransfer) > 0;
+ if (free)
{
MoveToNpc();
+ return;
}
- else
+
+ var hasFlyBoot = playerPack.GetItemCountByID(PackType.Item, GeneralDefine.flyBootItemId) > 0;
+ if (hasFlyBoot)
{
- FlyShoseConfirmwin.useEnvironment = FlyShoseConfirmwin.UseEnvironment.LocalMap;
- FlyShoseConfirmwin.confirmCallBack = MoveToNpc;
- WindowCenter.Instance.Open<FlyShoseConfirmwin>();
+ MoveToNpc();
+ return;
}
+
+ FlyShoseConfirmwin.useEnvironment = FlyShoseConfirmwin.UseEnvironment.LocalMap;
+ FlyShoseConfirmwin.confirmCallBack = MoveToNpc;
+ WindowCenter.Instance.Open<FlyShoseConfirmwin>();
}
private void MoveToNpc()
@@ -106,7 +120,7 @@
{
var selected = _event == m_EventId;
m_Selected.gameObject.SetActive(selected);
- this.m_Title.color = this.m_Level.color = m_FontColor.GetColorSize(selected ? "Selected" : "Normal").color;
+ this.m_Title.color = this.m_Description.color = m_FontColor.GetColorSize(selected ? "Selected" : "Normal").color;
}
}
--
Gitblit v1.8.0