先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
114 lines
3.3 KiB
C#
114 lines
3.3 KiB
C#
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
using System.Collections.Generic;
|
|
|
|
public class TraveMapDataManager
|
|
{
|
|
public List<TraveMapItemData> mapItemList = new List<TraveMapItemData>();
|
|
public List<TraveMapItemData> mapShowItemData = new List<TraveMapItemData>();
|
|
public int index = -1;
|
|
public bool IsVisit { private set; get; } = false; //是否访问地图
|
|
|
|
public void Init(bool isVisit)
|
|
{
|
|
IsVisit = isVisit;
|
|
Tables tables = GContext.container.Resolve<Tables>();
|
|
CampDataMM campData = GContext.container.Resolve<CampDataMM>();
|
|
int mapId = campData.Id;
|
|
const int maxDemoBuildingId = 102;
|
|
int maxID = System.Math.Min(mapId + 5, maxDemoBuildingId);
|
|
List<Construction> consDatas = tables.TbConstruction.DataList;
|
|
List<MapData> mapDatas = tables.TbMapData.DataList;
|
|
mapItemList.Clear();
|
|
mapShowItemData.Clear();
|
|
Construction cons = consDatas[0];
|
|
MapData mapData = mapDatas[0];
|
|
int count = 0;
|
|
for (int i = 0; i < consDatas.Count; i++)
|
|
{
|
|
cons = consDatas[i];
|
|
mapData = mapDatas[i];
|
|
TraveMapItemData item = new TraveMapItemData();
|
|
item.index = i;
|
|
item.id = cons.ID;
|
|
item.isVisit = IsVisit;
|
|
item.icon = campData.GetMMTString(mapData.TravelMapIcon);
|
|
item.name = $"{i + 1}.{LocalizationMgr.GetText(mapData.Name_l10n_key)}";
|
|
if (mapId > cons.ID)
|
|
{
|
|
item.type = TraveMapType.unlocked;
|
|
mapShowItemData.Add(item);
|
|
}
|
|
else if (mapId == cons.ID)
|
|
{
|
|
//CampData campData = GContext.container.Resolve<CampData>();
|
|
//if (campData.IsCanSkyscraper)
|
|
//{
|
|
// item.type = TraveMapType.unlocked;
|
|
// mapShowItemData.Add(item);
|
|
//}
|
|
//else
|
|
{
|
|
item.type = TraveMapType.current;
|
|
}
|
|
index = i;
|
|
}
|
|
else
|
|
{
|
|
item.type = TraveMapType.locked;
|
|
}
|
|
mapItemList.Add(item);
|
|
count = i;
|
|
if (maxID == cons.ID)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
if (index == -1)
|
|
{
|
|
index = mapItemList.Count - 1;
|
|
}
|
|
bool isShowTips = true;
|
|
if (cons.NextID == -1)
|
|
{
|
|
isShowTips = false;
|
|
count++;
|
|
TraveMapItemData item = new TraveMapItemData();
|
|
item.index = count;
|
|
item.icon = "";
|
|
item.name = $"{count + 1}.{LocalizationMgr.GetText("UI_ToastPanel_24")}";
|
|
item.type = TraveMapType.comingSoon;
|
|
mapItemList.Add(item);
|
|
}
|
|
|
|
//滑动框支持从下往上排列???
|
|
mapItemList.Reverse();
|
|
mapItemList[0].showTips = isShowTips;
|
|
index = mapItemList.Count - 1 - index - 1;
|
|
}
|
|
|
|
}
|
|
public enum TraveMapType
|
|
{
|
|
//已解锁
|
|
//当前
|
|
//未解锁
|
|
//敬请期待
|
|
unlocked,
|
|
current,
|
|
locked,
|
|
comingSoon,
|
|
}
|
|
public class TraveMapItemData
|
|
{
|
|
public int index;
|
|
public int id;
|
|
public string icon;
|
|
public string name;
|
|
public string description;
|
|
public TraveMapType type;
|
|
public bool showTips;
|
|
public bool isVisit;
|
|
}
|