Game Development Community

GuiInspector and hard coded paths..

by Gregory "Centove" McLean · in Torque Game Engine · 10/23/2005 (3:06 pm) · 3 replies

Not critical/crash causing but annoying just the same.

around line 1138 in engine/gui/editor/guiInspector.cc
GuiButtonCtrl * delButt = new GuiBitmapButtonCtrl();
   if( delButt != NULL )
   {
      dSprintf(szBuffer, 512, "%d.%s = \"\";%d.inspect(%d);", mTarget->getId(), getFieldName(), mParent->getContentCtrl()->getId(), mTarget->getId());
      delButt->setField("Bitmap", "common/ui/inspector_delete");

Can we please stop this?

Proposed fix:
GuiButtonCtrl * delButt = new GuiBitmapButtonCtrl();
   if( delButt != NULL )
   {
      dSprintf(szBuffer, 512, "%d.%s = \"\";%d.inspect(%d);", mTarget->getId(), getFieldName(), mParent->getContentCtrl()->getId(), mTarget->getId());
      delButt->setField("profile", "GuiInspectorDeleteButtonProfile");

Then in the defaultProfiles.cs (or wherever you deal with this type of stuff)
if (!isObject(GuiInspectorDeleteButtonProfile))
  new GuiControlProfile(GuiInspectorDeleteButtonProfile : GuiButtonProfile)
{
  bitmap =  "~/some/wacky/path/to/the/button/for/the/control/inspector_delete";
};

Now everyone should be happy, people in the garage can lay things out the way they see fit.
I can lay the directories out how I see fit
Others can use whatever layout makes sense to them without these little things buried in the engine to frustrate you.

#1
10/23/2005 (4:22 pm)
You got me there Gregory. Sorry about the inconvenience it's caused you, but atleast you've learned that the best way to get it fixed is to fix it yourself and post it on the forums!

I'll forward this to ben.

-j

As a small aside, I must admit, it's nice when bug reports on your code are things like this, makes me feel all warm and fuzzy knowing that my code only barely sucks. :)
#2
10/24/2005 (5:16 am)
@Justin,
I didn't mean to imply your code sucks, just an annoyance when merging away from the garage games layout of things.
#3
10/24/2005 (9:05 am)
Gregory,
No worries mate, I didn't take any offense to your comment, I said my code barely sucks and it was in jest at that :)

Thanks again for the fix!

-j