- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
107 lines
3.4 KiB
C#
107 lines
3.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using XFramework;
|
|
/// <summary>
|
|
/// 学员端操作完成弹出
|
|
/// 用于显示教员发送的评估结果
|
|
/// 学员可主动退出 并通知教员
|
|
/// </summary>
|
|
public class WaitResultPanel : BasePanel
|
|
{
|
|
const string panelName = "Panel_WaitResultPanel";
|
|
Transform waitText;//等待中提示文字
|
|
Text showLevelText;//显示评价等级
|
|
Text showRemark;//显示教员评语
|
|
|
|
public WaitResultPanel() :base(new UIType("Panel_WaitResultPanel"))
|
|
{
|
|
|
|
}
|
|
|
|
|
|
protected override void InitEvent()
|
|
{
|
|
ActivePanel.FindChildTrans("Button_Close").GetComponent<Button>().onClick.AddListener(CloseButtonOn);
|
|
waitText = ActivePanel.FindChildTrans("Text_wating");
|
|
showLevelText = ActivePanel.FindChildTrans("Text_level").GetComponent<Text>();
|
|
showRemark = ActivePanel.FindChildTrans("Text_remark").GetComponent<Text>();
|
|
}
|
|
|
|
public override void OnStart()
|
|
{
|
|
base.OnStart();
|
|
EventCenter.Instance.AddEventListener<NetAppraiseData>("TeacherSendResult", InjectResult);
|
|
waitText.gameObject.SetActive(true);
|
|
showLevelText.gameObject.SetActive(false);
|
|
showRemark.gameObject.SetActive(false);
|
|
}
|
|
|
|
//注入成绩类
|
|
private void InjectResult(NetAppraiseData netAppraiseData)
|
|
{
|
|
if (netAppraiseData.appraised)//有效评估成绩
|
|
{
|
|
waitText.gameObject.SetActive(false);
|
|
showLevelText.gameObject.SetActive(true);
|
|
string color = "";
|
|
switch (netAppraiseData.appraiseLevel)
|
|
{
|
|
case "优秀":
|
|
color = "FFFF00";
|
|
break;
|
|
case "良好":
|
|
color = "04FF00";
|
|
break;
|
|
case "一般":
|
|
color = "00FFF5";
|
|
break;
|
|
case "较差":
|
|
color = "FF6A00";
|
|
break;
|
|
}
|
|
LocalizationManager.SetFormatted(showLevelText, "<color=#{0}><size=80>{1}</size></color>", color, netAppraiseData.appraiseLevel);
|
|
|
|
if (!string.IsNullOrEmpty(netAppraiseData.remark))//有教员评语时 显示教员评语
|
|
{
|
|
showRemark.gameObject.SetActive(true);
|
|
showRemark.text = netAppraiseData.remark;
|
|
}
|
|
}
|
|
else//教员放弃评价 返回初始场景 无需发送结束事件
|
|
{
|
|
FinishedWait();
|
|
}
|
|
}
|
|
|
|
//尝试关闭本界面时
|
|
private void CloseButtonOn()
|
|
{
|
|
if (!showLevelText.gameObject.activeSelf) //未显示成绩 退出提示
|
|
{
|
|
|
|
Push(new PromptWindows()).Change(new PromptWindowInitData(LocalizationManager.Get("是否不再等待教员评价,并返回初始场景?"), ClosePanelAndSend));//弹出提示界面
|
|
}
|
|
else
|
|
{
|
|
ClosePanelAndSend();
|
|
}
|
|
}
|
|
|
|
private void ClosePanelAndSend()
|
|
{
|
|
TCPManager.Instance.SendNetMsg(NetMsgName.StuCloseResPanel);
|
|
FinishedWait();
|
|
}
|
|
|
|
|
|
//结束等待界面
|
|
private void FinishedWait()
|
|
{
|
|
EventCenter.Instance.RemoveEnvetListener<NetAppraiseData>("TeacherSendResult", InjectResult);
|
|
Pop();
|
|
SceneSystem.Instance.SetScene(new StudentLoginScene(LoadSceneType.Login));
|
|
}
|
|
}
|