public static void redoMapping(string device, string action, string cmd, int oldIndex, int newIndex) { ((ActionMap)"moveMap").bind(device, action, cmd); GuiTextListCtrl remapList = ((OptRemapInputCtrl)"OptRemapInputCtrl").findObjectByInternalName("OptRemapList", true); remapList.setRowById(oldIndex, OptionsDlg.buildFullMapString(oldIndex)); remapList.setRowById(newIndex, OptionsDlg.buildFullMapString(newIndex)); }
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 TerrainImportGui_TerrainMaterialApplyCallback(string mat, string matIndex) { // Skip over a bad selection. if (!mat.isObject()) { return; } GuiTextListCtrl opacityList = ((GuiControl)"TerrainImportGui").findObjectByInternalName("OpacityLayerTextList", true); string itemIdx = ((SimObject)"TerrainImportGui")["activeIdx"]; if (itemIdx.AsInt() < 0 || itemIdx == "") { return; } string rowTxt = opacityList.getRowTextById(itemIdx.AsInt()); int columTxtCount = omni.Util.getFieldCount(rowTxt); if (columTxtCount > 2) { rowTxt = omni.Util.getFields(rowTxt, 0, 1); } opacityList.setRowById(itemIdx.AsInt(), rowTxt + "\t" + ((SimObject)mat).internalName + "/t" + mat); }
public virtual void zeroScores() { GuiTextListCtrl PlayerListGuiList = "PlayerListGuiList"; for (int i = 0; i < PlayerListGuiList.rowCount(); i++) { string text = PlayerListGuiList.getRowText(i); text = Util.setField(text, 1, "0"); text = Util.setField(text, 2, "0"); text = Util.setField(text, 3, "0"); PlayerListGuiList.setRowById(PlayerListGuiList.getRowId(i), text); } PlayerListGuiList.clearSelection(); }
public virtual void updateScore(GameConnection clientId, int score, int kills, int deaths) { GuiTextListCtrl PlayerListGuiList = "PlayerListGuiList"; string text = PlayerListGuiList.getRowTextById(clientId); //Since I'm lazy and I don't feel like writing a csharp function... text = Util.setField(text, 1, score.AsString()); text = Util.setField(text, 2, kills.AsString()); text = Util.setField(text, 3, deaths.AsString()); PlayerListGuiList.setRowById(clientId, text); // Sorts by score PlayerListGuiList.sortNumerical(1, false); PlayerListGuiList.clearSelection(); }
public static void DbgWatchDialogAdd() { GuiTextEditCtrl WatchDialogExpression = "WatchDialogExpression"; GuiTextListCtrl DebuggerWatchView = "DebuggerWatchView"; TCPDebugger TCPDebugger = "TCPDebugger"; DebuggerWatchDlg DebuggerWatchDlg = "DebuggerWatchDlg"; GuiCanvas Canvas = "Canvas"; string expr = WatchDialogExpression.getValue(); if (expr != "") { DebuggerWatchView.setRowById(omni.iGlobal["$DbgWatchSeq"], expr + "\t(unknown)"); TCPDebugger.send("EVAL " + omni.iGlobal["$DbgWatchSeq"] + " 0 " + expr + "\r\n"); omni.iGlobal["$DbgWatchSeq"]++; } Canvas.popDialog(DebuggerWatchDlg); }
public void handleEvalOut(string line) { GuiTextCtrl DebuggerCursorWatch = "DebuggerCursorWatch"; GuiTextListCtrl DebuggerWatchView = "DebuggerWatchView"; int id = Util.firstWord(line).AsInt(); string value = Util.restWords(line); // See if it's the cursor watch, or from the watch window. if (id < 0) { DebuggerCursorWatch.setText(DebuggerCursorWatch["expr"] + ' ' + "=" + ' ' + value); } else { string row = DebuggerWatchView.getRowTextById(id); if (row == "") { return; } string expr = Util.getField(row, 0); DebuggerWatchView.setRowById(id, expr + "\t" + value); } }