Browse Source

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.
Peter Robinson 2 years ago
parent
commit
5d3e98609d

+ 0 - 16
engine/source/gui/buttons/guiButtonCtrl.cc

@@ -104,11 +104,6 @@ void GuiButtonCtrl::onTouchEnter(const GuiEvent &event)
 	{
 	{
 		mDepressed = true;
 		mDepressed = true;
 	}
 	}
-	else if (mActive && mProfile->mSoundButtonOver)
-	{
-		AUDIOHANDLE handle = alxCreateSource(mProfile->mSoundButtonOver);
-		alxPlay(handle);
-	}
 
 
 	Con::executef(this, 1, "onTouchEnter");
 	Con::executef(this, 1, "onTouchEnter");
 
 
@@ -143,12 +138,6 @@ void GuiButtonCtrl::onTouchDown(const GuiEvent &event)
 	if (mProfile->mCanKeyFocus)
 	if (mProfile->mCanKeyFocus)
 		setFirstResponder();
 		setFirstResponder();
 
 
-	if (mProfile->mSoundButtonDown)
-	{
-		AUDIOHANDLE handle = alxCreateSource(mProfile->mSoundButtonDown);
-		alxPlay(handle);
-	}
-
 	//lock the mouse
 	//lock the mouse
 	mouseLock();
 	mouseLock();
 
 
@@ -206,11 +195,6 @@ bool GuiButtonCtrl::onKeyDown(const GuiEvent &event)
 	if ((event.keyCode == KEY_RETURN || event.keyCode == KEY_SPACE)
 	if ((event.keyCode == KEY_RETURN || event.keyCode == KEY_SPACE)
 		&& event.modifier == 0)
 		&& event.modifier == 0)
 	{
 	{
-		if (mProfile->mSoundButtonDown)
-		{
-			AUDIOHANDLE handle = alxCreateSource(mProfile->mSoundButtonDown);
-			alxPlay(handle);
-		}
 		mDepressed = true;
 		mDepressed = true;
 		return true;
 		return true;
 	}
 	}

+ 0 - 6
engine/source/gui/guiSliderCtrl.cc

@@ -167,12 +167,6 @@ void GuiSliderCtrl::onTouchEnter(const GuiEvent &event)
     }
     }
     else
     else
     {
     {
-        if (mActive && mProfile->mSoundButtonOver)
-        {
-            //F32 pan = (F32(event.mousePoint.x)/F32(Canvas->mBounds.extent.x)*2.0f-1.0f)*0.8f;
-            AUDIOHANDLE handle = alxCreateSource(mProfile->mSoundButtonOver);
-            alxPlay(handle);
-        }
         mMouseOver = true;
         mMouseOver = true;
     }
     }
 }
 }

+ 0 - 51
engine/source/gui/guiTypes.cc

@@ -305,7 +305,6 @@ GuiControlProfile::GuiControlProfile(void) :
 {
 {
 	mRefCount = 0;
 	mRefCount = 0;
 	mBitmapArrayRects.clear();
 	mBitmapArrayRects.clear();
-	mMouseOverSelected = false;
 	
 	
 	mTabable       = false;
 	mTabable       = false;
 	mCanKeyFocus   = false;
 	mCanKeyFocus   = false;
@@ -337,8 +336,6 @@ GuiControlProfile::GuiControlProfile(void) :
 	
 	
 	mAlignment     = AlignmentType::LeftAlign;
 	mAlignment     = AlignmentType::LeftAlign;
 	mVAlignment    = VertAlignmentType::MiddleVAlign;
 	mVAlignment    = VertAlignmentType::MiddleVAlign;
-   mProfileForChildrenName = NULL;
-	mProfileForChildren = NULL;
 
 
 	//fill color
 	//fill color
 	mFillColor.set(0, 0, 0, 0);
 	mFillColor.set(0, 0, 0, 0);
@@ -382,10 +379,6 @@ GuiControlProfile::GuiControlProfile(void) :
       mAlignment = def->mAlignment;
       mAlignment = def->mAlignment;
 	  mVAlignment = def->mVAlignment;
 	  mVAlignment = def->mVAlignment;
       mCursorColor = def->mCursorColor;
       mCursorColor = def->mCursorColor;
-
-      // Child profile
-      mProfileForChildrenName = def->mProfileForChildrenName;
-      setChildrenProfile(def->mProfileForChildren);
    }
    }
 }
 }
 
 
@@ -400,7 +393,6 @@ void GuiControlProfile::initPersistFields()
    addGroup("Behavior");
    addGroup("Behavior");
       addField("tab",           TypeBool,       Offset(mTabable, GuiControlProfile));
       addField("tab",           TypeBool,       Offset(mTabable, GuiControlProfile));
       addField("canKeyFocus",   TypeBool,       Offset(mCanKeyFocus, GuiControlProfile));
       addField("canKeyFocus",   TypeBool,       Offset(mCanKeyFocus, GuiControlProfile));
-      addField("mouseOverSelected", TypeBool,   Offset(mMouseOverSelected, GuiControlProfile));
    endGroup("Behavior");
    endGroup("Behavior");
 
 
    addGroup("FillColor");
    addGroup("FillColor");
@@ -442,10 +434,6 @@ void GuiControlProfile::initPersistFields()
    addField("bitmap",        TypeFilename,   Offset(mBitmapName, GuiControlProfile));
    addField("bitmap",        TypeFilename,   Offset(mBitmapName, GuiControlProfile));
    addProtectedField("imageAsset", TypeAssetId, Offset(mImageAssetID, GuiControlProfile), &setImageAsset, &getImageAsset, "The image asset ID used to render the control");
    addProtectedField("imageAsset", TypeAssetId, Offset(mImageAssetID, GuiControlProfile), &setImageAsset, &getImageAsset, "The image asset ID used to render the control");
 
 
-   addField("soundButtonDown", TypeAudioAssetPtr,  Offset(mSoundButtonDown, GuiControlProfile));
-   addField("soundButtonOver", TypeAudioAssetPtr,  Offset(mSoundButtonOver, GuiControlProfile));
-   addField("profileForChildren", TypeString,      Offset(mProfileForChildrenName, GuiControlProfile));
-
    addField("category", TypeString, Offset(mCategory, GuiControlProfile));
    addField("category", TypeString, Offset(mCategory, GuiControlProfile));
 }
 }
 
 
@@ -461,8 +449,6 @@ bool GuiControlProfile::onAdd()
    getTopProfile();
    getTopProfile();
    getBottomProfile();
    getBottomProfile();
 
 
-   getChildrenProfile();
-
    return true;
    return true;
 }
 }
 
 
@@ -626,40 +612,6 @@ void GuiControlProfile::setBottomProfile(GuiBorderProfile * prof)
       deleteNotify(mBorderBottom);
       deleteNotify(mBorderBottom);
 }
 }
 
 
-GuiControlProfile* GuiControlProfile::getChildrenProfile()
-{
-   // We can early out if we still have a valid profile
-   if (mProfileForChildren)
-      return mProfileForChildren;
-
-   // Attempt to find the profile specified
-   if (mProfileForChildrenName)
-   {
-      GuiControlProfile *profile = dynamic_cast<GuiControlProfile*> (Sim::findObject(mProfileForChildrenName));
-
-      if (profile)
-         setChildrenProfile(profile);
-   }
-
-   return mProfileForChildren;
-}
-
-void GuiControlProfile::setChildrenProfile(GuiControlProfile *prof)
-{
-   if (prof == mProfileForChildren)
-      return;
-
-   // Clear the delete notification we previously set up
-   if (mProfileForChildren)
-      clearNotify(mProfileForChildren);
-
-   mProfileForChildren = prof;
-
-   // Make sure that the new profile will notify us when it is deleted
-   if (mProfileForChildren)
-      deleteNotify(mProfileForChildren);
-}
-
 S32 GuiControlProfile::constructBitmapArray()
 S32 GuiControlProfile::constructBitmapArray()
 {
 {
    if(mBitmapArrayRects.size())
    if(mBitmapArrayRects.size())
@@ -762,9 +714,6 @@ void GuiControlProfile::incRefCount(F32 fontAdjust)
 	}
 	}
 
 
    mRefCount++;
    mRefCount++;
-
-   getChildrenProfile();
-
 }
 }
 
 
 void GuiControlProfile::decRefCount()
 void GuiControlProfile::decRefCount()

+ 0 - 12
engine/source/gui/guiTypes.h

@@ -186,7 +186,6 @@ private:
 public:
 public:
    S32  mRefCount;                                 ///< Used to determine if any controls are using this profile
    S32  mRefCount;                                 ///< Used to determine if any controls are using this profile
    bool mTabable;                                  ///< True if this object is accessable from using the tab key
    bool mTabable;                                  ///< True if this object is accessable from using the tab key
-
    bool mCanKeyFocus;                              ///< True if the object can be given keyboard focus (in other words, made a first responder @see GuiControl)
    bool mCanKeyFocus;                              ///< True if the object can be given keyboard focus (in other words, made a first responder @see GuiControl)
 
 
    ColorI mFillColor; //Normal fill color used to fill the control area inside (and possibly under) the border.
    ColorI mFillColor; //Normal fill color used to fill the control area inside (and possibly under) the border.
@@ -240,7 +239,6 @@ public:
    AlignmentType mAlignment;                       ///< Horizontal text alignment
    AlignmentType mAlignment;                       ///< Horizontal text alignment
    VertAlignmentType mVAlignment;				   ///< Vertical text alignment
    VertAlignmentType mVAlignment;				   ///< Vertical text alignment
                              
                              
-   bool mMouseOverSelected;                        ///< True if this object should be "selected" while the mouse is over it
    ColorI mCursorColor;                            ///< Color for the blinking cursor in text fields (for example)
    ColorI mCursorColor;                            ///< Color for the blinking cursor in text fields (for example)
 
 
    Point2I mTextOffset;                            ///< Text offset for the control
    Point2I mTextOffset;                            ///< Text offset for the control
@@ -267,12 +265,6 @@ public:
    TextureHandle mTextureHandle;                   ///< Texture handle for the control
    TextureHandle mTextureHandle;                   ///< Texture handle for the control
    Vector<RectI> mBitmapArrayRects;                ///< Used for controls which use an array of bitmaps such as checkboxes
    Vector<RectI> mBitmapArrayRects;                ///< Used for controls which use an array of bitmaps such as checkboxes
 
 
-   // sound members
-   AssetPtr<AudioAsset> mSoundButtonDown;                 ///< Sound played when the object is "down" ie a button is pushed
-   AssetPtr<AudioAsset> mSoundButtonOver;                 ///< Sound played when the mouse is over the object
-   StringTableEntry mProfileForChildrenName;
-   GuiControlProfile* mProfileForChildren;         ///< Profile used with children controls (such as the scroll bar on a popup menu) when defined.
-public:
    DECLARE_CONOBJECT(GuiControlProfile);
    DECLARE_CONOBJECT(GuiControlProfile);
    GuiControlProfile();
    GuiControlProfile();
    ~GuiControlProfile();
    ~GuiControlProfile();
@@ -292,10 +284,6 @@ public:
    GuiBorderProfile* getBottomProfile();
    GuiBorderProfile* getBottomProfile();
    void setBottomProfile(GuiBorderProfile* prof);
    void setBottomProfile(GuiBorderProfile* prof);
 
 
-   // Get and Set child profile
-   GuiControlProfile * getChildrenProfile();
-   void setChildrenProfile(GuiControlProfile * prof);
-
    /// This method creates an array of bitmaps from one single bitmap with
    /// This method creates an array of bitmaps from one single bitmap with
    /// seperator color. The seperator color is whatever color is in pixel 0,0
    /// seperator color. The seperator color is whatever color is in pixel 0,0
    /// of the bitmap. For an example see darkWindow.png and some of the other
    /// of the bitmap. For an example see darkWindow.png and some of the other