1
This commit is contained in:
@@ -99,15 +99,26 @@ namespace BITKit.UX
|
||||
{
|
||||
await UniTask.SwitchToMainThread();
|
||||
if (destroyCancellationToken.IsCancellationRequested) return;
|
||||
_modContainers.GetOrAdd(obj.Name,_=> Create(obj));
|
||||
|
||||
var container = _modContainers.GetOrAdd(obj.Name,_=> Create(obj));
|
||||
container.visualElement.RegisterCallback<MouseDownEvent>(x =>
|
||||
{
|
||||
if (x.button != 1) return;
|
||||
ContextMenuBuilder.Create().BuildAction("卸载", () =>
|
||||
{
|
||||
ModService.UnLoad(obj);
|
||||
ModService.UnInstall(obj);
|
||||
}).Build();
|
||||
});
|
||||
}
|
||||
private async void OnModUnLoaded(IMod obj)
|
||||
{
|
||||
await UniTask.SwitchToMainThread();
|
||||
if (destroyCancellationToken.IsCancellationRequested) return;
|
||||
var container = _modContainers.GetOrAdd(obj.Name,_=> Create(obj));
|
||||
container.toggle.SetValueWithoutNotify(false);
|
||||
//var container = _modContainers.GetOrAdd(obj.Name,_=> Create(obj));
|
||||
if(_modContainers.TryGetValue(obj.Name,out var container))
|
||||
{
|
||||
container.toggle.SetValueWithoutNotify(false);
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnModLoaded(IMod obj)
|
||||
|
Reference in New Issue
Block a user