| Core/GameEngine/Model/Config/MapEventPointConfig.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/GameEngine/Model/Config/MapEventPointConfig.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Lua/Gen/MapEventPointConfigWrap.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Lua/Gen/SnxxzUIMapModelWrap.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Achievement/AchievementModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/DailyQuest/DailyQuestModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/MainInterfacePanel/ChatFrame.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/WorldMap/LocalMapFindPath.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/WorldMap/LocalMapWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/WorldMap/MapModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/WorldMap/MapUtility.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Core/GameEngine/Model/Config/MapEventPointConfig.cs
@@ -1,6 +1,6 @@ //-------------------------------------------------------- // [Author]: Fish // [ Date ]: Wednesday, May 15, 2019 // [ Date ]: Wednesday, May 22, 2019 //-------------------------------------------------------- using System.Collections.Generic; @@ -14,7 +14,8 @@ { public readonly int Key; public readonly int MapID; public readonly int DataMapID; public readonly int LineId; public readonly int NPCID; public readonly int IsShowInfo; public readonly int ShowInMipMap; @@ -39,29 +40,31 @@ int.TryParse(tables[0],out Key); int.TryParse(tables[1],out MapID); int.TryParse(tables[1],out DataMapID); int.TryParse(tables[2],out NPCID); int.TryParse(tables[2],out LineId); int.TryParse(tables[3],out IsShowInfo); int.TryParse(tables[3],out NPCID); int.TryParse(tables[4],out ShowInMipMap); int.TryParse(tables[4],out IsShowInfo); int.TryParse(tables[5],out Colour); int.TryParse(tables[5],out ShowInMipMap); NpcDescription = tables[6]; int.TryParse(tables[6],out Colour); int.TryParse(tables[7],out LowLV); NpcDescription = tables[7]; int.TryParse(tables[8],out HighestLV); int.TryParse(tables[8],out LowLV); int.TryParse(tables[9],out Defense); int.TryParse(tables[9],out HighestLV); Drop1 = tables[10]; int.TryParse(tables[10],out Defense); Drop2 = tables[11]; Drop1 = tables[11]; EXP = tables[12]; Drop2 = tables[12]; EXP = tables[13]; } catch (Exception ex) { Core/GameEngine/Model/Config/MapEventPointConfig.cs.meta
@@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: c1d2ccde5bec1a54ab028c9dbaf5486d timeCreated: 1557892144 timeCreated: 1558512587 licenseType: Pro MonoImporter: serializedVersion: 2 Lua/Gen/MapEventPointConfigWrap.cs
@@ -303,10 +303,6 @@ static int _g_get_MapID(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); MapEventPointConfig gen_to_be_invoked = (MapEventPointConfig)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.MapID); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } Lua/Gen/SnxxzUIMapModelWrap.cs
@@ -549,9 +549,6 @@ { int __mapId = LuaAPI.xlua_tointeger(L, 2); System.Collections.Generic.List<int> gen_ret = gen_to_be_invoked.GetMapEventPoints( __mapId ); translator.Push(L, gen_ret); return 1; @@ -676,10 +673,6 @@ if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { int __mapId = LuaAPI.xlua_tointeger(L, 2); int gen_ret = gen_to_be_invoked.GetRecommendHangPoint( __mapId ); LuaAPI.xlua_pushinteger(L, gen_ret); return 1; System/Achievement/AchievementModel.cs
@@ -260,7 +260,7 @@ var mapModel = ModelCenter.Instance.GetModel<MapModel>(); var pointId = mapModel.GetRecommendHangPoint(); var mapEventConfig = MapEventPointConfig.Get(pointId); mapModel.wannaLookLocalMap = mapEventConfig.MapID; mapModel.wannaLookLocalMap = mapEventConfig.DataMapID; WindowCenter.Instance.Open<LocalMapWin>(); break; case 36: System/DailyQuest/DailyQuestModel.cs
@@ -1154,7 +1154,7 @@ case DailyQuestType.KillMonster: var point = mapModel.GetRecommendHangPoint(); var mapEventConfig = MapEventPointConfig.Get(point); mapModel.wannaLookLocalMap = mapEventConfig.MapID; mapModel.wannaLookLocalMap = mapEventConfig.DataMapID; WindowCenter.Instance.Close<DailyQuestWin>(); WindowCenter.Instance.Open<LocalMapWin>(); break; System/MainInterfacePanel/ChatFrame.cs
@@ -303,7 +303,8 @@ var isVipFreeTransfer = ModelCenter.Instance.GetModel<VipModel>().GetVipPrivilegeCnt(VipPrivilegeType.FreeTransfer) > 0; if (isVipFreeTransfer || flyBootOwn > 0) { MapTransferUtility.Instance.MissionFlyTo(config.MapID, config.NPCID); var mapId = MapUtility.GetMapId(config.DataMapID,config.LineId); MapTransferUtility.Instance.MissionFlyTo(mapId, config.NPCID); } else { System/WorldMap/LocalMapFindPath.cs
@@ -29,28 +29,30 @@ MapModel model { get { return ModelCenter.Instance.GetModel<MapModel>(); } } int mapId = 0; public void Init(int _mapId) int dataMapId = 0; int lineId = 0; public void Init(int dataMapId, int lineId) { mapId = _mapId; if (mapId != mapMatrix.mapId) this.dataMapId = dataMapId; this.lineId = lineId; if (this.dataMapId != this.mapMatrix.mapId) { PathPointClear(); this.PathPointClear(); } if (mapId == PlayerDatas.Instance.baseData.MapID) if (this.dataMapId == MapUtility.GetDataMapId()) { m_HeroHead.gameObject.SetActive(true); this.m_HeroHead.gameObject.SetActive(true); var job = PlayerDatas.Instance.baseData.Job; m_HeroHead.SetSprite(GeneralDefine.GetJobHeadPortrait(job, 0)); this.m_HeroHead.SetSprite(GeneralDefine.GetJobHeadPortrait(job, 0)); } else { m_HeroHead.gameObject.SetActive(false); this.m_HeroHead.gameObject.SetActive(false); } var dataMapId = MapUtility.GetDataMapId(mapId); var mapResConfig = MapResourcesConfig.GetConfig(dataMapId, 0); var mapResConfig = MapResourcesConfig.GetConfig(this.dataMapId, this.lineId); var mapWidth = mapResConfig.MapScale.x; var mapHeight = mapResConfig.MapScale.y; @@ -66,7 +68,7 @@ m_BoundDrag.moveArea = new BoundedDrag.MoveArea(-offsetX, offsetX, offsetY, -offsetY); mapMatrix = new LocalMap(mapId, mapWidth, mapHeight, uiMapWidth, uiMapHeight); this.mapMatrix = new LocalMap(this.dataMapId, mapWidth, mapHeight, uiMapWidth, uiMapHeight); DrawWayPoints(); DrawFunctionNpcs(); @@ -79,21 +81,21 @@ m_BoundDrag.onBeginDrag.AddListener(OnBeginDrag); model.selectMapEventPointEvent += FoucsEventPoint; if (PlayerDatas.Instance.baseData.MapID == mapId) if (MapUtility.GetDataMapId() == this.dataMapId) { var hero = PlayerDatas.Instance.hero; if (hero != null) { if (hero.PathFindStatus == GActor.E_PathFindStatus.Moving) { OnHeroStartMove(); this.OnHeroStartMove(); } else { OnHeroStopMove(); this.OnHeroStopMove(); } hero.OnPathFinding += OnHeroStartMove; hero.OnPathFindStop += OnHeroStopMove; hero.OnPathFinding += this.OnHeroStartMove; hero.OnPathFindStop += this.OnHeroStopMove; } } } @@ -120,7 +122,7 @@ void HeroMoveTo(Vector3 _position) { if (mapId != PlayerDatas.Instance.baseData.MapID) if (dataMapId != PlayerDatas.Instance.baseData.MapID) { return; } @@ -161,7 +163,7 @@ private void LateUpdate() { if (mapId == PlayerDatas.Instance.baseData.MapID) if (dataMapId == MapUtility.GetDataMapId()) { UpdateHeroPosition(); } @@ -208,7 +210,7 @@ private void DrawEventPoints() { var eventPoints = model.GetMapEventPoints(mapId); var eventPoints = model.GetMapEventPoints(dataMapId, lineId); for (int i = 0; i < eventPoints.Count; i++) { var eventPoint = eventPoints[i]; @@ -268,7 +270,7 @@ var waypoints = maptransportConfig.GetValues(); foreach (var waypoint in waypoints) { if (waypoint.OriginalMapID == this.mapId) if (waypoint.OriginalMapID == MapUtility.GetMapId(this.dataMapId, this.lineId)) { DrawWayPoint(waypoint.TransportID); } @@ -290,7 +292,7 @@ private void DrawFunctionNpcs() { var npcRefreshIds = model.GetMapNPCRefreshIds(mapId); var npcRefreshIds = model.GetMapNPCRefreshIds(dataMapId); if (npcRefreshIds != null) { foreach (var item in npcRefreshIds) @@ -323,7 +325,7 @@ private void DrawJumpPoints() { var mapData = H2Engine.MapData.LoadFormFile(mapId); var mapData = H2Engine.MapData.LoadFormFile(MapUtility.GetMapId(dataMapId, lineId)); if (mapData == null) { return; @@ -358,7 +360,7 @@ private void UpdateHeroPosition() { if (mapId == PlayerDatas.Instance.baseData.MapID) if (dataMapId == PlayerDatas.Instance.baseData.MapID) { var heroPos = mapMatrix.WorldToLocalPosition(PlayerDatas.Instance.hero.Pos); if (Vector3.Distance(heroPrePosition, heroPos) > 0.01f) @@ -519,9 +521,9 @@ public float localMapWidth; public float localMapHeight; public LocalMap(int mId, float mWidth, float mHeigth, float mSpriteWidth, float mSpriteHeight) public LocalMap(int mapId, float mWidth, float mHeigth, float mSpriteWidth, float mSpriteHeight) { mapId = mId; this.mapId = mapId; worldMapWidth = mWidth; worldMapHeight = mHeigth; localMapWidth = mSpriteWidth; System/WorldMap/LocalMapWin.cs
@@ -22,9 +22,9 @@ [SerializeField] DynamicCyclicScroll m_LinesScroll; [SerializeField] Button m_WorldMap; int mapId = 0; int dataMapId = 0; int lineId = 0; MapModel model { get { return ModelCenter.Instance.GetModel<MapModel>(); } } FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } } public Button close { get; set; } @@ -48,7 +48,8 @@ protected override void OnPreOpen() { mapId = model.wannaLookLocalMap == 0 ? PlayerDatas.Instance.baseData.MapID : model.wannaLookLocalMap; dataMapId = model.wannaLookLocalMap == 0 ? MapUtility.GetDataMapId() : model.wannaLookLocalMap; lineId = MapUtility.GetDataMapId() == dataMapId ? PlayerDatas.Instance.baseData.dungeonLineId : 0; m_MapLineContainer.gameObject.SetActive(false); m_MapLineSwitch.gameObject.SetActive(false); @@ -63,7 +64,6 @@ protected override void OnPreClose() { model.wannaLookLocalMap = 0; m_LocalMap.UnInit(); model.mapLinesUpdateEvent -= OnMapLinesUpdate; @@ -94,25 +94,40 @@ void Init() { ShowMapEventPoints(); m_LocalMap.Init(mapId); var mapConfig = MapConfig.Get(mapId); m_MapName.text = mapConfig.Name; m_LocalMap.Init(dataMapId, lineId); var mapResourceConfig = MapResourcesConfig.GetConfig(dataMapId, lineId); m_MapName.text = mapResourceConfig.Name; m_MapLineSwitch.gameObject.SetActive(!CrossServerUtility.IsCrossServer() && mapId == PlayerDatas.Instance.baseData.MapID); if (BossFakeLineUtility.Instance.showFakeLine) var showLineSwitch = false; if (!CrossServerUtility.IsCrossServer() && dataMapId == MapUtility.GetDataMapId()) { m_CurrentLine.text = Language.Get("line", 1); var mapId = PlayerDatas.Instance.baseData.MapID; var mapConfig = MapConfig.Get(mapId); if (mapConfig.MapFBType == 0) { showLineSwitch = true; } } else m_MapLineSwitch.gameObject.SetActive(showLineSwitch); if (showLineSwitch) { m_CurrentLine.text = Language.Get("line", PlayerDatas.Instance.baseData.FBID + 1); if (BossFakeLineUtility.Instance.showFakeLine) { m_CurrentLine.text = Language.Get("line", 1); } else { m_CurrentLine.text = Language.Get("line", PlayerDatas.Instance.baseData.FBID + 1); } } } private void ShowMapEventPoints() { var visableEventPoints = new List<int>(); var eventPoints = model.GetMapEventPoints(mapId); var eventPoints = model.GetMapEventPoints(dataMapId, lineId); for (int i = 0; i < eventPoints.Count; i++) { var config = MapEventPointConfig.Get(eventPoints[i]); @@ -138,7 +153,7 @@ }); m_EventPointToggleGroup.Init(visableEventPoints); var recommendHangPoint = model.GetRecommendHangPoint(mapId); var recommendHangPoint = model.GetRecommendHangPoint(dataMapId, lineId); if (recommendHangPoint == 0) { model.selectedMapEventPoint = -1; @@ -159,6 +174,7 @@ } else { var mapId = MapUtility.GetMapId(dataMapId, lineId); var lines = model.GetMapLines(mapId); if (lines != null) { @@ -194,6 +210,7 @@ private void OnMapLinesUpdate(int _mapId) { var mapId = MapUtility.GetMapId(dataMapId, lineId); if (mapId != _mapId) { return; System/WorldMap/MapModel.cs
@@ -263,11 +263,12 @@ return new List<int>(worldMapAreas.Keys); } public List<int> GetMapEventPoints(int _mapId) public List<int> GetMapEventPoints(int dataMapId, int lineId) { if (localMapEventPoints.ContainsKey(_mapId)) var key = dataMapId * 100 + lineId; if (localMapEventPoints.ContainsKey(key)) { return localMapEventPoints[_mapId]; return localMapEventPoints[key]; } else { @@ -312,9 +313,9 @@ } } public int GetRecommendHangPoint(int _mapId) public int GetRecommendHangPoint(int _mapId, int lineId) { var eventPoints = new List<int>(GetMapEventPoints(_mapId)); var eventPoints = new List<int>(GetMapEventPoints(_mapId, lineId)); for (int i = eventPoints.Count - 1; i >= 0; i--) { var config = MapEventPointConfig.Get(eventPoints[i]); @@ -394,7 +395,7 @@ for (int i = 0; i < sortedHangUpPoints.Count; i++) { var config = MapEventPointConfig.Get(sortedHangUpPoints[i]); if (IsMapUnlocked(config.MapID)) if (IsMapUnlocked(MapUtility.GetMapId(config.DataMapID, config.LineId))) { unLockedHangeUpPoints.Add(sortedHangUpPoints[i]); } @@ -562,20 +563,20 @@ var mapEventConfigs = MapEventPointConfig.GetValues(); foreach (var config in mapEventConfigs) { var mapId = config.MapID; var mapId = MapUtility.GetMapId(config.DataMapID,config.LineId); var key = config.DataMapID * 100 + config.LineId; List<int> eventPointIds = null; if (!localMapEventPoints.ContainsKey(mapId)) if (!localMapEventPoints.ContainsKey(key)) { localMapEventPoints[mapId] = eventPointIds = new List<int>(); localMapEventPoints[key] = eventPointIds = new List<int>(); } else { eventPointIds = localMapEventPoints[mapId]; eventPointIds = localMapEventPoints[key]; } eventPointIds.Add(config.Key); if (config.IsShowInfo == 1 && GeneralDefine.autoOnHookMap.Contains(config.MapID)) if (config.IsShowInfo == 1 && GeneralDefine.autoOnHookMap.Contains(mapId)) { sortedMapEventPoints.Add(config.Key); } @@ -593,7 +594,8 @@ { var eventPoint = sortedMapEventPoints[i]; var config = MapEventPointConfig.Get(eventPoint); if (GeneralDefine.autoOnHookMap.Contains(config.MapID)) var mapId = MapUtility.GetMapId(config.DataMapID,config.LineId); if (GeneralDefine.autoOnHookMap.Contains(mapId)) { sortedHangUpPoints.Add(eventPoint); } System/WorldMap/MapUtility.cs
@@ -1,11 +1,25 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using Snxxz.UI; public class MapUtility { static DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } public static int GetMapId(int dataMapId, int lineId) { var dungeonId = dungeonModel.GetDungeonId(dataMapId, lineId); if (dungeonId==0) { return dataMapId; } else { var config = DungeonConfig.Get(dungeonId); return config == null ? dataMapId : config.MapID; } } public static int GetDataMapId(int mapId) {