static int GetLastLevel(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 0); uint o = LoginIDManager.GetLastLevel(); LuaScriptMgr.Push(L, o); return(1); }
public void SetLastLoginInfo(List <ServerListInfo> serverLis) { uint lastServerId = LoginIDManager.GetPlatServerID(); string lastServer = LoginIDManager.GetPlatServerName(); uint lastServerLevel = LoginIDManager.GetLastLevel(); //uint lastServerLoad = LoginIDManager.GetServerState(); Debug.Log("lastServerId = " + lastServerId); Debug.Log("lastServer = " + lastServer); Debug.Log("lastServerLevel = " + lastServerLevel); if (lastServerId > 0) { ServerListInfo lastInfo = serverLis.Find((ServerListInfo info) => { return(info.server_id == lastServerId); }); if (lastInfo != null) { lastServerArea.text = string.Format(CommonFunction.GetConstString("LOGIN_SEVER_AREA"), lastInfo.display_server_id); } } else { NGUITools.SetActive(lastServerArea.gameObject, false); NGUITools.SetActive(lastServerName.gameObject, false); NGUITools.SetActive(lastLevel.gameObject, false); NGUITools.SetActive(lastLoad.gameObject, false); } if (lastServer != null && lastServer != "") { lastServerName.text = lastServer; } if (lastServerLevel > 0) { lastLevel.text = CommonFunction.GetConstString("UI_HALL_LEVEL_1") + lastServerLevel.ToString(); } //if (currentLoadState == (uint)ServerState.SS_BUSY) //{ // lastLoad.spriteName = "login_login_Orange"; //} //else if (currentLoadState == (uint)ServerState.SS_CLOSE) //{ // lastLoad.spriteName = "login_login_Gray"; //} //else if (currentLoadState == (uint)ServerState.SS_FULL) //{ // lastLoad.spriteName = "login_login_Red"; //} //else if (currentLoadState == (uint)ServerState.SS_IDLE) //{ // lastLoad.spriteName = "login_login_Green"; //} //else // NGUITools.SetActive(lastLoad.gameObject, false); }
public void RefreshServerList(GameObject go) { GameObject childGo = null; for (int i = 0; i < leftGrid.transform.childCount; i++) { childGo = leftGrid.transform.GetChild(i).gameObject; if (go == childGo) { childGo.transform.FindChild("Sele").GetComponent <UISprite>().spriteName = "login_yellow5"; while (rightGrid.transform.childCount > 0) { NGUITools.Destroy(rightGrid.transform.GetChild(0).gameObject); } for (int j = 0; j < eachGroupList[i].Count; j++) { GameObject serverItem = CommonFunction.InstantiateObject("Prefab/GUI/ServerItem", rightGrid.transform); GameObject level = serverItem.transform.FindChild("Level").gameObject; MultiLabel levelText = level.transform.FindChild("Text").GetComponent <MultiLabel>(); MultiLabel serverID = serverItem.transform.FindChild("Server").GetComponent <MultiLabel>(); MultiLabel serverName = serverItem.transform.FindChild("Name").GetComponent <MultiLabel>(); UISprite serverIcon = serverItem.transform.FindChild("Icon").GetComponent <UISprite>(); UISprite backShade = serverItem.transform.FindChild("BackShade").GetComponent <UISprite>(); serverItem.name = eachGroupList[i][j].server_name; serverID.SetText(string.Format(CommonFunction.GetConstString("LOGIN_SEVER_AREA"), eachGroupList[i][j].display_server_id)); serverName.SetText(eachGroupList[i][j].server_name); if (eachGroupList[i][j].name == null || eachGroupList[i][j].name == "") { NGUITools.SetActive(level, false); } else { levelText.SetText(CommonFunction.GetConstString("UI_HALL_LEVEL_1") + eachGroupList[i][j].level.ToString()); if (eachGroupList[i][j].server_name == LoginIDManager.GetPlatServerName()) { NGUITools.SetActive(backShade.gameObject, true); if (eachGroupList[i][j].level != LoginIDManager.GetLastLevel()) { lastLevel.text = CommonFunction.GetConstString("UI_HALL_LEVEL_1") + eachGroupList[i][j].level.ToString(); } } } uint state = eachGroupList[i][j].load; if (state == (uint)ServerState.SS_BUSY) { serverIcon.spriteName = "login_login_Orange"; } else if (state == (uint)ServerState.SS_CLOSE) { serverIcon.spriteName = "login_login_Gray"; } else if (state == (uint)ServerState.SS_FULL) { serverIcon.spriteName = "login_login_Red"; } else if (state == (uint)ServerState.SS_IDLE) { serverIcon.spriteName = "login_login_Green"; } if (eachGroupList[i][j].server_name == LoginIDManager.GetPlatServerName()) { lastLoad.spriteName = serverIcon.spriteName; } UIEventListener.Get(serverItem).onClick = OnChooseServer; } } } rightGrid.repositionNow = true; rightGrid.Reposition(); }