void jGuiToolbar_PlayerList(jGuiToolbar tb)
    {
        jxE eChild = tb.m_jxE.GetChild(tb.GetToolBarIndex());

        string[] cmdList = (string[])eChild.GetUserData("PlayerCmd");
        SetPlayerCmdList(cmdList, tb.GetToolBarIndex());
    }
    //#--------------------------------------------------------------------------
    // public member function
    //#--------------------------------------------------------------------------
    public void Reload_PlayerCmd()
    {
        jGuiToolbar tb     = (jGuiToolbar)m_jGuiWindow.FindCtrl("PlayerList");
        jxE         eChild = tb.m_jxE.GetChild(tb.GetToolBarIndex());

        string[] cmdList = (string[])eChild.GetUserData("PlayerCmd");
        SetPlayerCmdList(cmdList, tb.GetToolBarIndex());
    }
Esempio n. 3
0
    void changeLogFilter(jGuiToolbar ctrl)
    {
        List <string> logList = m_jFilteredLog.ChangeLogFilter(ctrl.GetToolBarIndex());

        if (logList == null)
        {
            return;
        }
        refreshLog(logList);

        jxE eChild = ctrl.m_jxE.GetChild(ctrl.GetToolBarIndex());

        m_btn_ClearLog.SetText("Clear (" + eChild.Get_string() + ")");
    }
    //#--------------------------------------------------------------------------
    // jGui Event Handler
    //#--------------------------------------------------------------------------
    void OnLoadedGUI_CommandWindow(jGuiWindow win)    // "CommandWindow"라는 jGuiWindow 로딩이 완료되면 호출됨.
    {
        base.Set_jGuiWindow(win);

        m_scroll_CmdList = (jGuiScrollView)m_jGuiWindow.FindCtrl("CmdList");
        if (m_scroll_CmdList == null)
        {
            throw new System.Exception("CmdList(jGuiScrollView) not found");
        }

        m_txt_CommandLine = (jGuiTextField)m_jGuiWindow.FindCtrl("CommandLine");
        if (m_txt_CommandLine == null)
        {
            throw new System.Exception("CommandLine(jGuiTextField) not found");
        }

        //load_PlayerCmdFile();
        {
            string[]    cmdList;
            jGuiToolbar tb = (jGuiToolbar)m_jGuiWindow.FindCtrl("PlayerList");
            if (tb == null)
            {
                throw new System.Exception("PlayerList == null");
            }
            if (m_CMD == null)
            {
                throw new System.Exception("m_CMD == null");
            }

            foreach (jxE e in tb.m_jxE)
            {
                string fileText = m_CMD.m_PlayerCmdFile[e.GetOrder()].text_file.text;
                cmdList = fileText.Split('\n');
                e.SetUserData("PlayerCmd", cmdList);
            }

            int toolbarIndex = tb.GetToolBarIndex();
            m_CMD.Get_jPlayerPrefs().Get("PlayerList_TookBarIndex", ref toolbarIndex);
            tb.SetToolBarIndex(toolbarIndex);

            jxE eChild = tb.m_jxE.GetChild(tb.GetToolBarIndex());
            cmdList = (string[])eChild.GetUserData("PlayerCmd");
            SetPlayerCmdList(cmdList, tb.GetToolBarIndex());
        }

        this.SetWindowText(m_CMD.m_ServerName + " - " + m_CMD.m_ServerIP + ":" + m_CMD.m_ServerPort);
    }
    //#--------------------------------------------------------------------------
    // MonoBehaviour Event
    //#--------------------------------------------------------------------------
    void OnDestroy()
    {
        jGuiToolbar tb = (jGuiToolbar)m_jGuiWindow.FindCtrl("PlayerList");

        m_CMD.Get_jPlayerPrefs().Set("PlayerList_TookBarIndex", tb.GetToolBarIndex());
    }