private void OnrenderLogin(int index, GObject item) { GComponent obj = item.asCom; GLoader icon = obj.GetChild("n2").asLoader; object[] value = (object[])loginType[index]; //object[] data=(object[])value[value["name"].ToString()]; icon.url = Tools.GetResourceUrl("Icon:" + value[1].ToString()); item.onClick.Add(() => { switch (value[2].ToString()) { case "phone": Type_Bingding = Ex_Local.LOGIN_TYPE_TEL; ViewManager.inst.ShowView <MediatorRegister>(); break; case "weixin": //微信 //userModel.tel = "wx|1204"; //InitDate(); Bingding(Ex_Local.LOGIN_TYPE_WEIXIN); break; case "weibo": //微博 break; case "qq": //qq Bingding(Ex_Local.LOGIN_TYPE_QQ); break; } }); }
private void GetUICompoent() { panelupUI = Ui.GetChild("panelup").asCom; valueMonitorPool.Clear(); panelup = Ui.GetChild("panelup").asCom; panelup.visible = false; progressBar_hp = Ui.GetChildWithPath("panelup/hpbar").asProgress; progressBar_mp = Ui.GetChildWithPath("panelup/mpbar").asProgress; progressBar_tili = Ui.GetChildWithPath("panelup/physicalbar").asProgress; damage = panelup.GetChild("damage").asTextField; defenses = panelup.GetChild("defenses").asTextField; MovingSpeed = panelup.GetChild("Moving speed").asTextField; MagicDamage = panelup.GetChild("Magic damage").asTextField; showLoader = panelup.GetChild("n76").asLoader; RenderTexture renderTexture = Resources.Load <RenderTexture>("roleinfotexture"); showLoader.texture = new NTexture(renderTexture); Crit = panelup.GetChild("crit").asTextField; CriticalDamage = panelup.GetChild("Critical damage").asTextField; choiceframe = panelup.GetChild("choiceframe").asImage; leveltext = panelup.GetChild("n78").asTextField; player1Controller = GameObject.Find("Player1").GetComponent <RoleController>(); panelDownUI = UIManager.Instance.GetUI <PanelDownUI>("paneldown"); }
protected override void OnInit() { this.contentPane = UIPackage.CreateObject("UIMain", "BuildWindow").asCom; this.Center(); this.modal = true; _list = this.contentPane.GetChild("list").asList; _close = this.contentPane.GetChild("close").asLoader; _close.onClick.Add(delegate(EventContext context) { this.Hide(); }); _list.onClickItem.Add(__clickItem); //_list.itemRenderer = RenderListItem; _list.EnsureBoundsCorrect(); _detail = (BuildDetail)this.contentPane.GetChild("detail").asCom; _detail.visible = false; _confirmButton = this.contentPane.GetChild("confirm").asCom; _confirmButton.onTouchBegin.Add(buildConfirm); foreach (TowerTemplate tt in BattleManager.getInstance().buildableTowers) { BuildItem item = (BuildItem)_list.AddItemFromPool("ui://UIMain/BuildItem"); item.setTowerInfo(tt); } float interval = 300 / (_list.numChildren > 8?8:_list.numChildren); _list.columnGap = (int)interval; //_list.numItems = 3; }
private void RenderListItem(int index, GObject obj) { GComponent com = obj.asCom; GLoader pe = com.GetChild("person").asLoader, s1 = com.GetChild("s1").asLoader, s2 = com.GetChild("s2").asLoader, s3 = com.GetChild("s3").asLoader, s4 = com.GetChild("s4").asLoader, s5 = com.GetChild("s5").asLoader; GTextField t = com.GetChild("label").asTextField, tNum = com.GetChild("numLabel").asTextField; int peIndex = index % 9 + 1; pe.url = UIPackage.GetItemURL("publicUI", "pe" + peIndex); string startURL = UIPackage.GetItemURL("szmnUI", "star");; if (index * 7 % 3 + 1 == 1) { s1.url = startURL; s2.url = ""; s3.url = ""; s4.url = ""; s5.url = ""; } else if (index * 7 % 3 + 1 == 2) { s1.url = ""; s2.url = ""; s3.url = ""; s4.url = startURL; s5.url = startURL; } else { s1.url = startURL; s2.url = startURL; s3.url = startURL; s4.url = ""; s5.url = ""; } //Debug.Log(t); t.text = index + "\n可能有的相关职业,相关属性等"; tNum.text = (index * 7 % 17).ToString(); com.GetChild("add").onClick.Add(() => { if (int.Parse(tNum.text) < 100000) { tNum.text = (int.Parse(tNum.text) + 1).ToString(); } }); com.GetChild("minus").onClick.Add(() => { if (int.Parse(tNum.text) > 0) { tNum.text = (int.Parse(tNum.text) - 1).ToString(); } }); //t.title = index + "\n可能有的相关职业,相关属性等"; }
// Use this for initialization void Start() { Application.targetFrameRate = 60; _mainView = this.gameObject.GetComponent <UIPanel>().ui; GButton photo_01 = _mainView.GetChild("photo_01").asButton; GButton photo_02 = _mainView.GetChild("photo_02").asButton; GButton flower_01 = _mainView.GetChild("flower_01").asButton; GButton flower_02 = _mainView.GetChild("flower_02").asButton; photo_01.draggable = true; photo_01.onDragStart.Add((EventContext context) => { context.PreventDefault(); MyDragDropManager.inst.StartDrag(photo_01, photo_01.icon, flower_01.icon, photo_01.icon, (int)context.data); GLoader loader_b = MyDragDropManager.inst.dragAgent_a; loader_b.fill = FillType.ScaleFree; loader_b.width = 100; loader_b.height = 30; }); photo_02.icon = null; photo_02.onDrop.Add((EventContext context) => { photo_02.icon = (string)context.data; }); }
public static Tweener TweenLoader(GLoader target, float endValue, float duration) { //return DOTween.To(() => target.fillAmount, x => target.fillAmount = x, endValue, duration); return(DOTween.To(() => { if (target == null) { Debug.Log("空了"); return endValue; } else { return target.fillAmount; } }, x => { if (target != null && !target.isDisposed) { target.fillAmount = x; } }, endValue, duration)); }
protected override void OnInit() { this.contentPane = UIPackage.CreateObject("UIMain", "DialogWindow").asCom; this.Center(); this.modal = true; _branches = this.contentPane.GetChild("tabs").asList; _loader = this.contentPane.GetChild("pic").asLoader; _text = this.contentPane.GetChild("desp").asTextField; _branches.foldInvisibleItems = true; _branches.onClickItem.Add(clickItem); _branches.EnsureBoundsCorrect(); // for (int i = 0; i < MAX_BRANCH_NUM; i++) // { // SelectionBranch item = (SelectionBranch)_branches.GetChildAt (i).asButton; // item.idx = i; // } // float interval = 300/(_list.numChildren>8?8:_list.numChildren); // _list.columnGap = (int)interval; //_list.numItems = 3; }
public override void ConstructFromXML(XML xml) { base.ConstructFromXML(xml); m_Icon = (GLoader)this.GetChildAt(0); m_Amount = (GTextField)this.GetChildAt(1); }
private void Voyage_Render(int index, GObject item) { Dictionary <string, object> data = (Dictionary <string, object>)list[index]; int index_ = Convert.ToInt32(data["name"]); if (index_ == -1) { return; } object[] dc = (object[])data[index_ + ""]; GTextField textTitle = item.asCom.GetChild("n1").asTextField; GLoader load = item.asCom.GetChild("n2").asLoader; GTextField group = item.asCom.GetChild("n5").asTextField; GTextField rankScore = item.asCom.GetChild("n94").asTextField; GTextField rankLevel = item.asCom.GetChild("n3").asTextField; GTextField rankLevelValue = item.asCom.GetChild("n4").asTextField; if ((int)dc[1] > rankMax) { rankLevelValue.text = rankMax + Tools.GetMessageById("13129"); } else { rankLevelValue.text = dc[1].ToString(); } textTitle.text = Tools.GetMessageById("31079", new string[] { (index_ + "").ToString() }); load.url = userModel.GetRankImg((int)dc[0], 0, true); group.text = Tools.getRankGroup((int)dc[0]);//大师组 rankScore.text = dc[0].ToString(); rankLevel.text = Tools.GetMessageById("13085"); }
private void FindeObject() { Dictionary <string, object> dc = (Dictionary <string, object>)DataManager.inst.systemSimple["picture_config"]; upload_max = (int)dc["upload_max"]; list = this.GetChild("n2").asList; image_photo_ = this.GetChild("n0"); image_photo = image_photo_.asCom.GetChild("n0").asLoader; image_photo_.touchable = false; content = this.GetChild("n5").asTextField; del = this.GetChild("n3").asButton; del.visible = false; image_ = this.GetChild("n4").asImage; bg = this.GetChild("n51").asImage; del.onClick.Add(() => { if (StatusCurr == 1) { ViewManager.inst.ShowAlert(Tools.GetMessageById("13161"), DelPhoto, true); } else { DelPhoto(1); } }); MoveStart(); image_photo_.onTouchBegin.Add(touchBegin); image_photo_.onTouchEnd.Add(touchEnd); image_photo_.onRollOut.Add(touchEnd); }
/// <summary>初始化 /// /// </summary> private void Awake() { GRoot.inst.SetContentScaleFactor(960, 540); UIPackage.AddPackage(MainMapUIPackage); UIPackage.AddPackage(CardCollectionPackage); UIPackage.AddPackage(CardIconPackage); UIPackage.AddPackage(LibraryPackage); mainmapUI = UIPackage.CreateObject("MainMapUI", "Component2").asCom; cardcollectUI = UIPackage.CreateObject("CardCollection", "CardBookMain").asCom; cardcollect_UI = new Window(); cardcollect_UI.contentPane = cardcollectUI; cardcollect_UI.CenterOn(GRoot.inst, true); libraryUI = UIPackage.CreateObject("Library", "LibraryMain").asCom; library_UI = new Window(); library_UI.contentPane = libraryUI; library_UI.CenterOn(GRoot.inst, true); verifyUI = UIPackage.CreateObject("Library", "verifyUI").asCom; verify_UI = new Window(); verify_UI.contentPane = verifyUI; verify_UI.CenterOn(GRoot.inst, true); GRoot.inst.AddChild(mainmapUI); #region 初始化按钮装载器文本等 ccbtn = mainmapUI.GetChild("CardCollectionBtn").asButton; ccbtn.onClick.Add(() => ShowCardCollect()); cardcollectionlist = cardcollectUI.GetChild("cardList").asList; onsalelist = libraryUI.GetChild("LibraryCardList").asList; _cardDisplayer = cardcollectUI.GetChild("cardDisplayer").asCom; _abstractText = _cardDisplayer.GetChild("abstractText").asTextField; _storyText = _cardDisplayer.GetChild("storyText").asTextField; _iconLoader = _cardDisplayer.GetChild("iconLoader").asLoader; _picLoader = _cardDisplayer.GetChild("cardPicLoader").asLoader; #endregion Debug.Log("ui初始化"); }
public void SetValue(int value) { this.value = value; if (value > max) { this.value = max; } GLoader img = null; for (int j = 0; j < list.Count; j++) { img = list [j]; if (j > this.value - 1) { img.url = Tools.GetResourceUrl("Image2:n_icon_chengjiu1_"); } else { if (j == value - 1) { img.scale = new Vector2(1.2f, 1f); img.TweenScale(new Vector2(0.8f, 1f), 0.1f).OnComplete(() => { img.TweenScale(new Vector2(1.1f, 1f), 0.1f).OnComplete(() => { img.TweenScale(new Vector2(1f, 1f), 0.1f); }); }); } img.url = Tools.GetResourceUrl("Image2:n_icon_chengjiu2_"); } } }
private void OnRender(int index, GObject item) { GComponent obj = item.asCom; GLoader icon = obj.GetChild("n2").asLoader; object[] value = (object[])loginType[index]; //object[] data = (object[])value[value["name"].ToString()]; icon.url = Tools.GetResourceUrl("Icon:" + value[1].ToString()); item.onClick.Add(() => { ViewManager.inst.CloseView(); switch (value[2].ToString()) { case "phone": ViewManager.inst.ShowView <MediatorChangeAccount2>(); break; case "weixin": //微信 Login(Ex_Local.LOGIN_TYPE_WEIXIN); break; case "weibo": //微博 break; case "qq": //qq Login(Ex_Local.LOGIN_TYPE_QQ); break; } }); }
public override void ConstructFromXML(XML xml) { base.ConstructFromXML(xml); img = (GLoader)this.GetChild("img"); txtValue = (GTextField)this.GetChild("txtValue"); }
public override void ConstructFromXML() { this.Owner = "FUI.Login"; m_Text_AccountLoginDetail = (GTextField)this.GetChild("Text_AccountLoginDetail"); m_Icon_Load_ALD = (GLoader)this.GetChild("Icon_Load_ALD"); }
public override void ConstructFromXML(XML xml) { base.ConstructFromXML(xml); m_ViewState = this.GetControllerAt(0); m_LoaderPupil = (GLoader)this.GetChildAt(3); }
void CreateCom() { GObject go = UIPackage.CreateObject("MainPack", "ImageExp"); if (go != null) { mShowImagetoUintyCom = go.asCom; GRoot.inst.AddChild(mShowImagetoUintyCom); mShowImagetoUintyCom.size = GRoot.inst.size; mShowImagetoUintyCom.Center(true); } else { Debug.LogError("创建对象失败"); } GMovieClip mv = mShowImagetoUintyCom.GetChild("n1").asMovieClip; mv.playing = false; GLoader load = mShowImagetoUintyCom.GetChild("gloader").asLoader; string url = UIPackage.GetItemURL("MainPack", "cd1_btn_normal"); //string url = "ui://MainPack/cd1_btn_normal"; load.url = url; //this.TestTextFieldAndInut(); }
public override void Init() { base.Init(); this.Create(Config.VIEW_EXPLOREBOX); exCfg = DataManager.inst.explore; curCfg = (Dictionary <string, object>)(((Dictionary <string, object>)exCfg ["box"]) [eid]); curReward = (Dictionary <string, object>)DataManager.inst.award [curCfg ["reward"].ToString()]; GTextField time = this.GetChild("n14").asTextField; GTextField gold = this.GetChild("n18").asTextField; GTextField cardNum = this.GetChild("n9").asTextField; lo1 = this.GetChild("n12").asLoader; lo2 = this.GetChild("n13").asLoader; tlo1 = this.GetChild("n10").asTextField; tlo2 = this.GetChild("n11").asTextField; long _time = (long)(Convert.ToSingle((int)curCfg ["time"]) * 10000000); time.text = Tools.TimeFormat2(_time, 1); float[] numArr = Tools.NumSection((object[])curReward ["gold"], MediatorEffortXX.curEffort); gold.text = Math.Floor(numArr [0]) + "-" + Math.Floor(numArr [1]); numArr = Tools.NumSection((object[])((Dictionary <string, object>)curReward ["card"])["num"], MediatorEffortXX.curEffort); cardNum.text = Math.Floor(numArr [0]) + ""; this.GetChild("n15").asTextField.text = Tools.GetMessageById("19017"); showCardBDNum(); }
public TipsData(GComponent game, GLoader lo, GTextField na, GTextField co) { taget = game; icon = lo; name = na; count = co; }
public override void ConstructFromXML(XML xml) { base.ConstructFromXML(xml); m_LoaderIcon = (GLoader)this.GetChildAt(1); m_LabelName = (GTextField)this.GetChildAt(2); }
public static GUITheme CreateDefaultGameTheme() { GUITheme theme = GUITheme.Basic; string guiPalette = "Textures/Gui/gui-palette.png"; theme.SetField("Button.NormalImage", new BorderedImage(GLoader.LoadTexture(guiPalette), new Rectangle(0, 0, 66, 66))); theme.SetField("Button.HoverImage", new BorderedImage(GLoader.LoadTexture(guiPalette), new Rectangle(66, 0, 66, 66))); theme.SetField("Button.ActiveImage", new BorderedImage(GLoader.LoadTexture(guiPalette), new Rectangle(132, 0, 66, 66))); theme.SetField("Button.ToggledImage", Image.CreateBlank(new Color(194, 37, 37))); theme.SetField("Button.TextColor", Color.White); theme.SetField("TextField.NormalImage", new BorderedImage(GLoader.LoadTexture(guiPalette), new Rectangle(0, 66, 66, 66))); theme.SetField("TextField.HoverImage", new BorderedImage(GLoader.LoadTexture(guiPalette), new Rectangle(66, 66, 66, 66))); theme.SetField("TextField.ActiveImage", new BorderedImage(GLoader.LoadTexture(guiPalette), new Rectangle(132, 66, 66, 66))); theme.SetField("Label.TextColor", Color.White); theme.SetField("Label.TextShadowColor", new Color(0, 0, 0, 0.6f)); theme.SetField("Frame.Image", Image.CreateBlank(new Color(30, 30, 30, 240))); theme.SetField("Window.BackgroundImage", Image.CreateBlank(new Color(30, 30, 30, 200))); theme.SetField("Window.TitleBar.BackgroundImage", Image.CreateBlank(new Color(31, 47, 70))); theme.SetField("Window.TitleBar.CloseButton.NormalImage", Image.CreateBlank(new Color(152, 34, 34))); theme.SetField("Window.TitleBar.CloseButton.HoverImage", Image.CreateBlank(new Color(135, 15, 15))); theme.SetField("Window.TitleBar.CloseButton.ActiveImage", Image.CreateBlank(new Color(188, 84, 84))); theme.SetField("SmallFont", LoadFont("arial-bold-12")); theme.SetField("Font", LoadFont("arial-14")); theme.SetField("BigFont", LoadFont("arial-18")); return(theme); }
public void Awake(GObject go) { if (go == null) { return; } GObject = go; if (string.IsNullOrWhiteSpace(Name)) { Name = Id.ToString(); } self = (GLabel)go; self.Add(this); var com = go.asCom; if (com != null) { n0 = (GImage)com.GetChildAt(0); title = (GTextField)com.GetChildAt(1); icon = (GLoader)com.GetChildAt(2); dragArea = (GGraph)com.GetChildAt(3); contentArea = (GGraph)com.GetChildAt(4); } }
//获取组件的方法 protected void GetFGUIComp() { Button_confirm = mainView.GetChild("Button_confirm").asButton; Button_back = mainView.GetChild("Button_back").asButton; List_friend = mainView.GetChild("List_friend").asList; Loader_head = mainView.GetChild("Loader_head").asLoader; }
public void OnSkillAttrChanged(VEntity target, Skill skill, Attr attr, object oldValue, object newValue) { if (target != VPlayer.instance) { return; } if (skill == VPlayer.instance.commonSkill) { return; } GComponent skillGrid = this.GetSkillGrid(skill.id); GLoader loader = skillGrid["n2"].asLoader; switch (attr) { case Attr.Lvl: case Attr.Cooldown: loader.grayed = skill.property.lvl < 0; loader.touchable = skill.CanUse(); if (skill.property.lvl < 0) { skillGrid["mask"].asImage.fillAmount = 0; } else { skillGrid["mask"].asImage.fillAmount = skill.cd <= 0 ? 0 : skill.property.cooldown / skill.cd; } break; } }
public void OnEntityCreated(VBio bio) { Skill[] skills = bio.skills; int count = bio.numSkills; for (int i = 1; i < count; i++) { Skill skill = skills[i]; GComponent skillGrid = this._skillGrids[i - 1]; skillGrid.data = skill.id; GLoader loader = skillGrid["n2"].asLoader; loader.url = skill.icon; loader.onClick.Add(this.OnSkillGridClick); GButton uButton = skillGrid["n5"].asButton; uButton.onClick.Add(this.OnSkillUpgradeBtnClick); loader.grayed = true; loader.touchable = false; skillGrid["mask"].asImage.fillAmount = 0; if (bio.property.skillPoint > 0) { skillGrid.GetController("c1").selectedIndex = 1; } } }
private void OnRander(int index, GObject obj) { GLoader n0 = obj.asCom.GetChild("n0").asLoader; GTextField n1 = obj.asCom.GetChild("n1").asTextField; GTextField n2 = obj.asCom.GetChild("n2").asTextField; GTextField n3 = obj.asCom.GetChild("n3").asTextField; if (canMoveItem) { obj.alpha = 0; obj.TweenFade(1f, (0.7f * (index + 1))); } else { obj.alpha = 1; } CardVo carda = DataManager.inst.GetCardVo(Cid, card.lv - 1); Dictionary <string, object> tipi = (Dictionary <string, object>)tips [uplist [index]]; n1.text = Tools.GetMessageById(((Dictionary <string, object>)sim [tipi ["type"].ToString()]) ["name"].ToString()) + ":"; string[] arr = MediatorItemShipInfo.TextFild(uplist [index], carda, null, null, true, false); n2.text = arr [0]; if (arr.Length != 1) { n3.text = arr [1]; } else { n3.text = ""; } n0.url = Tools.GetResourceUrl("Icon:" + ((Dictionary <string, object>)sim [tipi ["type"].ToString()]) ["icon"].ToString()); }
public HtmlImage() { loader = (GLoader)UIObjectFactory.NewObject("loader"); loader.gameObjectName = "HtmlImage"; loader.fill = FillType.ScaleFree; loader.touchable = false; }
// Use this for initialization void Start() { PlayerPrefs.DeleteAll(); UIPackage.AddPackage("FairyGUI/UIMain"); UIObjectFactory.SetPackageItemExtension("ui://UIMain/ClickShower", typeof(ShowClickMask)); hasSave = PlayerPrefs.GetInt("hasSave", 0); _main_menu = GetComponent <UIPanel> ().ui; _main_menu.GetController("c0").SetSelectedPage("unsave"); if (hasSave > 0) { _main_menu.GetController("c0").SetSelectedPage("save"); } _main_menu.GetChild("loadGame").onClick.Add(loadGame); _main_menu.GetChild("newGame").onClick.Add(newGame); _main_menu.GetChild("options").onClick.Add(options); _main_menu.GetChild("quit").onClick.Add(quit); //_main_menu.onClick.Add (OnClick); _main_menu.onClick.Add(OnClickShow); effect = _main_menu.GetChild("effect").asMovieClip; // ShowClickMask _maskLayer = (ShowClickMask)UIPackage.CreateObject ("UIMain", "ClickShower").asCom; // _maskLayer.SetSize(GRoot.inst.width, GRoot.inst.height); // _maskLayer.AddRelation(GRoot.inst, RelationType.Size); // // // // GRoot.inst.AddChild(_maskLayer); // _main_menu.AddChild (mask); // Debug.Log (_main_menu.numChildren); // Debug.Log (mask.position); _mask = _main_menu.GetChild("mask").asGraph; _newHeroPanel = _main_menu.GetChild("newHeroPanel").asCom; _info = _newHeroPanel.GetChild("info").asTextField; _desp = _newHeroPanel.GetChild("desp").asTextField; _start_game = _newHeroPanel.GetChild("startGame").asLoader; _start_game.onClick.Add(delegate(EventContext context) { PlayerData.getInstance().heroIdx = choosedHeroIdx; enterGame(); }); _hero_list = _newHeroPanel.GetChild("hero_list").asList; _hero_list.SetVirtualAndLoop(); _hero_list.itemRenderer = RenderHeroes; _hero_list.numItems = GameStaticData.getInstance().heroes.Count; _hero_list.scrollPane.onScroll.Add(doHeroScrollEffect); _hero_list.scrollPane.onScrollEnd.Add(changeHeroDetail); doHeroScrollEffect(); changeHeroDetail(); { _info.text = GameStaticData.getInstance().heroes[choosedHeroIdx].name; _desp.text = GameStaticData.getInstance().heroes [choosedHeroIdx].desp; } }
private void Update_headimg(string img) { // //lht这里需要判断平台的 账号是否绑定过了,是否能用平台账号绑定 // string param = ""; // switch (Type_Bingding) { // case Ex_Local.LOGIN_TYPE_QQ: // param = "openid=" + LocalStore.QQ_OPENID; // param += "|token=" + LocalStore.QQ_TOKEN; // param += "|data=" + LocalStore.QQ_DATE; // break; // case Ex_Local.LOGIN_TYPE_WEIXIN: // param = "openid=" + LocalStore.WX_OPENID; // param += "|token=" + LocalStore.WX_TOKEN; // param += "|data=" + ""; // break; // } // NetHttp.inst.Send(NetBase.HTTP_REGIST, param, (VoHttp v) => // { // Debug.Log(v.data); // if ((string)v.data != string.Empty) // { ViewManager.inst.ShowText(Tools.GetMessageById("13124")); //LocalStore.SetLocal(LocalStore.LOCAL_PWD, input_password.text); //LocalStore.SetLocal(LocalStore.LOCAL_TEL, input_phone.text); //userModel.tel = input_phone.text; //otherInfo["tel"] = input_phone.text; //LocalStore.DelUids(userModel.uid); //LocalStore.SetUids(userModel.uname, input_password.text, Ex_Local.LOGIN_TYPE_UNAME); //Dictionary<string, object> dc = new Dictionary<string, object>(); //dc.Add("value", ""); //dc.Add("tag", "account"); //DispatchGlobalEvent(new MainEvent(MainEvent.ROLE_UPDATE, dc)); //ViewManager.inst.CloseView(this); Dictionary <string, object> data = new Dictionary <string, object>(); data["head_key"] = img; NetHttp.inst.Send(NetBase.HTTP_CHOOSE_HEAD, data, (VoHttp vo) => { // userModel.type_login = Type_Bingding; userModel.UpdateData(vo.data); // // LocalStore.SetLocal(LocalStore.LOCAL_TYPE, userModel.type_login); // Dictionary <string, object> headIcon = (Dictionary <string, object>)userModel.head; head_Icon = head.GetChild("n0").asCom.GetChild("n0").asLoader; // head_Icon.url = ModelUser.GetHeadUrl(headIcon["use"].ToString()); Tools.SetLoaderButtonUrl(null, ModelUser.GetHeadUrl(headIcon["use"].ToString()), head_Icon); LocalStore.SetLocal(LocalStore.OTHER_HEADIMG + userModel.uid, LocalStore.GetLocal(LocalStore.OTHER_HEADIMG)); }); // } // }); // }
private void OnIconRender(int index, GObject item) { GLoader img_1 = item.asCom.GetChild("n0").asLoader; GLoader img_2 = item.asCom.GetChild("n1").asLoader; GLoader img_3 = item.asCom.GetChild("n2").asLoader; GTextField num = item.asCom.GetChild("n4").asTextField; Dictionary <string, object> dd = (Dictionary <string, object>)data[index]; if (dd["name"].Equals("body")) { } if (dd["name"].Equals("el_score")) { //img_1.url = Tools.GetResourceUrl("Image:" + "bg_kapai2"); img_2.url = Tools.GetResourceUrl("Image:" + "bg_baoxiang"); img_3.url = Tools.GetResourceUrl("Image:" + "icon_zs"); num.text = "战斗积分" + "X" + dd["el_score"]; } if (dd["name"].Equals("gold")) { //img_1.url = Tools.GetResourceUrl("Image:" + "bg_kapai2"); img_2.url = Tools.GetResourceUrl("Image:" + "bg_baoxiang"); img_3.url = Tools.GetResourceUrl("Image:" + "icon_zs"); num.text = "X" + dd["gold"]; } if (dd["name"].Equals("award")) { object[] r = (object[])dd["redbag3"]; //img_1.url = Tools.GetResourceUrl("Image:" + "bg_kapai2"); img_2.url = Tools.GetResourceUrl("Image:" + "bg_baoxiang"); img_3.url = Tools.GetResourceUrl("Image:" + r[1]); num.text = Tools.GetMessageById((string)r[0]); } if (dd["name"].Equals("exp")) { img_2.url = Tools.GetResourceUrl("Image:" + "bg_baoxiang2"); //img_3.url = Tools.GetResourceUrl("Image:" + "icon_xm"); num.text = "经验" + "X" + dd["exp"]; } if (dd["name"].Equals("coin")) { img_2.url = Tools.GetResourceUrl("Image:" + "bg_baoxiang2"); img_3.url = Tools.GetResourceUrl("Image:" + "icon_xm"); num.text = "X" + dd["coin"]; } if (dd["name"].Equals("redbag_coin")) { img_2.url = Tools.GetResourceUrl("Image:" + "bg_baoxiang2"); img_3.url = Tools.GetResourceUrl("Image:" + "icon_hongbaoquan"); num.text = "X" + dd["redbag_coin"]; } if (dd["name"].Equals("rank_score")) { img_2.url = Tools.GetResourceUrl("Image:" + "bg_baoxiang2"); img_3.url = Tools.GetResourceUrl("Image:" + "icon_xm"); num.text = "排位积分" + "X" + dd["rank_score"]; } }