AxibugEmuOnline/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/ScreenScalerListMenuItem.cs
ALIENJACK\alien 355042fc84 三级虚拟菜单重载接口调整,现在可以在显示三级菜单时,指定默认选中的项目
主菜单中的画面比例设置,在弹出时会自动选中当前已设置的选项
2025-01-07 11:23:10 +08:00

35 lines
961 B
C#

using AxibugEmuOnline.Client.ClientCore;
using System;
using System.Collections.Generic;
namespace AxibugEmuOnline.Client
{
public class ScreenScalerListMenuItem : VirtualSubMenuItem
{
public override bool OnEnterItem()
{
App.settings.Filter.EnableFilterPreview();
return base.OnEnterItem();
}
public override bool OnExitItem()
{
App.settings.Filter.ShutDownFilterPreview();
return base.OnExitItem();
}
protected override void GetVirtualListDatas(VirtualListDataHandle callback)
{
List<object> list = new List<object>();
foreach (var enumValue in Enum.GetValues(typeof(ScreenScaler.EnumScalerMode))) list.Add(enumValue);
var select = list.IndexOf(App.settings.ScreenScaler.GlobalMode);
if (select == -1) select = 0;
callback.Invoke(list, select);
}
}
}