public override void Init() { Create(Config.VIEW_CHANGEACCOUNT2, false, Tools.GetMessageById("13125")); userModel = ModelManager.inst.userModel; roleModel = ModelManager.inst.roleModel; alertModel = ModelManager.inst.alertModel; ulist = new List <string>(); InitItem(); }
public override void Init() { base.Init(); this.isAutoClose = false; this.Create(Config.COM_ALERT); alertModel = ModelManager.inst.alertModel; btn1 = this.GetChild("n1").asButton; btn1.text = Tools.GetMessageById("14057"); btn2 = this.GetChild("n2").asButton; btn2.text = Tools.GetMessageById("14056"); t = this.GetChild("n3").asTextField; c1 = this.GetController("c1"); loader = this.GetChild("n15").asLoader; count = this.GetChild("n16").asTextField; if (!alertModel.isYesAndNo) { btn1.visible = false; btn2.x = (this.width - btn2.width) / 2; } if (alertModel.close) { TimerManager.inst.Add(1f, 0, CloseSelf); } btn1.onClick.Add(Btn1_Click); // btn1.text = Tools.GetMessageById("14025"); btn2.onClick.Add(Btn2_Click); // btn1.text = Tools.GetMessageById("14056"); if (c1.selectedIndex != alertModel.showType) { c1.selectedIndex = alertModel.showType; loader.url = Tools.GetIconUrl(alertModel.id); count.text = Tools.GetMessageById("14016", new string[] { alertModel.count.ToString() }); } else { t.text = alertModel.text; } // EffectManager.inst.SetFilterAdjustBrightnessChild (this.group, 5f, 0f, 1f); // TimerManager.inst.Add (5.5f, 1, (float t) => // { // EffectManager.inst.SetFilterAdjustBrightnessChild (g, 5f, 1f, 0f); // }); }
public void Register() { gameModel = new ModelGame(); alertModel = new ModelAlert(); userModel = new ModelUser(); roleModel = new ModelRole(); guildModel = new ModelGuild(); chatModel = new ModelChat(); cardModel = new ModelCard(); mailModel = new ModelMail(); fightModel = new ModelFight(); rankModel = new ModelRank(); guideModel = new ModelGuide(); shareModel = new ModelShare(); }
public void ShowAlert(string text, ModelAlert.AlertEvent fun = null, bool isYesAndNo = false, bool close = false) { ModelAlert model = ModelManager.inst.alertModel; model.text = text; model.onAlert = fun; model.isYesAndNo = isYesAndNo; model.close = close; model.showType = 0; CloseAlert(); alert = new ComAlert(); t.AddChild(alert.group); SetTMask(); EffectManager.inst.ShowView(alert.group); }
//需要消耗多少 public void ShowAlert(string id, int count, ModelAlert.AlertEvent fun = null) { ModelAlert model = ModelManager.inst.alertModel; model.text = ""; model.onAlert = fun; model.isYesAndNo = true; model.id = id; model.count = count; model.showType = 1; CloseAlert(); alert = new ComAlert(); t.AddChild(alert.group); SetTMask(); EffectManager.inst.ShowView(alert.group); }
public void ShowAlertLike(string id, int count, ModelAlert.AlertEvent fun = null) { ModelAlert model = ModelManager.inst.alertModel; model.onAlert = fun; model.id = id; model.count = count; CloseAlert(); if (model.isOpen) { alertLike = new ComAlertLike(); t.AddChild(alertLike.group); SetTMask(); EffectManager.inst.ShowView(alertLike.group); } else { model.execute(1); } }
public override void Init() { base.Init(); Create(Config.COM_ALERTLIKE); alertModel = ModelManager.inst.alertModel; title = GetChild("n2").asTextField; expendNum = GetChild("n4").asTextField; text_Check = GetChild("n8").asTextField; icon = GetChild("n3").asLoader; btn_Check = GetChild("n7").asButton; btn_Cancel = GetChild("n5").asButton; btn_Cancel.text = Tools.GetMessageById("14025"); btn_Ok = GetChild("n6").asButton; btn_Ok.text = Tools.GetMessageById("14056"); title.text = Tools.GetMessageById("13056"); text_Check.text = Tools.GetMessageById("13123"); icon.url = Tools.GetResourceUrl("Image2:n_icon_zs"); expendNum.text = alertModel.count.ToString(); btn_Ok.onClick.Add(BtnOk); btn_Check.onChanged.Add(BtnCheck); btn_Cancel.onClick.Add(BtnCancel); }