预览功能替换预览图片

This commit is contained in:
ALIENJACK\alien 2024-12-13 16:01:48 +08:00
parent b5942edc22
commit 382322c8c8
6 changed files with 34 additions and 24 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a25a763784438ee40892d9d4cf4606df
guid: e043954733c440645ba43b09301ee4a6
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
@ -34,7 +34,7 @@ TextureImporter:
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 1
@ -69,10 +69,10 @@ TextureImporter:
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
textureFormat: 4
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0

View File

@ -15218,7 +15218,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: a25a763784438ee40892d9d4cf4606df, type: 3}
m_Sprite: {fileID: 21300000, guid: e043954733c440645ba43b09301ee4a6, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1

View File

@ -1,4 +1,4 @@
using AxibugEmuOnline.Client.ClientCore;
using AxibugEmuOnline.Client.ClientCore;
using System;
using System.Collections.Generic;
using System.Linq;
@ -25,6 +25,7 @@ namespace AxibugEmuOnline.Client
protected override void GetVirtualListDatas(Action<object> datas)
{
List<object> list = new List<object>();
list.Add(null);
list.AddRange(App.filter.Filters.Select(f => (object)f));
datas.Invoke(list);
}

View File

@ -1,4 +1,4 @@
using AxibugEmuOnline.Client.ClientCore;
using AxibugEmuOnline.Client.ClientCore;
using AxibugEmuOnline.Client.UI;
using System;
using System.Collections.Generic;
@ -9,7 +9,7 @@ using static AxibugEmuOnline.Client.FilterManager;
namespace AxibugEmuOnline.Client
{
/// <summary>
/// 背景颜色设置UI
/// 背景颜色设置UI
/// </summary>
public class UI_FilterItem : MenuItem, IVirtualItem
{
@ -25,7 +25,10 @@ namespace AxibugEmuOnline.Client
private void UpdateView()
{
SetBaseInfo(Datacontext.Name, $"参数数量:{Datacontext.Paramerters.Count}", null);
if (Datacontext == null)
SetBaseInfo("无", null, null);
else
SetBaseInfo(Datacontext.Name, $"参数数量:{Datacontext.Paramerters.Count}", null);
}
public void SetDependencyProperty(object data)
@ -35,7 +38,10 @@ namespace AxibugEmuOnline.Client
if (m_select)
{
App.filter.EnableFilterPreview();
App.filter.EnableFilter(Datacontext);
if (App.filter != null)
App.filter.EnableFilter(Datacontext);
else
App.filter.ShutDownFilter();
}
}
@ -43,16 +49,19 @@ namespace AxibugEmuOnline.Client
public override bool OnEnterItem()
{
var opts = new List<OptionMenu>();
opts.Add(new Opt_CreatePreset(Datacontext));
opts.AddRange(Datacontext.Presets.Select(p => new Opt_Presets(Datacontext, p)));
OverlayManager.PopSideBar(opts, onClose: () =>
if (Datacontext != null && Datacontext.Paramerters.Count > 0)
{
App.filter.EnableFilterPreview();
Datacontext.ResetPreset();
App.filter.EnableFilter(Datacontext);
});
var opts = new List<OptionMenu>();
opts.Add(new Opt_CreatePreset(Datacontext));
opts.AddRange(Datacontext.Presets.Select(p => new Opt_Presets(Datacontext, p)));
OverlayManager.PopSideBar(opts, onClose: () =>
{
App.filter.EnableFilterPreview();
Datacontext.ResetPreset();
App.filter.EnableFilter(Datacontext);
});
}
return false;
}
@ -61,7 +70,7 @@ namespace AxibugEmuOnline.Client
{
private Filter m_filter;
public Opt_CreatePreset(Filter filter) : base("创建滤镜预设", Resources.LoadAll<Sprite>("Icons/XMB-Icons/misc")[0])
public Opt_CreatePreset(Filter filter) : base("创建滤镜预设", Resources.LoadAll<Sprite>("Icons/XMB-Icons/misc")[0])
{
m_filter = filter;
}
@ -81,7 +90,7 @@ namespace AxibugEmuOnline.Client
var result = m_filter.CreatePreset(presetName, out var newPreset);
if (!result) OverlayManager.PopTip(result);
else optionUI.AddOptionMenuWhenPoping(new Opt_Presets(m_filter, newPreset));
}, "为预设设置一个名称", string.Empty);
}, "为预设设置一个名称", string.Empty);
}
}
public class Opt_Presets : ExpandMenu
@ -170,7 +179,7 @@ namespace AxibugEmuOnline.Client
private Filter m_filter;
private FilterPreset m_preset;
public Opt_Delete(Filter filter, FilterPreset preset) : base("删除预设", null)
public Opt_Delete(Filter filter, FilterPreset preset) : base("删除预设", null)
{
m_filter = filter;
m_preset = preset;