|
@@ -52,6 +52,45 @@ namespace ET.Client
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ [Event(SceneType.None)]
|
|
|
+ public class RankEventHandler : BEvent<RankChangeEvent>
|
|
|
+ {
|
|
|
+ public override void OnEvent(RankChangeEvent a)
|
|
|
+ {
|
|
|
+ var view = UIHelper.GetUI("HUD") as GComponent;
|
|
|
+ if (view == null) return;
|
|
|
+
|
|
|
+ var list = view.GetChild("list_rank").asList;
|
|
|
+ if (list == null) return;
|
|
|
+
|
|
|
+ list.visible = a.InfoList != null && a.InfoList.Count > 0;
|
|
|
+ if(list.visible)
|
|
|
+ {
|
|
|
+ int i = 0;
|
|
|
+ for (; i<a.InfoList.Count; i++)
|
|
|
+ {
|
|
|
+ var chd = list.GetChildAt(i).asCom;
|
|
|
+ if(chd == null)
|
|
|
+ {
|
|
|
+ Log.Error($"rank list child not exist: {i}");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ var txt = chd.GetChild("text");
|
|
|
+ txt.text = a.InfoList[i].Name;
|
|
|
+ chd.visible = true;
|
|
|
+ }
|
|
|
+ for(; i < 3; i++)
|
|
|
+ {
|
|
|
+ var chd = list.GetChildAt(i);
|
|
|
+ if(chd != null)
|
|
|
+ {
|
|
|
+ chd.visible = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static class HUDMgr
|
|
|
{
|
|
|
public static void InitView(GComponent view)
|