|
@@ -43,16 +43,16 @@ GuiParticleGraphCtrl::GuiParticleGraphCtrl()
|
|
|
|
|
|
for(S32 i = 0; i < MaxPlots; i++)
|
|
|
{
|
|
|
- mPlots[i].mGraphColor = ColorF(1.0, 1.0, 1.0);
|
|
|
- VECTOR_SET_ASSOCIATION(mPlots[i].mGraphData);
|
|
|
- mPlots[i].mGraphMax.x = 1;
|
|
|
- mPlots[i].mGraphMax.y = 50;
|
|
|
- mPlots[i].mGraphMin.x = 0;
|
|
|
- mPlots[i].mGraphMin.y = 0;
|
|
|
- mPlots[i].mGraphType = Polyline;
|
|
|
- mPlots[i].mGraphName = StringTable->insert("");
|
|
|
- mPlots[i].mHidden = false;
|
|
|
- mPlots[i].mGraphScale = 0.05f;
|
|
|
+ mPlots[i].mGraphColor = ColorF(1.0, 1.0, 1.0);
|
|
|
+ VECTOR_SET_ASSOCIATION(mPlots[i].mGraphData);
|
|
|
+ mPlots[i].mGraphMax.x = 1;
|
|
|
+ mPlots[i].mGraphMax.y = 50;
|
|
|
+ mPlots[i].mGraphMin.x = 0;
|
|
|
+ mPlots[i].mGraphMin.y = 0;
|
|
|
+ mPlots[i].mGraphType = Polyline;
|
|
|
+ mPlots[i].mGraphName = StringTable->insert("");
|
|
|
+ mPlots[i].mHidden = false;
|
|
|
+ mPlots[i].mGraphScale = 0.05f;
|
|
|
}
|
|
|
|
|
|
mPlots[0].mGraphColor = ColorF(1.0f, 0.2f, 0.2f);
|
|
@@ -127,87 +127,87 @@ void GuiParticleGraphCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|
|
// Fetch Draw Utility.
|
|
|
GFXDrawUtil* pDrawUtil = GFX->getDrawUtil();
|
|
|
|
|
|
- if (mProfile->mBorder)
|
|
|
- {
|
|
|
- const RectI bounds = getBounds();
|
|
|
- RectI rect(offset.x, offset.y, bounds.extent.x, bounds.extent.y);
|
|
|
- pDrawUtil->drawRect(rect, mProfile->mBorderColor);
|
|
|
- }
|
|
|
+ if (mProfile->mBorder)
|
|
|
+ {
|
|
|
+ const RectI bounds = getBounds();
|
|
|
+ RectI rect(offset.x, offset.y, bounds.extent.x, bounds.extent.y);
|
|
|
+ pDrawUtil->drawRect(rect, mProfile->mBorderColor);
|
|
|
+ }
|
|
|
|
|
|
GuiControlProfile* profile = dynamic_cast<GuiControlProfile*>(Sim::findObject("GuiDefaultProfile"));
|
|
|
Resource<GFont> font = profile->mFont;
|
|
|
- GFXVideoMode videoMode = GFXInit::getDesktopResolution();
|
|
|
+ GFXVideoMode videoMode = GFXInit::getDesktopResolution();
|
|
|
|
|
|
- ColorF color(1.0f, 1.0f, 1.0f, 0.5f);
|
|
|
- pDrawUtil->drawRectFill(updateRect, color);
|
|
|
+ ColorF color(1.0f, 1.0f, 1.0f, 0.5f);
|
|
|
+ pDrawUtil->drawRectFill(updateRect, color);
|
|
|
|
|
|
- for (S32 k = 0; k < MaxPlots; k++)
|
|
|
- {
|
|
|
- // Nothing to graph
|
|
|
- if ((mPlots[k].mGraphData.size() == 0) || (mPlots[k].mHidden == true))
|
|
|
- continue;
|
|
|
-
|
|
|
+ for (S32 k = 0; k < MaxPlots; k++)
|
|
|
+ {
|
|
|
+ // Nothing to graph
|
|
|
+ if ((mPlots[k].mGraphData.size() == 0) || (mPlots[k].mHidden == true))
|
|
|
+ continue;
|
|
|
+
|
|
|
Point2F graphExtent = getGraphExtent(k);
|
|
|
|
|
|
- // Adjust scale to max value + 5% so we can see high value
|
|
|
- F32 ScaleX = (F32(getExtent().x) / (graphExtent.x*(1.00 + (mPlots[k].mGraphScale))));
|
|
|
- F32 ScaleY = (F32(getExtent().y) / (graphExtent.y*(1.00 + (mPlots[k].mGraphScale))));
|
|
|
+ // Adjust scale to max value + 5% so we can see high value
|
|
|
+ F32 ScaleX = (F32(getExtent().x) / (graphExtent.x*(1.00 + (mPlots[k].mGraphScale))));
|
|
|
+ F32 ScaleY = (F32(getExtent().y) / (graphExtent.y*(1.00 + (mPlots[k].mGraphScale))));
|
|
|
|
|
|
- if((mPlots[k].mGraphType == Point) || (mPlots[k].mGraphType == Polyline))
|
|
|
- {
|
|
|
+ if((mPlots[k].mGraphType == Point) || (mPlots[k].mGraphType == Polyline))
|
|
|
+ {
|
|
|
S32 posX;
|
|
|
- S32 posY;
|
|
|
- S32 lastPosX = 0;
|
|
|
- S32 lastPosY = 0;
|
|
|
- Point2F plotPoint;
|
|
|
+ S32 posY;
|
|
|
+ S32 lastPosX = 0;
|
|
|
+ S32 lastPosY = 0;
|
|
|
+ Point2F plotPoint;
|
|
|
|
|
|
- S32 size = 32;
|
|
|
+ S32 size = 32;
|
|
|
|
|
|
- for (S32 sample = 0; sample < mPlots[k].mGraphData.size(); sample++)
|
|
|
- {
|
|
|
- S32 temp;
|
|
|
+ for (S32 sample = 0; sample < mPlots[k].mGraphData.size(); sample++)
|
|
|
+ {
|
|
|
+ S32 temp;
|
|
|
|
|
|
- temp = (S32)(((F32)getExtent().x / (F32)mPlots[k].mGraphData.size()) * (F32)sample);
|
|
|
+ temp = (S32)(((F32)getExtent().x / (F32)mPlots[k].mGraphData.size()) * (F32)sample);
|
|
|
|
|
|
- // calculate the point positions
|
|
|
+ // calculate the point positions
|
|
|
plotPoint = getPlotPoint(k, sample);
|
|
|
|
|
|
- posX = (S32)((plotPoint.x - mPlots[k].mGraphMin.x) * (ScaleX /(1.00 + mPlots[k].mGraphScale)));
|
|
|
- posY = (getExtent().y) - (S32)((plotPoint.y - mPlots[k].mGraphMin.y) * ScaleY);
|
|
|
+ posX = (S32)((plotPoint.x - mPlots[k].mGraphMin.x) * (ScaleX /(1.00 + mPlots[k].mGraphScale)));
|
|
|
+ posY = (getExtent().y) - (S32)((plotPoint.y - mPlots[k].mGraphMin.y) * ScaleY);
|
|
|
|
|
|
posX += getExtent().x * (mPlots[k].mGraphScale);
|
|
|
- posY /= (1.00 + (mPlots[k].mGraphScale));
|
|
|
+ posY /= (1.00 + (mPlots[k].mGraphScale));
|
|
|
|
|
|
posX = localToGlobalCoord(Point2I(posX, posY)).x;
|
|
|
- posY = localToGlobalCoord(Point2I(posX, posY)).y;
|
|
|
+ posY = localToGlobalCoord(Point2I(posX, posY)).y;
|
|
|
|
|
|
- // check if this isn't our first loop through, if it is we won't have starting points
|
|
|
+ // check if this isn't our first loop through, if it is we won't have starting points
|
|
|
if(sample > 0)
|
|
|
- {
|
|
|
- pDrawUtil->drawLine( lastPosX, lastPosY , posX, posY , mPlots[k].mGraphColor );
|
|
|
- } else
|
|
|
- {
|
|
|
+ {
|
|
|
+ pDrawUtil->drawLine( lastPosX, lastPosY , posX, posY , mPlots[k].mGraphColor );
|
|
|
+ } else
|
|
|
+ {
|
|
|
mPlots[k].mNutList.clear();
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
mPlots[k].mNutList.push_back( Point2F(posX, posY) );
|
|
|
|
|
|
- // store the last positions to be the starting points drawn into a line next loop
|
|
|
- lastPosX = posX;
|
|
|
- lastPosY = posY;
|
|
|
+ // store the last positions to be the starting points drawn into a line next loop
|
|
|
+ lastPosX = posX;
|
|
|
+ lastPosY = posY;
|
|
|
|
|
|
//Con::printf("red %f green %f blue %f", mPlots[k].mGraphColor.red, mPlots[k].mGraphColor.green, mPlots[k].mGraphColor.blue);
|
|
|
|
|
|
|
|
|
|
|
|
- if(mSelectedPoint != -1)
|
|
|
- {
|
|
|
- mLastSelectedPoint = mSelectedPoint;
|
|
|
- }
|
|
|
+ if(mSelectedPoint != -1)
|
|
|
+ {
|
|
|
+ mLastSelectedPoint = mSelectedPoint;
|
|
|
+ }
|
|
|
|
|
|
ColorI nutColor (mPlots[k].mGraphColor);
|
|
|
|
|
|
- if(k == mSelectedPlot && sample == mLastSelectedPoint)
|
|
|
+ if(k == mSelectedPlot && sample == mLastSelectedPoint)
|
|
|
{
|
|
|
// grab the colors for the nut
|
|
|
F32 red = mPlots[k].mGraphColor.red;
|
|
@@ -224,51 +224,51 @@ void GuiParticleGraphCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|
|
}
|
|
|
|
|
|
// draw the seleciton nut
|
|
|
- drawNut( Point2I(posX, posY), 3, mOutlineColor, nutColor );
|
|
|
+ drawNut( Point2I(posX, posY), 3, mOutlineColor, nutColor );
|
|
|
|
|
|
- if((mLastSelectedPoint != -1) || (mRenderAllPoints == true))
|
|
|
- {
|
|
|
+ if((mLastSelectedPoint != -1) || (mRenderAllPoints == true))
|
|
|
+ {
|
|
|
if((k == mSelectedPlot && sample == mLastSelectedPoint) || (mRenderAllPoints == true))
|
|
|
- {
|
|
|
+ {
|
|
|
char number[32];
|
|
|
|
|
|
- Point2I comparePos = localToGlobalCoord(Point2I(getPosition().x, getPosition().y));
|
|
|
+ Point2I comparePos = localToGlobalCoord(Point2I(getPosition().x, getPosition().y));
|
|
|
|
|
|
dSprintf(number, 32, "%4.3f %4.3f", plotPoint.x, plotPoint.y);
|
|
|
|
|
|
S32 textWidth = (S32)font->getStrWidth((const UTF8*)number);;
|
|
|
- textWidth /= 2;
|
|
|
+ textWidth /= 2;
|
|
|
|
|
|
- if((((S32)posX - (textWidth/2)) < comparePos.x) || (((S32)posX - textWidth) <= 0))
|
|
|
- {
|
|
|
+ if((((S32)posX - (textWidth/2)) < comparePos.x) || (((S32)posX - textWidth) <= 0))
|
|
|
+ {
|
|
|
posX += (textWidth/1.5);
|
|
|
- } else if((posX + (textWidth * 1.8)) > (comparePos.x + getExtent().x) || ((posX + textWidth) >= videoMode.resolution.x))
|
|
|
- {
|
|
|
+ } else if((posX + (textWidth * 1.8)) > (comparePos.x + getExtent().x) || ((posX + textWidth) >= videoMode.resolution.x))
|
|
|
+ {
|
|
|
posX -= (textWidth * 1.5);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- if((((S32)posY) < comparePos.y) || (((S32)posY - textWidth) <= 0))
|
|
|
- {
|
|
|
+ if((((S32)posY) < comparePos.y) || (((S32)posY - textWidth) <= 0))
|
|
|
+ {
|
|
|
posY += 40;
|
|
|
- }
|
|
|
-
|
|
|
- pDrawUtil->setBitmapModulation( profile->mFontColor );
|
|
|
- pDrawUtil->drawText( font, Point2I(posX, posY + 5) - Point2I(size >> 1, size), number );
|
|
|
- pDrawUtil->clearBitmapModulation();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(mRenderNextGraphTooltip == true && mRenderGraphTooltip == true)
|
|
|
- {
|
|
|
+ }
|
|
|
+
|
|
|
+ pDrawUtil->setBitmapModulation( profile->mFontColor );
|
|
|
+ pDrawUtil->drawText( font, Point2I(posX, posY + 5) - Point2I(size >> 1, size), number );
|
|
|
+ pDrawUtil->clearBitmapModulation();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(mRenderNextGraphTooltip == true && mRenderGraphTooltip == true)
|
|
|
+ {
|
|
|
char argBuffer[1][32];
|
|
|
|
|
|
dSprintf(argBuffer[0], 32, "%s", getGraphName(mTooltipSelectedPlot));
|
|
|
|
|
|
- renderGraphTooltip(mCursorPos, argBuffer[0]);
|
|
|
- }
|
|
|
+ renderGraphTooltip(mCursorPos, argBuffer[0]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
S32 GuiParticleGraphCtrl::addPlotPoint(S32 plotID, Point2F v, bool setAdded)
|
|
@@ -302,44 +302,44 @@ S32 GuiParticleGraphCtrl::addPlotPoint(S32 plotID, Point2F v, bool setAdded)
|
|
|
|
|
|
for(S32 i = 0; i < mPlots[plotID].mGraphData.size(); i++)
|
|
|
{
|
|
|
- if(mFabs(v.x - mPlots[plotID].mGraphData[i].x) < 0.001)
|
|
|
- {
|
|
|
- if(mAutoRemove == true)
|
|
|
- {
|
|
|
+ if(mFabs(v.x - mPlots[plotID].mGraphData[i].x) < 0.001)
|
|
|
+ {
|
|
|
+ if(mAutoRemove == true)
|
|
|
+ {
|
|
|
changePlotPoint(plotID, i, v);
|
|
|
- plotChanged = true;
|
|
|
- mPlotIndex = i;
|
|
|
- } else
|
|
|
- {
|
|
|
+ plotChanged = true;
|
|
|
+ mPlotIndex = i;
|
|
|
+ } else
|
|
|
+ {
|
|
|
mPlotIndex = -1;
|
|
|
- }
|
|
|
-
|
|
|
- plotAdded = true;
|
|
|
-
|
|
|
- break;
|
|
|
- } else if(v.x < mPlots[plotID].mGraphData[i].x)
|
|
|
- {
|
|
|
+ }
|
|
|
+
|
|
|
+ plotAdded = true;
|
|
|
+
|
|
|
+ break;
|
|
|
+ } else if(v.x < mPlots[plotID].mGraphData[i].x)
|
|
|
+ {
|
|
|
insertPlotPoint(plotID, i, v);
|
|
|
- plotAdded = true;
|
|
|
- mPlotIndex = i;
|
|
|
- break;
|
|
|
- }
|
|
|
+ plotAdded = true;
|
|
|
+ mPlotIndex = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if(plotAdded == false)
|
|
|
{
|
|
|
- mPlots[plotID].mGraphData.push_back( v );
|
|
|
- mPlotIndex = mPlots[plotID].mGraphData.size() - 1;
|
|
|
+ mPlots[plotID].mGraphData.push_back( v );
|
|
|
+ mPlotIndex = mPlots[plotID].mGraphData.size() - 1;
|
|
|
}
|
|
|
|
|
|
if(mAutoMax == true)
|
|
|
{
|
|
|
// Keep record of maximum data value for scaling purposes.
|
|
|
if(v.y > mPlots[plotID].mGraphMax.y)
|
|
|
- mPlots[plotID].mGraphMax.y = v.y;
|
|
|
+ mPlots[plotID].mGraphMax.y = v.y;
|
|
|
|
|
|
if(v.x > mPlots[plotID].mGraphMax.x)
|
|
|
- mPlots[plotID].mGraphMax.x = v.x;
|
|
|
+ mPlots[plotID].mGraphMax.x = v.x;
|
|
|
}
|
|
|
|
|
|
if(plotChanged == true)
|
|
@@ -348,8 +348,8 @@ S32 GuiParticleGraphCtrl::addPlotPoint(S32 plotID, Point2F v, bool setAdded)
|
|
|
} else if(mPlotIndex != -1 && setAdded)
|
|
|
{
|
|
|
mPointWasAdded = true;
|
|
|
- mAddedPoint = v;
|
|
|
- mAddedPointIndex = mPlotIndex;
|
|
|
+ mAddedPoint = v;
|
|
|
+ mAddedPointIndex = mPlotIndex;
|
|
|
}
|
|
|
|
|
|
return mPlotIndex;
|
|
@@ -367,10 +367,10 @@ void GuiParticleGraphCtrl::insertPlotPoint(S32 plotID, S32 i, Point2F v)
|
|
|
{
|
|
|
// Keep record of maximum data value for scaling purposes.
|
|
|
if(v.y > mPlots[plotID].mGraphMax.y)
|
|
|
- mPlots[plotID].mGraphMax.y = v.y;
|
|
|
+ mPlots[plotID].mGraphMax.y = v.y;
|
|
|
|
|
|
if(v.x > mPlots[plotID].mGraphMax.x)
|
|
|
- mPlots[plotID].mGraphMax.x = v.x;
|
|
|
+ mPlots[plotID].mGraphMax.x = v.x;
|
|
|
}
|
|
|
|
|
|
// Argument Buffer.
|
|
@@ -477,7 +477,7 @@ S32 GuiParticleGraphCtrl::getPlotIndex(S32 plotID, F32 x, F32 y)
|
|
|
compareY = mPlots[plotID].mGraphData[i].y;
|
|
|
|
|
|
//
|
|
|
- //if((x == compareX) && (y == compareY))
|
|
|
+ //if((x == compareX) && (y == compareY))
|
|
|
if((mFabs(x - compareX) < 0.001) && (mFabs(y - compareY) < 0.001))
|
|
|
return i;
|
|
|
}
|
|
@@ -487,16 +487,16 @@ S32 GuiParticleGraphCtrl::getPlotIndex(S32 plotID, F32 x, F32 y)
|
|
|
|
|
|
void GuiParticleGraphCtrl::setGraphType(S32 plotID, const char *graphType)
|
|
|
{
|
|
|
- AssertFatal(plotID > -1 && plotID < MaxPlots, "Invalid plot specified!");
|
|
|
- if(!dStricmp(graphType,"Bar"))
|
|
|
- mPlots[plotID].mGraphType = Bar;
|
|
|
- else if(!dStricmp(graphType,"Filled"))
|
|
|
- mPlots[plotID].mGraphType = Filled;
|
|
|
- else if(!dStricmp(graphType,"Point"))
|
|
|
- mPlots[plotID].mGraphType = Point;
|
|
|
- else if(!dStricmp(graphType,"Polyline"))
|
|
|
- mPlots[plotID].mGraphType = Polyline;
|
|
|
- else AssertWarn(true, "Invalid graph type!");
|
|
|
+ AssertFatal(plotID > -1 && plotID < MaxPlots, "Invalid plot specified!");
|
|
|
+ if(!dStricmp(graphType,"Bar"))
|
|
|
+ mPlots[plotID].mGraphType = Bar;
|
|
|
+ else if(!dStricmp(graphType,"Filled"))
|
|
|
+ mPlots[plotID].mGraphType = Filled;
|
|
|
+ else if(!dStricmp(graphType,"Point"))
|
|
|
+ mPlots[plotID].mGraphType = Point;
|
|
|
+ else if(!dStricmp(graphType,"Polyline"))
|
|
|
+ mPlots[plotID].mGraphType = Polyline;
|
|
|
+ else AssertWarn(true, "Invalid graph type!");
|
|
|
}
|
|
|
|
|
|
void GuiParticleGraphCtrl::setSelectedPlot(S32 plotID)
|
|
@@ -565,8 +565,8 @@ void GuiParticleGraphCtrl::setRenderGraphTooltip(bool renderGraphTooltip)
|
|
|
|
|
|
void GuiParticleGraphCtrl::drawNut(const Point2I &nut, S32 size, ColorI &outlineColor, ColorI &nutColor)
|
|
|
{
|
|
|
- // Fetch Draw Utility.
|
|
|
- GFXDrawUtil* pDrawUtil = GFX->getDrawUtil();
|
|
|
+ // Fetch Draw Utility.
|
|
|
+ GFXDrawUtil* pDrawUtil = GFX->getDrawUtil();
|
|
|
|
|
|
//Con::printf("r %d g %d b %d", nutColor.red, nutColor.green, nutColor.blue);
|
|
|
S32 NUT_SIZE = size;
|
|
@@ -588,17 +588,17 @@ Point2I GuiParticleGraphCtrl::findHitNut( Point2I hitPoint )
|
|
|
{
|
|
|
for(S32 i = 0; i < MaxPlots; i++)
|
|
|
{
|
|
|
- if ( (mPlots[i].mGraphData.size() == 0) || (mPlots[i].mHidden == true))
|
|
|
+ if ( (mPlots[i].mGraphData.size() == 0) || (mPlots[i].mHidden == true))
|
|
|
continue;
|
|
|
|
|
|
for (S32 j = 0 ; j < mPlots[i].mNutList.size(); j++ )
|
|
|
{
|
|
|
- if( inNut (Point2I( mPlots[i].mNutList[j].x, mPlots[i].mNutList[j].y), hitPoint.x, hitPoint.y) )
|
|
|
- {
|
|
|
+ if( inNut (Point2I( mPlots[i].mNutList[j].x, mPlots[i].mNutList[j].y), hitPoint.x, hitPoint.y) )
|
|
|
+ {
|
|
|
mTooltipSelectedPlot = i;
|
|
|
- return Point2I(i,j);
|
|
|
- }
|
|
|
- }
|
|
|
+ return Point2I(i,j);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return Point2I(-1,-1);
|
|
@@ -718,7 +718,7 @@ StringTableEntry GuiParticleGraphCtrl::getGraphName(S32 plotID)
|
|
|
void GuiParticleGraphCtrl::onMouseMove(const GuiEvent &event)
|
|
|
{
|
|
|
mCursorPos = event.mousePoint;
|
|
|
-
|
|
|
+
|
|
|
Point2I hitNut = findHitNut(event.mousePoint);
|
|
|
|
|
|
if( hitNut != Point2I(-1,-1) )
|
|
@@ -745,8 +745,8 @@ void GuiParticleGraphCtrl::onMouseDown(const GuiEvent &event)
|
|
|
|
|
|
if( hitNut != Point2I(-1,-1) )
|
|
|
{
|
|
|
- if(event.mouseClickCount == 2)
|
|
|
- {
|
|
|
+ if(event.mouseClickCount == 2)
|
|
|
+ {
|
|
|
Point2F plotPoint = getPlotPoint(hitNut.x, hitNut.y);
|
|
|
S32 point = removePlotPoint(hitNut.x, hitNut.y);
|
|
|
|
|
@@ -755,31 +755,31 @@ void GuiParticleGraphCtrl::onMouseDown(const GuiEvent &event)
|
|
|
|
|
|
dSprintf(argBuffer[0], 32, "%d", mSelectedPlot);
|
|
|
dSprintf(argBuffer[1], 32, "%d", point);
|
|
|
- dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y);
|
|
|
+ dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y);
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
// Call Scripts.
|
|
|
Con::executef(this, "onPlotPointRemoved", argBuffer[0], argBuffer[1], argBuffer[2]);
|
|
|
- } else
|
|
|
- {
|
|
|
- setSelectedPlot(hitNut.x);
|
|
|
+ } else
|
|
|
+ {
|
|
|
+ setSelectedPlot(hitNut.x);
|
|
|
setSelectedPoint(hitNut.y);
|
|
|
- mOriginalSelectedPoint = hitNut.y;
|
|
|
+ mOriginalSelectedPoint = hitNut.y;
|
|
|
|
|
|
- char argBuffer[32];
|
|
|
+ char argBuffer[32];
|
|
|
|
|
|
dSprintf(argBuffer, 32, "%d", hitNut.y);
|
|
|
|
|
|
// Call Scripts.
|
|
|
Con::executef(this, "onPlotPointSelectedMouseDown", argBuffer);
|
|
|
- }
|
|
|
+ }
|
|
|
} else if( mSelectedPlot != -1 )
|
|
|
{
|
|
|
- Point2F mousePos = convertToGraphCoord(mSelectedPlot, event.mousePoint);
|
|
|
- mLastSelectedPoint = addPlotPoint(mSelectedPlot, mousePos);
|
|
|
+ Point2F mousePos = convertToGraphCoord(mSelectedPlot, event.mousePoint);
|
|
|
+ mLastSelectedPoint = addPlotPoint(mSelectedPlot, mousePos);
|
|
|
|
|
|
- // Argument Buffer.
|
|
|
+ // Argument Buffer.
|
|
|
char argBuffer[32];
|
|
|
|
|
|
dSprintf(argBuffer, 32, "%f %f", convertToGraphCoord(mSelectedPlot, event.mousePoint).x, convertToGraphCoord(mSelectedPlot, event.mousePoint).y);
|
|
@@ -787,41 +787,41 @@ void GuiParticleGraphCtrl::onMouseDown(const GuiEvent &event)
|
|
|
// Call Scripts.
|
|
|
Con::executef(this, "onMouseDragged", argBuffer);
|
|
|
|
|
|
- return;
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void GuiParticleGraphCtrl::onMouseUp(const GuiEvent &event)
|
|
|
{
|
|
|
if(mSelectedPoint != -1)
|
|
|
- mLastSelectedPoint = mSelectedPoint;
|
|
|
+ mLastSelectedPoint = mSelectedPoint;
|
|
|
|
|
|
if(mPointWasAdded == true)
|
|
|
{
|
|
|
if(mSelectedPoint == -1)
|
|
|
- {
|
|
|
- // Argument Buffer.
|
|
|
+ {
|
|
|
+ // Argument Buffer.
|
|
|
char argBuffer[3][32];
|
|
|
|
|
|
dSprintf(argBuffer[0], 32, "%d", mSelectedPlot);
|
|
|
dSprintf(argBuffer[1], 32, "%f %f", mAddedPoint.x, mAddedPoint.y);
|
|
|
- dSprintf(argBuffer[2], 32, "%d", mAddedPointIndex);
|
|
|
+ dSprintf(argBuffer[2], 32, "%d", mAddedPointIndex);
|
|
|
|
|
|
// Call Scripts.
|
|
|
Con::executef(this, "onPlotPointAdded", argBuffer[0], argBuffer[1], argBuffer[2]);
|
|
|
- } else
|
|
|
- {
|
|
|
+ } else
|
|
|
+ {
|
|
|
// Argument Buffer.
|
|
|
char argBuffer[4][32];
|
|
|
|
|
|
dSprintf(argBuffer[0], 32, "%d", mSelectedPlot);
|
|
|
dSprintf(argBuffer[1], 32, "%f %f", mAddedPoint.x, mAddedPoint.y);
|
|
|
- dSprintf(argBuffer[2], 32, "%d", mOriginalSelectedPoint);
|
|
|
- dSprintf(argBuffer[3], 32, "%d", mAddedPointIndex);
|
|
|
+ dSprintf(argBuffer[2], 32, "%d", mOriginalSelectedPoint);
|
|
|
+ dSprintf(argBuffer[3], 32, "%d", mAddedPointIndex);
|
|
|
|
|
|
// Call Scripts.
|
|
|
Con::executef(this, "onPlotPointChangedUp", argBuffer[0], argBuffer[1], argBuffer[2], argBuffer[3]);
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
mPointWasAdded = false;
|
|
@@ -835,37 +835,37 @@ void GuiParticleGraphCtrl::onMouseDragged(const GuiEvent &event)
|
|
|
|
|
|
if(mSelectedPoint != -1)
|
|
|
{
|
|
|
- Point2F mousePos = convertToGraphCoord(mSelectedPlot, event.mousePoint);
|
|
|
+ Point2F mousePos = convertToGraphCoord(mSelectedPlot, event.mousePoint);
|
|
|
|
|
|
if(mPointXMovementClamped == true)
|
|
|
- {
|
|
|
+ {
|
|
|
F32 prevXPos = getPlotPoint(mSelectedPlot, mSelectedPoint).x;
|
|
|
- if(mousePos.x != prevXPos)
|
|
|
- {
|
|
|
- mousePos.x = prevXPos;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- removePlotPoint(mSelectedPlot, mSelectedPoint);
|
|
|
- S32 point = addPlotPoint(mSelectedPlot, mousePos);
|
|
|
+ if(mousePos.x != prevXPos)
|
|
|
+ {
|
|
|
+ mousePos.x = prevXPos;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ removePlotPoint(mSelectedPlot, mSelectedPoint);
|
|
|
+ S32 point = addPlotPoint(mSelectedPlot, mousePos);
|
|
|
if(point != -1)
|
|
|
- {
|
|
|
+ {
|
|
|
setSelectedPoint(point);
|
|
|
- mLastMousePos = mousePos;
|
|
|
+ mLastMousePos = mousePos;
|
|
|
|
|
|
// Argument Buffer.
|
|
|
char argBuffer[3][32];
|
|
|
|
|
|
dSprintf(argBuffer[0], 32, "%d", mSelectedPlot);
|
|
|
dSprintf(argBuffer[1], 32, "%f %f", mAddedPoint.x, mAddedPoint.y);
|
|
|
- dSprintf(argBuffer[2], 32, "%d", point);
|
|
|
+ dSprintf(argBuffer[2], 32, "%d", point);
|
|
|
|
|
|
// Call Scripts.
|
|
|
Con::executef(this, "onPlotPointChangedMove", argBuffer[0], argBuffer[1], argBuffer[2]);
|
|
|
- } else
|
|
|
- {
|
|
|
+ } else
|
|
|
+ {
|
|
|
point = addPlotPoint(mSelectedPlot, mLastMousePos);
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Argument Buffer.
|
|
@@ -891,7 +891,7 @@ void GuiParticleGraphCtrl::onRightMouseDown(const GuiEvent &event)
|
|
|
|
|
|
dSprintf(argBuffer[0], 32, "%d", mSelectedPlot);
|
|
|
dSprintf(argBuffer[1], 32, "%d", point);
|
|
|
- dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y);
|
|
|
+ dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y);
|
|
|
|
|
|
// Call Scripts.
|
|
|
Con::executef(this, "onPlotPointRemoved", argBuffer[0], argBuffer[1], argBuffer[2]);
|
|
@@ -912,12 +912,12 @@ void GuiParticleGraphCtrl::onRightMouseDragged(const GuiEvent &event)
|
|
|
Point2F plotPoint = getPlotPoint(hitNut.x, hitNut.y);
|
|
|
S32 point = removePlotPoint(hitNut.x, hitNut.y);
|
|
|
|
|
|
- // Argument Buffer.
|
|
|
+ // Argument Buffer.
|
|
|
char argBuffer[3][32];
|
|
|
|
|
|
dSprintf(argBuffer[0], 32, "%d", mSelectedPlot);
|
|
|
dSprintf(argBuffer[1], 32, "%d", point);
|
|
|
- dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y);
|
|
|
+ dSprintf(argBuffer[2], 32, "%f %f", plotPoint.x, plotPoint.y);
|
|
|
|
|
|
// Call Scripts.
|
|
|
Con::executef(this, "onPlotPointRemoved", argBuffer[0], argBuffer[1], argBuffer[2]);
|
|
@@ -987,12 +987,12 @@ bool GuiParticleGraphCtrl::renderGraphTooltip(Point2I cursorPos, StringTableEntr
|
|
|
RectI rect(offset, textBounds);
|
|
|
GFX->setClipRect(rect);
|
|
|
|
|
|
- // Fetch Draw Utility.
|
|
|
- GFXDrawUtil* pDrawUtil = GFX->getDrawUtil();
|
|
|
+ // Fetch Draw Utility.
|
|
|
+ GFXDrawUtil* pDrawUtil = GFX->getDrawUtil();
|
|
|
|
|
|
// Draw Filler bit, then border on top of that
|
|
|
- pDrawUtil->drawRectFill(rect, ColorI(mTooltipProfile->mFillColor.red, mTooltipProfile->mFillColor.green, mTooltipProfile->mFillColor.blue, 200) );
|
|
|
- pDrawUtil->drawRect( rect, mTooltipProfile->mBorderColor );
|
|
|
+ pDrawUtil->drawRectFill(rect, ColorI(mTooltipProfile->mFillColor.red, mTooltipProfile->mFillColor.green, mTooltipProfile->mFillColor.blue, 200) );
|
|
|
+ pDrawUtil->drawRect( rect, mTooltipProfile->mBorderColor );
|
|
|
|
|
|
// Draw the text centered in the tool tip box
|
|
|
pDrawUtil->setBitmapModulation( mTooltipProfile->mFontColor );
|
|
@@ -1006,102 +1006,102 @@ bool GuiParticleGraphCtrl::renderGraphTooltip(Point2I cursorPos, StringTableEntr
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPoint, void, (S32 point), , "(int point)"
|
|
|
"Set the selected point on the graph.\n"
|
|
|
- "@return No return value")
|
|
|
+ "@return No return value")
|
|
|
{
|
|
|
if(point >= object->mPlots[object->mSelectedPlot].mGraphData.size() || point < 0)
|
|
|
{
|
|
|
- Con::errorf("Invalid point to select.");
|
|
|
- return;
|
|
|
+ Con::errorf("Invalid point to select.");
|
|
|
+ return;
|
|
|
}
|
|
|
object->setSelectedPoint( point );
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setSelectedPlot, void, (S32 plotID), , "(int plotID)"
|
|
|
"Set the selected plot (a.k.a. graph)."
|
|
|
- "@return No return value" )
|
|
|
+ "@return No return value" )
|
|
|
{
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return;
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return;
|
|
|
}
|
|
|
object->setSelectedPlot( plotID );
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, clearGraph, void, (S32 plotID), , "(int plotID)"
|
|
|
"Clear the graph of the given plot."
|
|
|
- "@return No return value")
|
|
|
+ "@return No return value")
|
|
|
{
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return;
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return;
|
|
|
}
|
|
|
object->clearGraph( plotID );
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, clearAllGraphs, void, (), , "()"
|
|
|
"Clear all of the graphs."
|
|
|
- "@return No return value")
|
|
|
+ "@return No return value")
|
|
|
{
|
|
|
object->clearAllGraphs();
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, addPlotPoint, S32, (S32 plotID, F32 x, F32 y, bool setAdded), (true), "(int plotID, float x, float y, bool setAdded = true;)"
|
|
|
"Add a data point to the given plot."
|
|
|
- "@return")
|
|
|
+ "@return")
|
|
|
{
|
|
|
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return -2;
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return -2;
|
|
|
}
|
|
|
return object->addPlotPoint( plotID, Point2F(x, y), setAdded);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, insertPlotPoint, void, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)\n"
|
|
|
"Insert a data point to the given plot and plot position.\n"
|
|
|
- "@param plotID The plot you want to access\n"
|
|
|
- "@param i The data point.\n"
|
|
|
- "@param x,y The plot position.\n"
|
|
|
- "@return No return value.")
|
|
|
+ "@param plotID The plot you want to access\n"
|
|
|
+ "@param i The data point.\n"
|
|
|
+ "@param x,y The plot position.\n"
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return;
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return;
|
|
|
}
|
|
|
object->insertPlotPoint( plotID, i, Point2F(x, y));
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, changePlotPoint, S32, (S32 plotID, S32 i, F32 x, F32 y), , "(int plotID, int i, float x, float y)"
|
|
|
"Change a data point to the given plot and plot position.\n"
|
|
|
- "@param plotID The plot you want to access\n"
|
|
|
- "@param i The data point.\n"
|
|
|
- "@param x,y The plot position.\n"
|
|
|
- "@return No return value.")
|
|
|
+ "@param plotID The plot you want to access\n"
|
|
|
+ "@param i The data point.\n"
|
|
|
+ "@param x,y The plot position.\n"
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return -1;
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return -1;
|
|
|
}
|
|
|
return object->changePlotPoint( plotID, i, Point2F(x, y));
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, getSelectedPlot, S32, (), , "() "
|
|
|
"Gets the selected Plot (a.k.a. graph).\n"
|
|
|
- "@return The plot's ID.")
|
|
|
+ "@return The plot's ID.")
|
|
|
{
|
|
|
return object->getSelectedPlot();
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, getSelectedPoint, S32, (), , "()"
|
|
|
"Gets the selected Point on the Plot (a.k.a. graph)."
|
|
|
- "@return The last selected point ID")
|
|
|
+ "@return The last selected point ID")
|
|
|
{
|
|
|
- return object->getSelectedPoint();
|
|
|
+ return object->getSelectedPoint();
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, isExistingPoint, bool, (S32 plotID, S32 samples), , "(int plotID, int samples)"
|
|
@@ -1110,27 +1110,27 @@ DefineConsoleMethod(GuiParticleGraphCtrl, isExistingPoint, bool, (S32 plotID, S3
|
|
|
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
}
|
|
|
if(samples > object->MaxDataPoints)
|
|
|
{
|
|
|
- Con::errorf("Invalid sample.");
|
|
|
+ Con::errorf("Invalid sample.");
|
|
|
}
|
|
|
return object->isExistingPoint(plotID, samples);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, getPlotPoint, Point2F, (S32 plotID, S32 samples), , "(int plotID, int samples)"
|
|
|
"Get a data point from the plot specified, samples from the start of the graph."
|
|
|
- "@return The data point ID")
|
|
|
+ "@return The data point ID")
|
|
|
{
|
|
|
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
}
|
|
|
if(samples > object->MaxDataPoints)
|
|
|
{
|
|
|
- Con::errorf("Invalid sample.");
|
|
|
+ Con::errorf("Invalid sample.");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1139,26 +1139,26 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getPlotPoint, Point2F, (S32 plotID, S3
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, getPlotIndex, S32, (S32 plotID, F32 x, F32 y), , "(int plotID, float x, float y)\n"
|
|
|
"Gets the index of the point passed on the plotID passed (graph ID).\n"
|
|
|
- "@param plotID The plot you wish to check.\n"
|
|
|
- "@param x,y The coordinates of the point to get.\n"
|
|
|
- "@return Returns the index of the point.\n")
|
|
|
+ "@param plotID The plot you wish to check.\n"
|
|
|
+ "@param x,y The coordinates of the point to get.\n"
|
|
|
+ "@return Returns the index of the point.\n")
|
|
|
{
|
|
|
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
}
|
|
|
return object->getPlotIndex(plotID, x, y);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, getGraphColor, ColorF, (S32 plotID), , "(int plotID)"
|
|
|
"Get the color of the graph passed."
|
|
|
- "@return Returns the color of the graph as a string of RGB values formatted as \"R G B\"")
|
|
|
+ "@return Returns the color of the graph as a string of RGB values formatted as \"R G B\"")
|
|
|
{
|
|
|
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
}
|
|
|
|
|
|
return object->getGraphColor(plotID);
|
|
@@ -1167,24 +1167,24 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphColor, ColorF, (S32 plotID), ,
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMin, Point2F, (S32 plotID), , "(int plotID) "
|
|
|
"Get the minimum values of the graph ranges.\n"
|
|
|
- "@return Returns the minimum of the range formatted as \"x-min y-min\"")
|
|
|
+ "@return Returns the minimum of the range formatted as \"x-min y-min\"")
|
|
|
{
|
|
|
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
}
|
|
|
return object->getGraphMin(plotID);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMax, Point2F, (S32 plotID), , "(int plotID) "
|
|
|
- "Get the maximum values of the graph ranges.\n"
|
|
|
- "@return Returns the maximum of the range formatted as \"x-max y-max\"")
|
|
|
+ "Get the maximum values of the graph ranges.\n"
|
|
|
+ "@return Returns the maximum of the range formatted as \"x-max y-max\"")
|
|
|
{
|
|
|
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
}
|
|
|
return object->getGraphMax(plotID);
|
|
|
|
|
@@ -1192,12 +1192,12 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphMax, Point2F, (S32 plotID), ,
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, getGraphName, const char*, (S32 plotID), , "(int plotID) "
|
|
|
"Get the name of the graph passed.\n"
|
|
|
- "@return Returns the name of the plot")
|
|
|
+ "@return Returns the name of the plot")
|
|
|
{
|
|
|
|
|
|
if(plotID > object->MaxPlots)
|
|
|
{
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
}
|
|
|
|
|
|
const U32 bufSize = 64;
|
|
@@ -1208,170 +1208,170 @@ DefineConsoleMethod(GuiParticleGraphCtrl, getGraphName, const char*, (S32 plotID
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMin, void, (S32 plotID, F32 minX, F32 minY), , "(int plotID, float minX, float minY) "
|
|
|
- "Set the min values of the graph of plotID.\n"
|
|
|
- "@param plotID The plot to modify\n"
|
|
|
- "@param minX,minY The minimum bound of the value range.\n"
|
|
|
- "@return No return value.")
|
|
|
+ "Set the min values of the graph of plotID.\n"
|
|
|
+ "@param plotID The plot to modify\n"
|
|
|
+ "@param minX,minY The minimum bound of the value range.\n"
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
|
|
|
- if(plotID > object->MaxPlots)
|
|
|
- {
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return;
|
|
|
- }
|
|
|
+ if(plotID > object->MaxPlots)
|
|
|
+ {
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- object->setGraphMin(plotID, Point2F(minX, minY));
|
|
|
+ object->setGraphMin(plotID, Point2F(minX, minY));
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinX, void, (S32 plotID, F32 minX), , "(int plotID, float minX) "
|
|
|
- "Set the min X value of the graph of plotID.\n"
|
|
|
- "@param plotID The plot to modify.\n"
|
|
|
- "@param minX The minimum x value.\n"
|
|
|
- "@return No return Value.")
|
|
|
+ "Set the min X value of the graph of plotID.\n"
|
|
|
+ "@param plotID The plot to modify.\n"
|
|
|
+ "@param minX The minimum x value.\n"
|
|
|
+ "@return No return Value.")
|
|
|
{
|
|
|
|
|
|
- if(plotID > object->MaxPlots)
|
|
|
- {
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return;
|
|
|
- }
|
|
|
+ if(plotID > object->MaxPlots)
|
|
|
+ {
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- object->setGraphMinX(plotID, minX);
|
|
|
+ object->setGraphMinX(plotID, minX);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMinY, void, (S32 plotID, F32 minX), , "(int plotID, float minY) "
|
|
|
- "Set the min Y value of the graph of plotID."
|
|
|
- "@param plotID The plot to modify.\n"
|
|
|
- "@param minY The minimum y value.\n"
|
|
|
- "@return No return Value.")
|
|
|
+ "Set the min Y value of the graph of plotID."
|
|
|
+ "@param plotID The plot to modify.\n"
|
|
|
+ "@param minY The minimum y value.\n"
|
|
|
+ "@return No return Value.")
|
|
|
{
|
|
|
|
|
|
- if(plotID > object->MaxPlots)
|
|
|
- {
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return;
|
|
|
- }
|
|
|
+ if(plotID > object->MaxPlots)
|
|
|
+ {
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- object->setGraphMinY(plotID, minX);
|
|
|
+ object->setGraphMinY(plotID, minX);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMax, void, (S32 plotID, F32 maxX, F32 maxY), , "(int plotID, float maxX, float maxY) "
|
|
|
- "Set the max values of the graph of plotID."
|
|
|
- "@param plotID The plot to modify\n"
|
|
|
- "@param maxX,maxY The maximum bound of the value range.\n"
|
|
|
- "@return No return value.")
|
|
|
+ "Set the max values of the graph of plotID."
|
|
|
+ "@param plotID The plot to modify\n"
|
|
|
+ "@param maxX,maxY The maximum bound of the value range.\n"
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
|
|
|
- if(plotID > object->MaxPlots)
|
|
|
- {
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return;
|
|
|
- }
|
|
|
+ if(plotID > object->MaxPlots)
|
|
|
+ {
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- object->setGraphMax(plotID, Point2F(maxX, maxY));
|
|
|
+ object->setGraphMax(plotID, Point2F(maxX, maxY));
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxX, void, (S32 plotID, F32 maxX), , "(int plotID, float maxX)"
|
|
|
- "Set the max X value of the graph of plotID."
|
|
|
- "@param plotID The plot to modify.\n"
|
|
|
- "@param maxX The maximum x value.\n"
|
|
|
- "@return No return Value.")
|
|
|
+ "Set the max X value of the graph of plotID."
|
|
|
+ "@param plotID The plot to modify.\n"
|
|
|
+ "@param maxX The maximum x value.\n"
|
|
|
+ "@return No return Value.")
|
|
|
{
|
|
|
|
|
|
- if(plotID > object->MaxPlots)
|
|
|
- {
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return;
|
|
|
- }
|
|
|
+ if(plotID > object->MaxPlots)
|
|
|
+ {
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- object->setGraphMaxX(plotID, maxX);
|
|
|
+ object->setGraphMaxX(plotID, maxX);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setGraphMaxY, void, (S32 plotID, F32 maxX), , "(int plotID, float maxY)"
|
|
|
- "Set the max Y value of the graph of plotID."
|
|
|
- "@param plotID The plot to modify.\n"
|
|
|
- "@param maxY The maximum y value.\n"
|
|
|
- "@return No return Value.")
|
|
|
+ "Set the max Y value of the graph of plotID."
|
|
|
+ "@param plotID The plot to modify.\n"
|
|
|
+ "@param maxY The maximum y value.\n"
|
|
|
+ "@return No return Value.")
|
|
|
{
|
|
|
|
|
|
- if(plotID > object->MaxPlots)
|
|
|
- {
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return;
|
|
|
- }
|
|
|
+ if(plotID > object->MaxPlots)
|
|
|
+ {
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- object->setGraphMaxY(plotID, maxX);
|
|
|
+ object->setGraphMaxY(plotID, maxX);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setGraphHidden, void, (S32 plotID, bool isHidden), , "(int plotID, bool isHidden)"
|
|
|
- "Set whether the graph number passed is hidden or not."
|
|
|
- "@return No return value.")
|
|
|
+ "Set whether the graph number passed is hidden or not."
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
|
|
|
- if(plotID > object->MaxPlots)
|
|
|
- {
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return;
|
|
|
- }
|
|
|
+ if(plotID > object->MaxPlots)
|
|
|
+ {
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- object->setGraphHidden(plotID, isHidden);
|
|
|
+ object->setGraphHidden(plotID, isHidden);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setAutoGraphMax, void, (bool autoMax), , "(bool autoMax) "
|
|
|
- "Set whether the max will automatically be set when adding points "
|
|
|
- "(ie if you add a value over the current max, the max is increased to that value).\n"
|
|
|
- "@return No return value.")
|
|
|
+ "Set whether the max will automatically be set when adding points "
|
|
|
+ "(ie if you add a value over the current max, the max is increased to that value).\n"
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
- object->setAutoGraphMax(autoMax);
|
|
|
+ object->setAutoGraphMax(autoMax);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setAutoRemove, void, (bool autoRemove), , "(bool autoRemove) "
|
|
|
- "Set whether or not a point should be deleted when you drag another one over it."
|
|
|
- "@return No return value.")
|
|
|
+ "Set whether or not a point should be deleted when you drag another one over it."
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
- object->setAutoRemove(autoRemove);
|
|
|
+ object->setAutoRemove(autoRemove);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setRenderAll, void, (bool autoRemove), , "(bool renderAll)"
|
|
|
- "Set whether or not a position should be rendered on every point or just the last selected."
|
|
|
- "@return No return value.")
|
|
|
+ "Set whether or not a position should be rendered on every point or just the last selected."
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
- object->setRenderAll(autoRemove);
|
|
|
+ object->setRenderAll(autoRemove);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setPointXMovementClamped, void, (bool autoRemove), , "(bool clamped)"
|
|
|
- "Set whether the x position of the selected graph point should be clamped"
|
|
|
- "@return No return value.")
|
|
|
+ "Set whether the x position of the selected graph point should be clamped"
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
- object->setPointXMovementClamped(autoRemove);
|
|
|
+ object->setPointXMovementClamped(autoRemove);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setRenderGraphTooltip, void, (bool autoRemove), , "(bool renderGraphTooltip)"
|
|
|
- "Set whether or not to render the graph tooltip."
|
|
|
- "@return No return value.")
|
|
|
+ "Set whether or not to render the graph tooltip."
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
- object->setRenderGraphTooltip(autoRemove);
|
|
|
+ object->setRenderGraphTooltip(autoRemove);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, setGraphName, void, (S32 plotID, const char * graphName), , "(int plotID, string graphName) "
|
|
|
- "Set the name of the given plot.\n"
|
|
|
- "@param plotID The plot to modify.\n"
|
|
|
- "@param graphName The name to set on the plot.\n"
|
|
|
- "@return No return value.")
|
|
|
+ "Set the name of the given plot.\n"
|
|
|
+ "@param plotID The plot to modify.\n"
|
|
|
+ "@param graphName The name to set on the plot.\n"
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
|
|
|
- if(plotID > object->MaxPlots)
|
|
|
- {
|
|
|
- Con::errorf("Invalid plotID.");
|
|
|
- return;
|
|
|
- }
|
|
|
+ if(plotID > object->MaxPlots)
|
|
|
+ {
|
|
|
+ Con::errorf("Invalid plotID.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- object->setGraphName(plotID, graphName);
|
|
|
+ object->setGraphName(plotID, graphName);
|
|
|
}
|
|
|
|
|
|
DefineConsoleMethod(GuiParticleGraphCtrl, resetSelectedPoint, void, (), , "()"
|
|
|
- "This will reset the currently selected point to nothing."
|
|
|
- "@return No return value.")
|
|
|
+ "This will reset the currently selected point to nothing."
|
|
|
+ "@return No return value.")
|
|
|
{
|
|
|
- object->resetSelectedPoint();
|
|
|
+ object->resetSelectedPoint();
|
|
|
}
|