public void addMissionFile(string file) { string levelName = Util.fileBase(file); string levelDesc = "A Torque Level"; string _LevelInfoObject = getLevelInfo(file); if (_LevelInfoObject != "0") { ScriptObject LevelInfoObject = _LevelInfoObject; if (LevelInfoObject["levelName"] != "") { levelName = LevelInfoObject["levelName"]; } else if (LevelInfoObject["name"] != "") { levelName = LevelInfoObject["name"]; } if (LevelInfoObject["desc0"] != "") { levelDesc = LevelInfoObject["desc0"]; } LevelInfoObject.delete(); } GuiTextListCtrl CL_levelList = "CL_levelList"; CL_levelList.addRow(CL_levelList.rowCount(), levelName + "\t" + file + "\t" + levelDesc, -1); }
public virtual void update(GameConnection clientId, string name, bool isSuperAdmin, bool isAdmin, bool isAI, int score, int kills, int deaths) { // Build the row to display. The name can have ML control tags, including // color and font. Since we're not using an ML control here, we need to // strip them off. string tag = isSuperAdmin ? "[Super]" : (isAdmin ? "[Admin]" : (isAI ? "[Bot]" : "")); string text = string.Format("{0} {1}\t{2}\t{3}\t{4}", Util.StripMLControlChars(name), tag, score, kills, deaths); // Update or add the player to the control GuiTextListCtrl PlayerListGuiList = "PlayerListGuiList"; if (clientId == -1) { PlayerListGuiList.addRow(clientId, text, -1); } else { PlayerListGuiList.setRowById(clientId, text); } // Sorts by score PlayerListGuiList.sortNumerical(1, false); PlayerListGuiList.clearSelection(); }
public static void TerrainImportGuiAddOpacityMap(string name) { // TODO: Need to actually look at // the file here and figure // out how many channels it has. string txt = omni.Util.makeRelativePath(name, omni.Util.getWorkingDirectory()); // Will need to do this stuff // once per channel in the file // currently it works with just grayscale. string channelsTxt = "R\tG\tB\tA"; string bitmapInfo = omni.Util.getBitmapInfo(name); string channelCount = omni.Util.getWord(bitmapInfo, 2); GuiTextListCtrl opacityList = ((GuiControl)"TerrainImportGui").findObjectByInternalName("OpacityLayerTextList", true); guiTerrainImportGui TerrainImportGui = "TerrainImportGui"; ArrayObject namesArray = TerrainImportGui["namesArray"]; ArrayObject channelsArray = TerrainImportGui["channelsArray"]; for (int i = 0; i < channelCount.AsInt(); i++) { namesArray.push_back(txt, name); channelsArray.push_back(txt, omni.Util.getWord(channelsTxt, i) + "/t" + channelCount); //TerrainImportGui.namesArray.echo(); int count = opacityList.rowCount(); opacityList.addRow(count, txt + "/t" + omni.Util.getWord(channelsTxt, i), -1); } //OpacityMapListBox.addItem( %name ); }
public static void ClientCmdGameEnd(string endgamepause) { audio.sfxStopAll(""); if (GuiCanvas.EditorIsActive() || GuiCanvas.GuiEditorIsActive()) { return; } // Copy the current scores from the player list into the // end game gui (bit of a hack for now). GuiTextListCtrl EndGameGuiList = "EndGameGuiList"; EndGameGuiList.clear(); GuiTextListCtrl PlayerListGuiList = "PlayerListGuiList"; for (int i = 0; i < PlayerListGuiList.rowCount(); i++) { string text = PlayerListGuiList.getRowText(i); string id = PlayerListGuiList.getRowId(i).AsString(); EndGameGuiList.addRow(id.AsInt(), text, -1); } EndGameGuiList.sortNumerical(1, false); ((GuiCanvas)"Canvas").setContent("EndGameGui"); if (endgamepause.AsInt() > 0) { omni.Util._schedule((endgamepause.AsInt() * 1000).AsString(), "0", "ShowLoading"); } }
public void update() { // Copy the servers into the server list. ((GuiWindowCtrl)"JS_queryStatus").setVisible(false); GuiTextListCtrl JS_serverList = "JS_serverList"; JS_serverList.clear(); int sc = Util.getServerCount(); for (int i = 0; i < sc; i++) { Util.setServerInfo((uint)i); JS_serverList.addRow(i, sGlobal["$ServerInfo::Name"] + '\t' + sGlobal["$ServerInfo::Ping"] + "\t" + sGlobal["$ServerInfo::PlayerCount"] + "/" + sGlobal["$ServerInfo::MaxPlayers"] + "/t" + sGlobal["$ServerInfo::Version"] + "\t" + sGlobal["$ServerInfo::MissionName"], -1); } JS_serverList.sort("0"); JS_serverList.setSelectedRow(0); JS_serverList.scrollVisible(0); ((GuiButtonCtrl)"JS_joinServer").setActive(JS_serverList.rowCount() > 0); }