Game Development Community

dev|Pro Game Development Curriculum

GuiEditor improvement: display SimID & ClassName of selected object

by Orion Elenzil · 02/07/2008 (2:56 pm) · 1 comments

This is based on a TGE 1.3.5 - based codebase, and honestly it might need some tweaking to match TG* 1.*,
or heck, it might even be already implented in those.

GuiEditorGui.gui
right after the control GuiEditorInspectName, add this:
new GuiControl   (GuiEditorGeneralInfoContainer) {
   		      position = "0 18";
               extent      = "140 16";
				   horizSizing = "width";
				   vertSizing  = "bottom";
				   
				   new GuiMLTextCtrl (GuiEditorGeneralInfoMLText) {
                  position    = "4 3";
				      extent      = "140 16";
				      horizSizing = "width";
				      vertSizing  = "bottom";
				      text        = "howdy!";
				   };
            };

there is a GuiScrollControl right after that,
move it's position from "0 24" to "0 35":
position = "0 35";

at the bottom of GuiEditorTreeView::onSelect(), add:
GuiEditor.updateGeneralInfo(%obj);


at the bottom of GuiEditor::onSelect(), add:
GuiEditor.updateGeneralInfo(%ctrl);

after the function GuiEditor::onSelect(), add:
function GuiEditor::updateGeneralInfo(%this, %ctrl)
{
   %text    = "<color:886644><linkcolor:775533><linkcolorhl:ddff00>";
   %text    = %text @ "<just:left>"  @ "<a:gamelink COPYTOCLIP " @ %ctrl.getId  ()      @ ">" @ %ctrl.getId       () @ "</a>";
   %text    = %text @ " - "          @ "<a:gamelink COPYTOCLIP " @ %ctrl.getClassName() @ ">" @ %ctrl.getClassName() @ "</a>";

   GuiEditorGeneralInfoMLText.setText(%text);
}

function GuiEditorGeneralInfoMLText::onURL(%this, %url)
{
   %cmd       = getWord (%url, 1);
   %restWords = getWords(%url, 2, 10000);
   switch$ (%cmd)
   {
      case "COPYTOCLIP":
         setClipboard(%restWords);
   }
}

#1
02/07/2008 (7:05 pm)
No, it isnt implemented yet. Very useful indeed, as the majority of the times I have to play with the camera to see the simIDs as they overlap each other. I even tought once on do this, but was on the "oh yeah, crap, when I will finally do this?" list.

Thanks Orion.

Edit: now I just have to remember myself to implement the resource...