Skip to content

Commit 5d3e986

Browse files
committed
Removed Old Profile Settings
Removed a handful of old settings from the GuiControlProfile. Removed mMouseOverSelected, mProfileForChildrenName, and mProfileForChildren. Also removed mSoundButton... from the profile. Sounds should be handled with the callbacks, not with the profile.
1 parent ff8b246 commit 5d3e986

File tree

4 files changed

+0
-85
lines changed

4 files changed

+0
-85
lines changed

engine/source/gui/buttons/guiButtonCtrl.cc

-16
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,6 @@ void GuiButtonCtrl::onTouchEnter(const GuiEvent &event)
104104
{
105105
mDepressed = true;
106106
}
107-
else if (mActive && mProfile->mSoundButtonOver)
108-
{
109-
AUDIOHANDLE handle = alxCreateSource(mProfile->mSoundButtonOver);
110-
alxPlay(handle);
111-
}
112107

113108
Con::executef(this, 1, "onTouchEnter");
114109

@@ -143,12 +138,6 @@ void GuiButtonCtrl::onTouchDown(const GuiEvent &event)
143138
if (mProfile->mCanKeyFocus)
144139
setFirstResponder();
145140

146-
if (mProfile->mSoundButtonDown)
147-
{
148-
AUDIOHANDLE handle = alxCreateSource(mProfile->mSoundButtonDown);
149-
alxPlay(handle);
150-
}
151-
152141
//lock the mouse
153142
mouseLock();
154143

@@ -206,11 +195,6 @@ bool GuiButtonCtrl::onKeyDown(const GuiEvent &event)
206195
if ((event.keyCode == KEY_RETURN || event.keyCode == KEY_SPACE)
207196
&& event.modifier == 0)
208197
{
209-
if (mProfile->mSoundButtonDown)
210-
{
211-
AUDIOHANDLE handle = alxCreateSource(mProfile->mSoundButtonDown);
212-
alxPlay(handle);
213-
}
214198
mDepressed = true;
215199
return true;
216200
}

engine/source/gui/guiSliderCtrl.cc

-6
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,6 @@ void GuiSliderCtrl::onTouchEnter(const GuiEvent &event)
167167
}
168168
else
169169
{
170-
if (mActive && mProfile->mSoundButtonOver)
171-
{
172-
//F32 pan = (F32(event.mousePoint.x)/F32(Canvas->mBounds.extent.x)*2.0f-1.0f)*0.8f;
173-
AUDIOHANDLE handle = alxCreateSource(mProfile->mSoundButtonOver);
174-
alxPlay(handle);
175-
}
176170
mMouseOver = true;
177171
}
178172
}

engine/source/gui/guiTypes.cc

-51
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ GuiControlProfile::GuiControlProfile(void) :
305305
{
306306
mRefCount = 0;
307307
mBitmapArrayRects.clear();
308-
mMouseOverSelected = false;
309308

310309
mTabable = false;
311310
mCanKeyFocus = false;
@@ -337,8 +336,6 @@ GuiControlProfile::GuiControlProfile(void) :
337336

338337
mAlignment = AlignmentType::LeftAlign;
339338
mVAlignment = VertAlignmentType::MiddleVAlign;
340-
mProfileForChildrenName = NULL;
341-
mProfileForChildren = NULL;
342339

343340
//fill color
344341
mFillColor.set(0, 0, 0, 0);
@@ -382,10 +379,6 @@ GuiControlProfile::GuiControlProfile(void) :
382379
mAlignment = def->mAlignment;
383380
mVAlignment = def->mVAlignment;
384381
mCursorColor = def->mCursorColor;
385-
386-
// Child profile
387-
mProfileForChildrenName = def->mProfileForChildrenName;
388-
setChildrenProfile(def->mProfileForChildren);
389382
}
390383
}
391384

@@ -400,7 +393,6 @@ void GuiControlProfile::initPersistFields()
400393
addGroup("Behavior");
401394
addField("tab", TypeBool, Offset(mTabable, GuiControlProfile));
402395
addField("canKeyFocus", TypeBool, Offset(mCanKeyFocus, GuiControlProfile));
403-
addField("mouseOverSelected", TypeBool, Offset(mMouseOverSelected, GuiControlProfile));
404396
endGroup("Behavior");
405397

406398
addGroup("FillColor");
@@ -442,10 +434,6 @@ void GuiControlProfile::initPersistFields()
442434
addField("bitmap", TypeFilename, Offset(mBitmapName, GuiControlProfile));
443435
addProtectedField("imageAsset", TypeAssetId, Offset(mImageAssetID, GuiControlProfile), &setImageAsset, &getImageAsset, "The image asset ID used to render the control");
444436

445-
addField("soundButtonDown", TypeAudioAssetPtr, Offset(mSoundButtonDown, GuiControlProfile));
446-
addField("soundButtonOver", TypeAudioAssetPtr, Offset(mSoundButtonOver, GuiControlProfile));
447-
addField("profileForChildren", TypeString, Offset(mProfileForChildrenName, GuiControlProfile));
448-
449437
addField("category", TypeString, Offset(mCategory, GuiControlProfile));
450438
}
451439

@@ -461,8 +449,6 @@ bool GuiControlProfile::onAdd()
461449
getTopProfile();
462450
getBottomProfile();
463451

464-
getChildrenProfile();
465-
466452
return true;
467453
}
468454

@@ -626,40 +612,6 @@ void GuiControlProfile::setBottomProfile(GuiBorderProfile * prof)
626612
deleteNotify(mBorderBottom);
627613
}
628614

629-
GuiControlProfile* GuiControlProfile::getChildrenProfile()
630-
{
631-
// We can early out if we still have a valid profile
632-
if (mProfileForChildren)
633-
return mProfileForChildren;
634-
635-
// Attempt to find the profile specified
636-
if (mProfileForChildrenName)
637-
{
638-
GuiControlProfile *profile = dynamic_cast<GuiControlProfile*> (Sim::findObject(mProfileForChildrenName));
639-
640-
if (profile)
641-
setChildrenProfile(profile);
642-
}
643-
644-
return mProfileForChildren;
645-
}
646-
647-
void GuiControlProfile::setChildrenProfile(GuiControlProfile *prof)
648-
{
649-
if (prof == mProfileForChildren)
650-
return;
651-
652-
// Clear the delete notification we previously set up
653-
if (mProfileForChildren)
654-
clearNotify(mProfileForChildren);
655-
656-
mProfileForChildren = prof;
657-
658-
// Make sure that the new profile will notify us when it is deleted
659-
if (mProfileForChildren)
660-
deleteNotify(mProfileForChildren);
661-
}
662-
663615
S32 GuiControlProfile::constructBitmapArray()
664616
{
665617
if(mBitmapArrayRects.size())
@@ -762,9 +714,6 @@ void GuiControlProfile::incRefCount(F32 fontAdjust)
762714
}
763715

764716
mRefCount++;
765-
766-
getChildrenProfile();
767-
768717
}
769718

770719
void GuiControlProfile::decRefCount()

engine/source/gui/guiTypes.h

-12
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ class GuiControlProfile : public SimObject
186186
public:
187187
S32 mRefCount; ///< Used to determine if any controls are using this profile
188188
bool mTabable; ///< True if this object is accessable from using the tab key
189-
190189
bool mCanKeyFocus; ///< True if the object can be given keyboard focus (in other words, made a first responder @see GuiControl)
191190

192191
ColorI mFillColor; //Normal fill color used to fill the control area inside (and possibly under) the border.
@@ -240,7 +239,6 @@ class GuiControlProfile : public SimObject
240239
AlignmentType mAlignment; ///< Horizontal text alignment
241240
VertAlignmentType mVAlignment; ///< Vertical text alignment
242241

243-
bool mMouseOverSelected; ///< True if this object should be "selected" while the mouse is over it
244242
ColorI mCursorColor; ///< Color for the blinking cursor in text fields (for example)
245243

246244
Point2I mTextOffset; ///< Text offset for the control
@@ -267,12 +265,6 @@ class GuiControlProfile : public SimObject
267265
TextureHandle mTextureHandle; ///< Texture handle for the control
268266
Vector<RectI> mBitmapArrayRects; ///< Used for controls which use an array of bitmaps such as checkboxes
269267

270-
// sound members
271-
AssetPtr<AudioAsset> mSoundButtonDown; ///< Sound played when the object is "down" ie a button is pushed
272-
AssetPtr<AudioAsset> mSoundButtonOver; ///< Sound played when the mouse is over the object
273-
StringTableEntry mProfileForChildrenName;
274-
GuiControlProfile* mProfileForChildren; ///< Profile used with children controls (such as the scroll bar on a popup menu) when defined.
275-
public:
276268
DECLARE_CONOBJECT(GuiControlProfile);
277269
GuiControlProfile();
278270
~GuiControlProfile();
@@ -292,10 +284,6 @@ class GuiControlProfile : public SimObject
292284
GuiBorderProfile* getBottomProfile();
293285
void setBottomProfile(GuiBorderProfile* prof);
294286

295-
// Get and Set child profile
296-
GuiControlProfile * getChildrenProfile();
297-
void setChildrenProfile(GuiControlProfile * prof);
298-
299287
/// This method creates an array of bitmaps from one single bitmap with
300288
/// seperator color. The seperator color is whatever color is in pixel 0,0
301289
/// of the bitmap. For an example see darkWindow.png and some of the other

0 commit comments

Comments
 (0)