public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { ///Debug.Log("load : jGuiScrollView : " + g.GetTagName()); base.Load(stage, win, parent, g, overrideAttribute); jxA a; if (!m_isLayouted) { a = g.AttrVar("ViewRect"); if (a == null) { throw new System.Exception(this.ToString() + " must has ViewRect attribute"); } if (a.IsEType(nXML.EDataType.e_Rect) == false) { throw new System.Exception(this.ToString() + " is not e_Rect type"); } m_ViewRect = a.GetRect(); } a = g.AttrVar("AutoScroll"); if (a != null) { m_isAutoScroll = a.Get_bool(); } }
public Rect GetGuiRect(jxE g) { jxV vRect = g.AttrVar("Rect"); if (vRect == null) { vRect = g.AttrVar("Name"); } if (vRect == null) { //jDebug.jWARN(" attribute not found Rect : " + g.GetTagName()); return(new Rect(0, 0, 0, 0)); } if (vRect.GetEType() == nXML.EDataType.e_Rect) { return(vRect.GetRect()); } if (vRect.GetEType() != nXML.EDataType.e_string) { throw new System.Exception("xml : vRect.GetEType() != nXML.EDataType.e_string : " + m_Doc.m_name); } jxE eRect = m_eNamedRect.Find(vRect.Get_string()); if (eRect == null) { throw new System.Exception(m_Doc.m_name + " eRect==null"); } return(eRect.GetRect()); }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { base.Load(stage, win, parent, g, overrideAttribute); m_vMask = g.AttrVar("Mask"); if (m_vMask == null) { throw new System.Exception(ToString() + " has not Mask attribute"); } m_vMaxLength = g.AttrVar("MaxLength"); if (m_vMaxLength == null) { throw new System.Exception(ToString() + " has not i_MaxLength attribute"); } }
void jGuiButton_ServerOk(jGuiButton ctrl) { var lbl = (jGuiControl)ctrl.GetParent().FindCtrl("ServerStatus"); if (lbl.GetText().Contains("Offline")) { return; } m_jGuiStage.HideModalWindow(); int iOrder = ctrl.GetParent().m_jxE.GetOrder(); jxE eServerList = m_CMD.GetCurrServerList(); if (iOrder >= eServerList.size()) { m_CMD.LogWarning("ctrl.m_jxE.GetOrder() is overflow : " + iOrder + "eServerList.size() = " + eServerList.size()); return; } jxE server = eServerList.GetChild(iOrder); m_CMD.m_ServerIP = server.Attr("IP"); m_CMD.m_ServerName = server.Attr("NAME"); m_CMD.m_ServerPort = server.AttrVar("PORT").Get_int(); //Debug.Log("ip : " + m_CMD.m_ServerIP + " " + m_CMD.m_ServerPort + " " + m_CMD.m_ServerName); var c = GetComponent <GuiEvent_CommandWindow>(); c.Reload_PlayerCmd(); GuiEvent_CommandWindow cmdWin = GetComponent <GuiEvent_CommandWindow>(); cmdWin.SetWindowText(m_CMD.m_ServerName + " - " + m_CMD.m_ServerIP + ":" + m_CMD.m_ServerPort); }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { base.Load(stage, win, parent, g, overrideAttribute); m_ToggleValue = g.AttrVar("ToggleValue"); if (m_ToggleValue == null) { throw new System.Exception("jGuiToggle : attribute b_ToggleValue is null"); } }
//#-------------------------------------------------------------------------- public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) //#-------------------------------------------------------------------------- { base.Load(stage, this, parent, g, overrideAttribute); m_vDragWindow = g.AttrVar("DragWindow"); jxV v = g.AttrVar("IsScalable"); if (v != null && v.Get_bool()) { m_EScaleState = EScaleState.eREADY; m_rectScaleBox.x = m_Rect.x + m_Rect.width - fTOGGLEBOX_OFFSET; m_rectScaleBox.y = m_Rect.y + m_Rect.height; m_rectScaleBox.width = fSCALE_BOX_WIDTH; m_rectScaleBox.height = fSCALE_BOX_HEIGT; } m_jGuiStage.CallEventHandler_jGuiWindow("OnLoadedGUI_" + GetName(), this); }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { m_isLayouted = true; // only GUILayout mode ! base.Load(stage, win, parent, g, overrideAttribute); if (g.AttrVar("Rect") == null) { throw new System.Exception(g.GetTagName() + " : need r_Rect=..."); } }
//#-------------------------------------------------------------------------- // protectec member function //#-------------------------------------------------------------------------- //#-------------------------------------------------------------------------- // private member function //#-------------------------------------------------------------------------- //#-------------------------------------------------------------------------- // jGuiControl Event function //#-------------------------------------------------------------------------- public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { base.Load(stage, win, parent, g, overrideAttribute); m_vColumn = g.AttrVar("Column"); if (m_vColumn == null) { throw new System.Exception(ToString() + " has not i_Column attribute"); } ReloadGridString(); }
public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { base.Load(stage, win, parent, g, overrideAttribute); jxV v = g.AttrVar("MaxLength"); if (v != null) { m_iMaxLength = v.Get_int(); } if (m_Text == null) { throw new System.Exception(g.GetTagName() + "' Text is not found "); } v = g.AttrVar("ReadOnly"); if (v != null) { m_bReadOnly = v.Get_bool(); } }
//#-------------------------------------------------------------------------- // member function //#-------------------------------------------------------------------------- public jxV AttrVarOverride(string attribute_name) { jxA v = m_jxE.AttrVar(attribute_name); if (v != null || m_OverrideAttribute == null) { return(v); } jxE e = m_OverrideAttribute.Find(m_jxE.GetTagID(), 1); if (e == null) { return(null); } //Debug.Log(e.GetTagName() + " : OverrideAttribute : " + attribute_name); return(e.AttrVar(attribute_name)); }
//#-------------------------------------------------------------------------- // private member function //#-------------------------------------------------------------------------- void AddPlayerCmd(string cmd, int idx) { // 맨처음 노드는 cmd용 original 탬플릿이다. jxE eCmdGroup; bool isReloadGui = false; if (idx >= m_scroll_CmdList.m_jxE.size()) { eCmdGroup = m_scroll_CmdList.m_jxE.begin().MakeClone(); m_scroll_CmdList.m_jxE.InsertChild(eCmdGroup); isReloadGui = true; } else { eCmdGroup = m_scroll_CmdList.m_jxE.GetChild(idx); } eCmdGroup.AttrVar("Enable").Set_bool(true); jxA a; jxE eCmdText = eCmdGroup.FindByAttr("Name", "CmdRun", out a); a = eCmdText.AttrVar("Text"); a.Set_string(cmd); if (isReloadGui) { // jGuiContorl 리로딩. jGuiControl ctrl = m_scroll_CmdList.GetStage().CreateRTTI(eCmdGroup); jDebug.jASSERT(ctrl != null); ctrl.m_isLayouted = m_scroll_CmdList.m_isLayouted; ctrl.Load(m_scroll_CmdList.GetStage() , m_scroll_CmdList.GetWindow() , m_scroll_CmdList , eCmdGroup , m_scroll_CmdList.Get_OverrideAttribute()); } else { jGuiButton btn = (jGuiButton)eCmdText.m_UserData; btn.SetText(cmd); } }
protected void loadDefaultParam(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute) { m_OverrideAttribute = g.Find("OverrideAttribute", 1); if (m_OverrideAttribute == null) { m_OverrideAttribute = overrideAttribute; } m_TextAnchor.t1 = false; m_jxE = g; m_jGuiStage = stage; m_jGuiParent = parent; m_Enable = m_jxE.AttrVar("Enable"); m_Text = AttrOverride("Text"); m_Name = m_jxE.Attr("Name"); if (m_Text == null) { m_Text = m_Name; } load_GUIStyle(); }
IEnumerator _gettering_server_state() { jxE eServerList = m_CMD.GetCurrServerList(); int idx = 0; foreach (jGuiControl gui in m_guiServerList) { var lbl = (jGuiLabel)gui.FindCtrl("ServerStatus"); if (lbl == null) { continue; } jxE server = eServerList.GetChild(idx); bool isOk = tryConnectToServer(server.Attr("IP"), server.AttrVar("PORT").Get_int()); if (isOk) { lbl.SetText("Online"); } else { lbl.SetText("Offline"); } if (m_CMD.m_ServerName == server.Attr("Name")) { lbl.SetText("[" + lbl.GetText() + "]"); } ++idx; //yield return new WaitForSeconds(1.0f); yield return(0); } m_jGuiWindow.SetText("Select Server : Status update Completed."); }
void OnShowModal_ServerList(jGuiWindow win) // "ServerList"라는 모달 { jxE eServerList = m_CMD.GetCurrServerList(); if (eServerList == null) { m_CMD.LogWarning(m_CMD.m_DefaultServerListName + " is not found in ServerList xml"); return; } int iSize = eServerList.size() - m_guiServerList.m_jxE.size(); if (iSize > 0) // 다운로드 받은 서버리스트 보다 gui xml의 서버리스트 컨트롤이 적다면 컨트롤 추가. { for (int i = 0; i < iSize; ++i) { jxE eServer = m_guiServerList.m_jxE.begin().MakeClone(); m_guiServerList.m_jxE.InsertChild(eServer); // jGuiContorl 리로딩. jGuiControl new_ctrl = m_guiServerList.GetStage().CreateRTTI(eServer); if (new_ctrl == null) { eServer.DebugPrint(); throw new System.Exception("CreateRTTI : new_ctrl==null"); } new_ctrl.m_isLayouted = m_guiServerList.m_isLayouted; new_ctrl.Load(m_guiServerList.GetStage() , m_guiServerList.GetWindow() , m_guiServerList , eServer , m_guiServerList.Get_OverrideAttribute()); } } int idx = 0; foreach (jGuiControl gui in m_guiServerList) { if (idx >= eServerList.size()) { gui.SetEnabled(false); continue; } var btn = (jGuiButton)gui.FindCtrl("ServerOk"); jxE server = eServerList.GetChild(idx); string name = server.Attr("NAME"); string text = name + " " + server.Attr("IP") + ":" + server.AttrVar("PORT").Get_int().ToString(); var lbl = (jGuiLabel)gui.FindCtrl("ServerStatus"); if (name == m_CMD.m_ServerName) { lbl.SetText("Selected"); } else { lbl.SetText("Unkown"); } btn.SetText(text); ++idx; } UpdateServerStatus(); }