备份CatanBuilding瘦身独立工程
This commit is contained in:
51
Assets/Scripts/UI/HomeReport/EventReport.cs
Normal file
51
Assets/Scripts/UI/HomeReport/EventReport.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using GameCore;
|
||||
using TMPro;
|
||||
|
||||
public class EventReport : ReportBase
|
||||
{
|
||||
TMP_Text text_info;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
text_info = transform.Find("info/text_info").GetComponent<TMP_Text>();
|
||||
}
|
||||
|
||||
public void SetData(string playFabId, string content, ReportDataType reportDataType)
|
||||
{
|
||||
if (reportDataType == ReportDataType.Bomb)
|
||||
{
|
||||
text_info.text = LocalizationMgr.GetText("UI_HomePanel_101010");
|
||||
|
||||
}
|
||||
else if (reportDataType == ReportDataType.Heist)
|
||||
{
|
||||
text_info.text = LocalizationMgr.GetFormatTextValue("UI_HomePanel_101009", content);
|
||||
}
|
||||
else if (reportDataType == ReportDataType.Aquarium)
|
||||
{
|
||||
string[] str = content.Split('#');
|
||||
string aquariumId = "";
|
||||
if (str.Length > 3 && int.TryParse(str[3], out int itemID))
|
||||
{
|
||||
Item fishItem = GContext.container.Resolve<Tables>().TbItem.GetOrDefault(itemID);
|
||||
if (fishItem != null)
|
||||
{
|
||||
int q = fishItem.Quality;
|
||||
if (q > 6) { q = 6; }
|
||||
aquariumId = LocalizationMgr.GetText($"UI_FishingMapPanel_10101{q+1}");
|
||||
}
|
||||
}
|
||||
if (str.Length > 4 && bool.TryParse(str[4], out bool result) && result)
|
||||
{
|
||||
text_info.text = LocalizationMgr.GetFormatTextValue("UI_EventReportPopupPanel_8", aquariumId);
|
||||
}
|
||||
else
|
||||
text_info.text = LocalizationMgr.GetFormatTextValue("UI_EventReportPopupPanel_7", aquariumId);
|
||||
}
|
||||
Init(playFabId);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user