Removed hard coded directory paths

- Removed references to core directory.
- Switch some references to tools directory
- Added preferences variables where appropriate
This commit is contained in:
DavidWyand-GG 2013-03-07 18:56:53 -05:00
parent 853b70255b
commit 4b1334db9f
25 changed files with 75 additions and 18 deletions

View file

@ -39,9 +39,9 @@ ConsoleDocClass( GuiSwatchButtonCtrl,
"A swatch button is a push button that uses its color field to designate the color drawn over an image, on top of a button.\n\n"
"The color itself is a float value stored inside the GuiSwatchButtonCtrl::color field. The texture path that represents\n"
"the image underlying the color is stored inside the GuiSwatchButtonCtrl::bitmap field.\n"
"the image underlying the color is stored inside the GuiSwatchButtonCtrl::gridBitmap field.\n"
"The default value assigned toGuiSwatchButtonCtrl::color is \"1 1 1 1\"( White ). The default/fallback image assigned to \n"
"GuiSwatchButtonCtrl::bitmap is \"core/art/gui/images/transp_grid\".\n\n"
"GuiSwatchButtonCtrl::gridBitmap is \"tools/gui/images/transp_grid\".\n\n"
"@tsexample\n"
"// Create a GuiSwatchButtonCtrl that calls randomFunction with its current color when clicked\n"
@ -65,11 +65,15 @@ GuiSwatchButtonCtrl::GuiSwatchButtonCtrl()
static StringTableEntry sProfile = StringTable->insert( "profile" );
setDataField( sProfile, NULL, "GuiInspectorSwatchButtonProfile" );
mGridBitmap = "tools/gui/images/transp_grid";
}
void GuiSwatchButtonCtrl::initPersistFields()
{
addField( "color", TypeColorF, Offset( mSwatchColor, GuiSwatchButtonCtrl ), "The foreground color of GuiSwatchButtonCtrl" );
addField( "gridBitmap", TypeString, Offset( mGridBitmap, GuiSwatchButtonCtrl ), "The bitmap used for the transparent grid" );
Parent::initPersistFields();
}
@ -80,7 +84,7 @@ bool GuiSwatchButtonCtrl::onWake()
return false;
if ( mGrid.isNull() )
mGrid.set( "core/art/gui/images/transp_grid", &GFXDefaultGUIProfile, avar("%s() - mGrid (line %d)", __FUNCTION__, __LINE__) );
mGrid.set( mGridBitmap, &GFXDefaultGUIProfile, avar("%s() - mGrid (line %d)", __FUNCTION__, __LINE__) );
return true;
}

View file

@ -41,6 +41,9 @@ class GuiSwatchButtonCtrl : public GuiButtonBaseCtrl
/// The color to display on the button.
ColorF mSwatchColor;
/// Bitmap used for mGrid
String mGridBitmap;
/// Background texture that will show through with transparent colors.
GFXTexHandle mGrid;

View file

@ -89,9 +89,6 @@ bool GuiGradientSwatchCtrl::onWake()
if ( !Parent::onWake() )
return false;
if ( mPointer.isNull() )
mPointer.set( "core/art/gui/images/arrowbtn_d", &GFXDefaultGUIProfile, avar("%s() - mGrid (line %d)", __FUNCTION__, __LINE__) );
char* altCommand = Con::getReturnBuffer(512);
dSprintf( altCommand, 512, "%s(%i.color, \"%i.setColor\");", mColorFunction, getId(), getId() );
setField( "altCommand", altCommand );

View file

@ -48,7 +48,6 @@ public:
void onRender(Point2I offset, const RectI &updateRect);
bool onWake();
protected:
GFXTexHandle mPointer;
StringTableEntry mColorFunction;
};
//----------------------------

View file

@ -1538,7 +1538,7 @@ GuiControl* GuiInspectorTypeBitMask32Helper::constructEditControl()
mButton->setField( "Command", szBuffer );
mButton->setField( "buttonType", "ToggleButton" );
mButton->setDataField( StringTable->insert("Profile"), NULL, "GuiInspectorButtonProfile" );
mButton->setBitmap( "core/art/gui/images/arrowBtn" );
mButton->setBitmap( "tools/gui/images/arrowBtn" );
mButton->setStateOn( true );
mButton->setExtent( 16, 16 );
mButton->registerObject();