setting change
This commit is contained in:
@@ -8,7 +8,7 @@ namespace NBF
|
||||
public string ActionName;
|
||||
public string ShowName;
|
||||
|
||||
public virtual void SetData(string actionName, string showName)
|
||||
public virtual void SetData(string actionName, string showName, string map = InputManager.InputMapUI)
|
||||
{
|
||||
this.ActionName = actionName;
|
||||
this.ShowName = showName;
|
||||
@@ -21,7 +21,7 @@ namespace NBF
|
||||
title = Lan.Get(actionName);
|
||||
}
|
||||
|
||||
var iconName = InputManager.Instance.GetUIKeyCode(ActionName);
|
||||
var iconName = InputManager.Instance.GetInputIcon(map, ActionName);
|
||||
icon = UIPackage.GetItemURL(UIDef.Pack.Common, iconName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using NBC;
|
||||
|
||||
@@ -11,6 +12,7 @@ namespace NBF
|
||||
{
|
||||
ContentPane.sortingOrder = UIDef.UIOrder.CommonTopPanel;
|
||||
IsShowCursor = false;
|
||||
Lan.Inst.ChangeAction += ChangeLanguageConfirm;
|
||||
}
|
||||
|
||||
protected override void OnShow()
|
||||
@@ -26,21 +28,34 @@ namespace NBF
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUICanceled(string action)
|
||||
|
||||
private void ChangeLanguageConfirm()
|
||||
{
|
||||
if (action == InputDef.UI.Back)
|
||||
var uis = UI.Inst.GetAllUI();
|
||||
List<IUIPanel> panels = new List<IUIPanel>();
|
||||
foreach (var ui in uis)
|
||||
{
|
||||
var uis = UI.Inst.GetAllUI();
|
||||
foreach (var ui in uis)
|
||||
if (!ui.IsShowing && !ui.IsDotDel)
|
||||
{
|
||||
if (ui.ContentPane.sortingOrder > 0) continue;
|
||||
if (ui.IsTop && !ui.IsDontBack)
|
||||
{
|
||||
UI.Inst.HideUI(ui.GetType());
|
||||
break;
|
||||
}
|
||||
UI.Inst.DestroyUI(ui.GetType());
|
||||
}
|
||||
else
|
||||
{
|
||||
panels.Add(ui);
|
||||
}
|
||||
}
|
||||
|
||||
//打开的页面重刷多语言
|
||||
foreach (var panel in panels)
|
||||
{
|
||||
panel.SetLanguage();
|
||||
_ui.TrySetPanelLanguage(panel.ContentPane);
|
||||
}
|
||||
|
||||
// Net.Inst.Send(EnmCmdValue.EcvCsAcSetLanguageReq, new CS_AC_SetLanguageReq()
|
||||
// {
|
||||
// AppLanguage = Lan.Inst.GetCurrentCustomLanguageName()
|
||||
// });
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
@@ -49,7 +64,7 @@ namespace NBF
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
Lan.Inst.ChangeAction -= ChangeLanguageConfirm;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user