コード例 #1
0
    public override void Init()
    {
        base.Init();
        this.Create(Config.VIEW_GUILDSEARCH);

        userModel = ModelManager.inst.userModel;

        simCfg            = DataManager.inst.systemSimple;
        btn_search        = this.GetChild("n2").asButton;
        btn_tuijian       = this.GetChild("n4").asButton;
        btn_sort          = this.GetChild("n3").asButton;
        L_Input           = this.GetChild("n0").asTextInput;
        list              = this.GetChild("n13").asList;
        bo_suozaidi       = this.GetChild("n16").asComboBox;
        L_NumericStepper0 = this.GetChild("n7") as ComNumeric;
        L_NumericStepper1 = this.GetChild("n8") as ComNumeric;
        L_NumericStepper2 = this.GetChild("n9") as ComNumeric;

        this.GetChild("n12").asGroup.visible = false;
        GButton b = this.GetChild("n11").asButton;

        b.text = Tools.GetMessageById("20140");
        b.onClick.Add(OnBtnSure);
        L_Input.text       = "";
        L_Input.promptText = Tools.GetMessageById("20116");
        list.itemRenderer  = ListRander;

        bg = this.GetChild("n14");
        BaseMediator.emptyBg = bg;
        list.emptyStr        = Tools.GetMessageById("19936");
        list.onChangeNum.Add(this.CheckListNum);
        list.SetVirtual();


        btn_search.text  = Tools.GetMessageById("20137");
        btn_sort.text    = Tools.GetMessageById("20138");
        btn_tuijian.text = Tools.GetMessageById("20139");
        this.GetChild("n5").asTextField.text  = Tools.GetMessageById("20141");
        this.GetChild("n10").asTextField.text = Tools.GetMessageById("20142");
        this.GetChild("n6").asTextField.text  = Tools.GetMessageById("20143");
        list.numItems = 0;

        btn_search.GetChild("n6").asLoader.url = Tools.GetResourceUrl("Image2:n_btn_7");
        btn_search.GetChild("title").asTextField.strokeColor = Tools.GetColor("486fcc");
//		btn_tuijian.GetChild ("n6").asLoader.url = Tools.GetResourceUrl("Image:btn_9");
//		btn_sort.GetChild ("n6").asLoader.url = Tools.GetResourceUrl("Image:btn_9");

        Dictionary <string, object> cc = (Dictionary <string, object>)(simCfg ["society_location"]);

        string[] str = new string[cc.Count];
        string[] va  = new string[cc.Count];
        int      ii  = 0;

        foreach (string i in cc.Keys)
        {
            str [ii] = Tools.GetMessageById(((object[])cc [i]) [1].ToString());
            va[ii]   = i;
            ii++;
        }
        bo_suozaidi.items  = str;
        bo_suozaidi.values = va;

        L_NumericStepper0.SetMinMax(0, 50, 10);
        L_NumericStepper1.SetMinMax(0, 50, 10);
        L_NumericStepper2.SetMinMax(0, 1000, 100);

        btn_search.onClick.Add(OnBtnSearchHandler);
        btn_tuijian.onClick.Add(OnBtnTuJianHandler);
        btn_sort.onClick.Add(OnBtnSortHandler);
        OnBtnTuJianHandler();
        this.AddGlobalListener(MainEvent.CHAT_GUILDJOIN, CHAT_GUILDJOIN);
    }
コード例 #2
0
    public override void Init()
    {
        base.Init();
        this.Create(Config.VIEW_GUILDSETUP, false, Tools.GetMessageById("19919"));

        Dictionary <string, object> data = (Dictionary <string, object>)(Tools.Clone(ModelManager.inst.guildModel.my_guild_info));

        cfg    = (Dictionary <string, object>)(DataManager.inst.guild["society"]);
        simCfg = DataManager.inst.systemSimple;

        btn_changeIcon = this.GetChild("n0").asButton;
        img_icon       = btn_changeIcon.GetChild("n0").asLoader;
        l_name         = this.GetChild("n3").asTextField;
        btn_changeName = this.GetChild("n4").asButton;
        btn_changeGG   = this.GetChild("n8").asButton;
        input_GG       = this.GetChild("n30").asTextInput;
        bo_suozaidi    = this.GetChild("n19").asComboBox;
        btn_changeGG2  = this.GetChild("n36").asButton;

        btn_openZD   = this.GetChild("n24").asButton;
        dro_level    = this.GetChild("n20") as ComNumeric;
        dro_achLevel = this.GetChild("n21") as ComNumeric;
        dro_rank     = this.GetChild("n22") as ComNumeric;

        this.GetChild("n2").asTextField.text  = Tools.GetMessageById("20129");
        this.GetChild("n18").asTextField.text = Tools.GetMessageById("20130");
        this.GetChild("n11").asTextField.text = Tools.GetMessageById("20145");
        this.GetChild("n15").asTextField.text = Tools.GetMessageById("20146");
        this.GetChild("n16").asTextField.text = Tools.GetMessageById("20147");
        this.GetChild("n17").asTextField.text = Tools.GetMessageById("20148");
        this.GetChild("n5").asTextField.text  = Tools.GetMessageById("20128");
        btn_changeGG.text  = Tools.GetMessageById("20128");
        btn_changeGG2.text = Tools.GetMessageById("20175");

        Dictionary <string, object> cc = (Dictionary <string, object>)(simCfg ["society_location"]);

        string[] str      = new string[cc.Count];
        string[] va       = new string[cc.Count];
        int      ii       = 0;
        int      nowIndex = 0;

        foreach (string i in cc.Keys)
        {
            if (i == ModelManager.inst.guildModel.location.ToString())
            {
                nowIndex = ii;
            }
            str [ii] = Tools.GetMessageById(((object[])cc [i]) [1].ToString());
            va[ii]   = i;
            ii++;
        }
        bo_suozaidi.items         = str;
        bo_suozaidi.values        = va;
        bo_suozaidi.selectedIndex = nowIndex;
        bo_suozaidi.onChanged.Add(BoSuozaidiChange);


        img_icon.url       = Tools.GetResourceUrl("Icon:" + (string)(data ["icon"]));
        icon               = (string)(data ["icon"]);
        l_name.text        = (string)(data ["name"]);
        input_GG.maxLength = (int)cfg ["society_notice"];
        input_GG.text      = (data ["content"]).ToString();
        contentText        = input_GG.text;
        this.GetChild("n7").asTextField.text = cfg ["name_change"].ToString();
        this.GetChild("n9").asTextField.text = Tools.GetMessageById("20144");
//		btn_changeName.SetText (Tools.GetMessageById("20113",new string[]{cfg ["name_change"].ToString()}));
//		l_name.onFocusIn.Add(OnNameFocusIn);
//		l_name.onClick.Add(OnNameFocusIn);
        input_GG.onChanged.Add(OnInputContentChange);
//		input_GG.onFocusIn.Add (OnInputFocusIn);
//		input_GG.onFocusOut.Add (OnInputFocusInOut);

        btn_changeName.onClick.Add(OnClickChangeName);
        btn_changeGG.onClick.Add(OnClickChangeGG);
        btn_changeGG2.onClick.Add(OnClickChangeGG2);
        btn_changeIcon.onClick.Add(OnClickChangeIcon);
        btn_openZD.onClick.Add(OnClickOpenZD);
        btn_changeGG.visible = false;



        attrs = (Dictionary <string, object>)((Dictionary <string, object>)data ["attrs"])["join_condition"];
        if (attrs.ContainsKey("lv") && attrs["lv"] != null)
        {
            level = attrs ["lv"].ToString();
        }
        if (attrs.ContainsKey("effort_lv") && attrs["effort_lv"] != null)
        {
            achlevel = attrs ["effort_lv"].ToString();
        }
        if (attrs.ContainsKey("rank_score") && attrs["rank_score"] != null)
        {
            rank = attrs ["rank_score"].ToString();
        }
        if (attrs.ContainsKey("type") && attrs["type"] != null)
        {
            type = attrs ["type"].ToString();
        }
        if (type == "1")
        {
            btn_openZD.GetChild("n6").asLoader.url       = Tools.GetResourceUrl("Image2:n_btn_17");
            this.GetChild("n25").asTextField.text        = Tools.GetMessageById("20111");
            this.GetChild("n25").asTextField.strokeColor = Tools.GetColor("52b04f");
//			btn_openZD.SetText ();
        }
        else
        {
//			btn_openZD.SetText (Tools.GetMessageById("20110"));
            btn_openZD.GetChild("n6").asLoader.url       = Tools.GetResourceUrl("Image2:n_btn_16");
            this.GetChild("n25").asTextField.text        = Tools.GetMessageById("20110");
            this.GetChild("n25").asTextField.strokeColor = Tools.GetColor("d7734d");
        }
        droDownInit();

        dro_level.OnChange    = DroLevelChange;
        dro_achLevel.OnChange = DroAchLevelChange;
        dro_rank.OnChange     = DroRankChange;

        this.AddGlobalListener(MainEvent.CHANGE_GUILD_ICON, OnChangeIconHandler);
        this.AddGlobalListener(MainEvent.CHANGE_GUILD_NAME, OnChangeNameHandler);
    }