mly2023cheat/CheatAdvView.cs

50 lines
1.1 KiB
C#

using System.Collections.Generic;
using UnityEngine;
namespace Mly.Hotfix
{
public interface ICheatOpenStage
{
CheatAdvView CheatView { get; set; }
void CheatOpenStagesTo(int id);
}
public interface ICheatOpenAllStages
{
void CheatOpenAllStages();
}
public class CheatAdvView : CheatListView<LocalAdvMap>
{
public ICheatOpenStage View;
public LocalAdvChap Chap;
protected override IList<LocalAdvMap> List => Chap?.AdvMapList;
protected override string GetItemText(LocalAdvMap item)
{
return item.Name1;
}
protected override void OnClickItem(LocalAdvMap item)
{
View.CheatOpenStagesTo(item.Id);
}
protected override void UpdateList()
{
base.UpdateList();
if (View is ICheatOpenAllStages v)
{
if (GUI.Button(CheatUtil.GetNextRect(), $"All", CheatUtil.GetGUIButtonStyle()))
{
v.CheatOpenAllStages();
}
CheatUtil.PointToNext();
}
}
}
}