CGUIListbox, CGUITreeView and CGUITable now resize scrollbars when EGDS_SCROLLBAR_SIZE in the skin changes without having to re-create the elements.

This also fixes the problem that drawing looked wrong when this value got changed after the elements were created.
Thanks @LunaRebirth for reporting. (Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=1&t=52297&p=303682#p303682)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5619 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2018-06-16 22:27:08 +00:00
parent 8f3b9e6c6a
commit 9d315a9354
8 changed files with 81 additions and 31 deletions

View File

@ -1,5 +1,9 @@
-------------------------- --------------------------
Changes in 1.9 (not yet released) Changes in 1.9 (not yet released)
- CGUIListbox, CGUITreeView and CGUITable now resize scrollbars when EGDS_SCROLLBAR_SIZE in the skin changes without having to re-create the elements.
This also fixes the problem that drawing looked wrong when this value got changed after the elements were created.
Thanks @LunaRebirth for reporting. (Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=1&t=52297&p=303682#p303682)
- Scrollbar buttons can no longer get larger than half the ScrollBar element to avoid them overlapping.
- Add IVideoDriver::swapMaterialRenderers to allow swapping the renderer used to render a certain material. - Add IVideoDriver::swapMaterialRenderers to allow swapping the renderer used to render a certain material.
- IMeshManipulator functions createMeshWith1TCoords, createMeshWith2TCoords and createMeshWithTangents no longer weld vertices while converting meshes. Use IMeshManipulator::createMeshWelded if you need that welding. - IMeshManipulator functions createMeshWith1TCoords, createMeshWith2TCoords and createMeshWithTangents no longer weld vertices while converting meshes. Use IMeshManipulator::createMeshWelded if you need that welding.
- Add ITerrainSceneNode::setFixedBorderLOD to handle connecting terrain nodes without gaps. Thanks @diho for the bugreport, testcase and a patch proposal (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=51220). - Add ITerrainSceneNode::setFixedBorderLOD to handle connecting terrain nodes without gaps. Thanks @diho for the bugreport, testcase and a patch proposal (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=51220).

View File

@ -163,7 +163,7 @@ namespace gui
EGDS_MESSAGE_BOX_HEIGHT, EGDS_MESSAGE_BOX_HEIGHT,
//! width of a default button //! width of a default button
EGDS_BUTTON_WIDTH, EGDS_BUTTON_WIDTH,
//! height of a default button //! height of a default button (OK and cancel buttons)
EGDS_BUTTON_HEIGHT, EGDS_BUTTON_HEIGHT,
//! distance for text from background //! distance for text from background
EGDS_TEXT_DISTANCE_X, EGDS_TEXT_DISTANCE_X,

View File

@ -25,7 +25,7 @@ CGUIListBox::CGUIListBox(IGUIEnvironment* environment, IGUIElement* parent,
bool drawBack, bool moveOverSelect) bool drawBack, bool moveOverSelect)
: IGUIListBox(environment, parent, id, rectangle), Selected(-1), : IGUIListBox(environment, parent, id, rectangle), Selected(-1),
ItemHeight(0),ItemHeightOverride(0), ItemHeight(0),ItemHeightOverride(0),
TotalItemHeight(0), ItemsIconWidth(0), Font(0), IconBank(0), TotalItemHeight(0), ItemsIconWidth(0), ScrollBarSize(0), Font(0), IconBank(0),
ScrollBar(0), selectTime(0), LastKeyTime(0), Selecting(false), DrawBack(drawBack), ScrollBar(0), selectTime(0), LastKeyTime(0), Selecting(false), DrawBack(drawBack),
MoveOverSelect(moveOverSelect), AutoScroll(true), HighlightWhenNotFocused(true) MoveOverSelect(moveOverSelect), AutoScroll(true), HighlightWhenNotFocused(true)
{ {
@ -34,10 +34,10 @@ CGUIListBox::CGUIListBox(IGUIEnvironment* environment, IGUIElement* parent,
#endif #endif
IGUISkin* skin = Environment->getSkin(); IGUISkin* skin = Environment->getSkin();
const s32 s = skin->getSize(EGDS_SCROLLBAR_SIZE); ScrollBarSize = skin->getSize(EGDS_SCROLLBAR_SIZE);
ScrollBar = new CGUIScrollBar(false, Environment, this, -1, ScrollBar = new CGUIScrollBar(false, Environment, this, -1,
core::rect<s32>(RelativeRect.getWidth() - s, 0, RelativeRect.getWidth(), RelativeRect.getHeight()), core::rect<s32>(RelativeRect.getWidth() - ScrollBarSize, 0, RelativeRect.getWidth(), RelativeRect.getHeight()),
!clip); !clip);
ScrollBar->setSubElement(true); ScrollBar->setSubElement(true);
ScrollBar->setTabStop(false); ScrollBar->setTabStop(false);
@ -190,7 +190,6 @@ void CGUIListBox::recalculateItemHeight()
ScrollBar->setVisible(true); ScrollBar->setVisible(true);
} }
//! returns id of selected item. returns -1 if no item is selected. //! returns id of selected item. returns -1 if no item is selected.
s32 CGUIListBox::getSelected() const s32 CGUIListBox::getSelected() const
{ {
@ -498,6 +497,7 @@ void CGUIListBox::draw()
recalculateItemHeight(); // if the font changed recalculateItemHeight(); // if the font changed
IGUISkin* skin = Environment->getSkin(); IGUISkin* skin = Environment->getSkin();
updateScrollBarSize(skin->getSize(EGDS_SCROLLBAR_SIZE));
core::rect<s32>* clipRect = 0; core::rect<s32>* clipRect = 0;
@ -510,7 +510,7 @@ void CGUIListBox::draw()
clientClip.UpperLeftCorner.Y += 1; clientClip.UpperLeftCorner.Y += 1;
clientClip.UpperLeftCorner.X += 1; clientClip.UpperLeftCorner.X += 1;
if (ScrollBar->isVisible()) if (ScrollBar->isVisible())
clientClip.LowerRightCorner.X = AbsoluteRect.LowerRightCorner.X - skin->getSize(EGDS_SCROLLBAR_SIZE); clientClip.LowerRightCorner.X -= ScrollBarSize;
clientClip.LowerRightCorner.Y -= 1; clientClip.LowerRightCorner.Y -= 1;
clientClip.clipAgainst(AbsoluteClippingRect); clientClip.clipAgainst(AbsoluteClippingRect);
@ -523,7 +523,7 @@ void CGUIListBox::draw()
frameRect = AbsoluteRect; frameRect = AbsoluteRect;
frameRect.UpperLeftCorner.X += 1; frameRect.UpperLeftCorner.X += 1;
if (ScrollBar->isVisible()) if (ScrollBar->isVisible())
frameRect.LowerRightCorner.X = AbsoluteRect.LowerRightCorner.X - skin->getSize(EGDS_SCROLLBAR_SIZE); frameRect.LowerRightCorner.X -= ScrollBarSize;
frameRect.LowerRightCorner.Y = AbsoluteRect.UpperLeftCorner.Y + ItemHeight; frameRect.LowerRightCorner.Y = AbsoluteRect.UpperLeftCorner.Y + ItemHeight;
@ -640,6 +640,15 @@ void CGUIListBox::recalculateScrollPos()
} }
} }
void CGUIListBox::updateScrollBarSize(s32 size)
{
if ( size != ScrollBarSize )
{
ScrollBarSize = size;
core::recti r(RelativeRect.getWidth() - ScrollBarSize, 0, RelativeRect.getWidth(), RelativeRect.getHeight());
ScrollBar->setRelativePosition(r);
}
}
void CGUIListBox::setAutoScrollEnabled(bool scroll) void CGUIListBox::setAutoScrollEnabled(bool scroll)
{ {

View File

@ -157,6 +157,7 @@ namespace gui
void recalculateItemHeight(); void recalculateItemHeight();
void selectNew(s32 ypos, bool onlyHover=false); void selectNew(s32 ypos, bool onlyHover=false);
void recalculateScrollPos(); void recalculateScrollPos();
void updateScrollBarSize(s32 size);
// extracted that function to avoid copy&paste code // extracted that function to avoid copy&paste code
void recalculateItemWidth(s32 icon); void recalculateItemWidth(s32 icon);
@ -170,6 +171,7 @@ namespace gui
s32 ItemHeightOverride; s32 ItemHeightOverride;
s32 TotalItemHeight; s32 TotalItemHeight;
s32 ItemsIconWidth; s32 ItemsIconWidth;
s32 ScrollBarSize;
gui::IGUIFont* Font; gui::IGUIFont* Font;
gui::IGUISpriteBank* IconBank; gui::IGUISpriteBank* IconBank;
gui::IGUIScrollBar* ScrollBar; gui::IGUIScrollBar* ScrollBar;

View File

@ -33,6 +33,7 @@ CGUITable::CGUITable(IGUIEnvironment* environment, IGUIElement* parent,
ItemHeight(0), TotalItemHeight(0), TotalItemWidth(0), Selected(-1), ItemHeight(0), TotalItemHeight(0), TotalItemWidth(0), Selected(-1),
CellHeightPadding(2), CellWidthPadding(5), ActiveTab(-1), CellHeightPadding(2), CellWidthPadding(5), ActiveTab(-1),
CurrentOrdering(EGOM_NONE), DrawFlags(EGTDF_ROWS | EGTDF_COLUMNS | EGTDF_ACTIVE_ROW ), CurrentOrdering(EGOM_NONE), DrawFlags(EGTDF_ROWS | EGTDF_COLUMNS | EGTDF_ACTIVE_ROW ),
ScrollBarSize(0),
OverrideFont(0) OverrideFont(0)
{ {
#ifdef _DEBUG #ifdef _DEBUG
@ -436,7 +437,8 @@ void CGUITable::checkScrollbars()
if ( !HorizontalScrollBar || !VerticalScrollBar || !skin) if ( !HorizontalScrollBar || !VerticalScrollBar || !skin)
return; return;
s32 scrollBarSize = skin->getSize(EGDS_SCROLLBAR_SIZE); ScrollBarSize = skin->getSize(EGDS_SCROLLBAR_SIZE);
bool wasHorizontalScrollBarVisible = HorizontalScrollBar->isVisible(); bool wasHorizontalScrollBarVisible = HorizontalScrollBar->isVisible();
bool wasVerticalScrollBarVisible = VerticalScrollBar->isVisible(); bool wasVerticalScrollBarVisible = VerticalScrollBar->isVisible();
HorizontalScrollBar->setVisible(false); HorizontalScrollBar->setVisible(false);
@ -456,7 +458,7 @@ void CGUITable::checkScrollbars()
// needs horizontal scroll be visible? // needs horizontal scroll be visible?
if( TotalItemWidth > clientClip.getWidth() ) if( TotalItemWidth > clientClip.getWidth() )
{ {
clientClip.LowerRightCorner.Y -= scrollBarSize; clientClip.LowerRightCorner.Y -= ScrollBarSize;
HorizontalScrollBar->setVisible(true); HorizontalScrollBar->setVisible(true);
HorizontalScrollBar->setMax(core::max_(0,TotalItemWidth - clientClip.getWidth())); HorizontalScrollBar->setMax(core::max_(0,TotalItemWidth - clientClip.getWidth()));
} }
@ -464,7 +466,7 @@ void CGUITable::checkScrollbars()
// needs vertical scroll be visible? // needs vertical scroll be visible?
if( TotalItemHeight > clientClip.getHeight() ) if( TotalItemHeight > clientClip.getHeight() )
{ {
clientClip.LowerRightCorner.X -= scrollBarSize; clientClip.LowerRightCorner.X -= ScrollBarSize;
VerticalScrollBar->setVisible(true); VerticalScrollBar->setVisible(true);
VerticalScrollBar->setMax(core::max_(0,TotalItemHeight - clientClip.getHeight())); VerticalScrollBar->setMax(core::max_(0,TotalItemHeight - clientClip.getHeight()));
@ -473,7 +475,7 @@ void CGUITable::checkScrollbars()
{ {
if( TotalItemWidth > clientClip.getWidth() ) if( TotalItemWidth > clientClip.getWidth() )
{ {
clientClip.LowerRightCorner.Y -= scrollBarSize; clientClip.LowerRightCorner.Y -= ScrollBarSize;
HorizontalScrollBar->setVisible(true); HorizontalScrollBar->setVisible(true);
HorizontalScrollBar->setMax(core::max_(0,TotalItemWidth - clientClip.getWidth())); HorizontalScrollBar->setMax(core::max_(0,TotalItemWidth - clientClip.getWidth()));
} }
@ -489,13 +491,13 @@ void CGUITable::checkScrollbars()
if ( HorizontalScrollBar->isVisible() ) if ( HorizontalScrollBar->isVisible() )
{ {
VerticalScrollBar->setRelativePosition( VerticalScrollBar->setRelativePosition(
core::rect<s32>(RelativeRect.getWidth() - scrollBarSize, 1, core::rect<s32>(RelativeRect.getWidth() - ScrollBarSize, 1,
RelativeRect.getWidth()-1, RelativeRect.getHeight()-(1+scrollBarSize) ) ); RelativeRect.getWidth()-1, RelativeRect.getHeight()-(1+ScrollBarSize) ) );
} }
else else
{ {
VerticalScrollBar->setRelativePosition( VerticalScrollBar->setRelativePosition(
core::rect<s32>(RelativeRect.getWidth() - scrollBarSize, 1, core::rect<s32>(RelativeRect.getWidth() - ScrollBarSize, 1,
RelativeRect.getWidth()-1, RelativeRect.getHeight()-1) ); RelativeRect.getWidth()-1, RelativeRect.getHeight()-1) );
} }
} }
@ -508,11 +510,11 @@ void CGUITable::checkScrollbars()
if ( VerticalScrollBar->isVisible() ) if ( VerticalScrollBar->isVisible() )
{ {
HorizontalScrollBar->setRelativePosition( core::rect<s32>(1, RelativeRect.getHeight() - scrollBarSize, RelativeRect.getWidth()-(1+scrollBarSize), RelativeRect.getHeight()-1) ); HorizontalScrollBar->setRelativePosition( core::rect<s32>(1, RelativeRect.getHeight() - ScrollBarSize, RelativeRect.getWidth()-(1+ScrollBarSize), RelativeRect.getHeight()-1) );
} }
else else
{ {
HorizontalScrollBar->setRelativePosition( core::rect<s32>(1, RelativeRect.getHeight() - scrollBarSize, RelativeRect.getWidth()-1, RelativeRect.getHeight()-1) ); HorizontalScrollBar->setRelativePosition( core::rect<s32>(1, RelativeRect.getHeight() - ScrollBarSize, RelativeRect.getWidth()-1, RelativeRect.getHeight()-1) );
} }
} }
} }
@ -864,15 +866,18 @@ void CGUITable::draw()
if (!font) if (!font)
return; return;
if ( ScrollBarSize != skin->getSize(EGDS_SCROLLBAR_SIZE) )
checkScrollbars();
// CAREFUL: near identical calculations for tableRect and clientClip are also done in checkScrollbars and selectColumnHeader // CAREFUL: near identical calculations for tableRect and clientClip are also done in checkScrollbars and selectColumnHeader
// Area of table used for drawing without scrollbars // Area of table used for drawing without scrollbars
core::rect<s32> tableRect(AbsoluteRect); core::rect<s32> tableRect(AbsoluteRect);
tableRect.UpperLeftCorner.X += 1; tableRect.UpperLeftCorner.X += 1;
tableRect.UpperLeftCorner.Y += 1; tableRect.UpperLeftCorner.Y += 1;
if ( VerticalScrollBar && VerticalScrollBar->isVisible() ) if ( VerticalScrollBar && VerticalScrollBar->isVisible() )
tableRect.LowerRightCorner.X -= skin->getSize(EGDS_SCROLLBAR_SIZE); tableRect.LowerRightCorner.X -= ScrollBarSize;
if ( HorizontalScrollBar && HorizontalScrollBar->isVisible() ) if ( HorizontalScrollBar && HorizontalScrollBar->isVisible() )
tableRect.LowerRightCorner.Y -= skin->getSize(EGDS_SCROLLBAR_SIZE); tableRect.LowerRightCorner.Y -= ScrollBarSize;
s32 headerBottom = tableRect.UpperLeftCorner.Y + ItemHeight; s32 headerBottom = tableRect.UpperLeftCorner.Y + ItemHeight;
@ -910,7 +915,7 @@ void CGUITable::draw()
if (rowRect.LowerRightCorner.Y >= AbsoluteRect.UpperLeftCorner.Y && if (rowRect.LowerRightCorner.Y >= AbsoluteRect.UpperLeftCorner.Y &&
rowRect.UpperLeftCorner.Y <= AbsoluteRect.LowerRightCorner.Y) rowRect.UpperLeftCorner.Y <= AbsoluteRect.LowerRightCorner.Y)
{ {
// draw row seperator // draw row separator
if ( DrawFlags & EGTDF_ROWS ) if ( DrawFlags & EGTDF_ROWS )
{ {
core::rect<s32> lineRect(rowRect); core::rect<s32> lineRect(rowRect);
@ -966,7 +971,7 @@ void CGUITable::draw()
// draw column background // draw column background
skin->draw3DButtonPaneStandard(this, columnrect, &tableClip); skin->draw3DButtonPaneStandard(this, columnrect, &tableClip);
// draw column seperator // draw column separator
if ( DrawFlags & EGTDF_COLUMNS ) if ( DrawFlags & EGTDF_COLUMNS )
{ {
columnSeparator.UpperLeftCorner.X = pos; columnSeparator.UpperLeftCorner.X = pos;

View File

@ -179,8 +179,8 @@ namespace gui
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_;
protected: protected:
virtual void refreshControls(); void refreshControls();
virtual void checkScrollbars(); void checkScrollbars();
private: private:
@ -240,6 +240,7 @@ namespace gui
s32 ActiveTab; s32 ActiveTab;
EGUI_ORDERING_MODE CurrentOrdering; EGUI_ORDERING_MODE CurrentOrdering;
s32 DrawFlags; s32 DrawFlags;
s32 ScrollBarSize;
gui::IGUIFont* OverrideFont; gui::IGUIFont* OverrideFont;
}; };

View File

@ -432,6 +432,7 @@ CGUITreeView::CGUITreeView(IGUIEnvironment* environment, IGUIElement* parent,
IndentWidth( 0 ), IndentWidth( 0 ),
TotalItemHeight( 0 ), TotalItemHeight( 0 ),
TotalItemWidth ( 0 ), TotalItemWidth ( 0 ),
ScrollBarSize( 0 ),
Font( 0 ), Font( 0 ),
OverrideFont( 0 ), OverrideFont( 0 ),
IconFont( 0 ), IconFont( 0 ),
@ -450,15 +451,15 @@ CGUITreeView::CGUITreeView(IGUIEnvironment* environment, IGUIElement* parent,
#endif #endif
IGUISkin* skin = Environment->getSkin(); IGUISkin* skin = Environment->getSkin();
s32 s = skin->getSize( EGDS_SCROLLBAR_SIZE ); ScrollBarSize = skin->getSize( EGDS_SCROLLBAR_SIZE );
if ( scrollBarVertical ) if ( scrollBarVertical )
{ {
ScrollBarV = new CGUIScrollBar( false, Environment, this, -1, ScrollBarV = new CGUIScrollBar( false, Environment, this, -1,
core::rect<s32>( RelativeRect.getWidth() - s, core::rect<s32>( RelativeRect.getWidth() - ScrollBarSize,
0, 0,
RelativeRect.getWidth(), RelativeRect.getWidth(),
RelativeRect.getHeight() - s RelativeRect.getHeight() - ScrollBarSize
), !clip ); ), !clip );
ScrollBarV->drop(); ScrollBarV->drop();
@ -471,8 +472,8 @@ CGUITreeView::CGUITreeView(IGUIEnvironment* environment, IGUIElement* parent,
{ {
ScrollBarH = new CGUIScrollBar( true, Environment, this, -1, ScrollBarH = new CGUIScrollBar( true, Environment, this, -1,
core::rect<s32>( 0, core::rect<s32>( 0,
RelativeRect.getHeight() - s, RelativeRect.getHeight() - ScrollBarSize,
RelativeRect.getWidth() - s, RelativeRect.getWidth() - ScrollBarSize,
RelativeRect.getHeight() RelativeRect.getHeight()
), !clip ); ), !clip );
ScrollBarH->drop(); ScrollBarH->drop();
@ -640,6 +641,28 @@ void CGUITreeView::recalculateItemHeight()
} }
void CGUITreeView::updateScrollBarSize(s32 size)
{
if ( size != ScrollBarSize )
{
ScrollBarSize = size;
if ( ScrollBarV )
{
core::recti r(RelativeRect.getWidth() - ScrollBarSize, 0,
RelativeRect.getWidth(), RelativeRect.getHeight() - ScrollBarSize);
ScrollBarV->setRelativePosition(r);
}
if ( ScrollBarH )
{
core::recti r(0, RelativeRect.getHeight() - ScrollBarSize,
RelativeRect.getWidth() - ScrollBarSize, RelativeRect.getHeight());
ScrollBarH->setRelativePosition(r);
}
}
}
//! called if an event happened. //! called if an event happened.
bool CGUITreeView::OnEvent( const SEvent &event ) bool CGUITreeView::OnEvent( const SEvent &event )
{ {
@ -829,9 +852,11 @@ void CGUITreeView::draw()
return; return;
} }
IGUISkin* skin = Environment->getSkin();
updateScrollBarSize(skin->getSize(EGDS_SCROLLBAR_SIZE));
recalculateItemHeight(); // if the font changed recalculateItemHeight(); // if the font changed
IGUISkin* skin = Environment->getSkin();
irr::video::IVideoDriver* driver = Environment->getVideoDriver(); irr::video::IVideoDriver* driver = Environment->getVideoDriver();
core::rect<s32>* clipRect = 0; core::rect<s32>* clipRect = 0;
@ -876,9 +901,9 @@ void CGUITreeView::draw()
clientClip.LowerRightCorner.Y -= 1; clientClip.LowerRightCorner.Y -= 1;
if ( ScrollBarV ) if ( ScrollBarV )
clientClip.LowerRightCorner.X -= skin->getSize( EGDS_SCROLLBAR_SIZE ); clientClip.LowerRightCorner.X -= ScrollBarSize;
if ( ScrollBarH ) if ( ScrollBarH )
clientClip.LowerRightCorner.Y -= skin->getSize( EGDS_SCROLLBAR_SIZE ); clientClip.LowerRightCorner.Y -= ScrollBarSize;
if( clipRect ) if( clipRect )
{ {
@ -886,7 +911,7 @@ void CGUITreeView::draw()
} }
frameRect = AbsoluteRect; frameRect = AbsoluteRect;
frameRect.LowerRightCorner.X = AbsoluteRect.LowerRightCorner.X - skin->getSize( EGDS_SCROLLBAR_SIZE ); frameRect.LowerRightCorner.X = AbsoluteRect.LowerRightCorner.X - ScrollBarSize;
frameRect.LowerRightCorner.Y = AbsoluteRect.UpperLeftCorner.Y + ItemHeight; frameRect.LowerRightCorner.Y = AbsoluteRect.UpperLeftCorner.Y + ItemHeight;
if ( ScrollBarV ) if ( ScrollBarV )

View File

@ -320,6 +320,9 @@ namespace gui
//! calculates the heigth of an node and of all visible nodes. //! calculates the heigth of an node and of all visible nodes.
void recalculateItemHeight(); void recalculateItemHeight();
//! Resize scrollbars when their size in the skin has changed
void updateScrollBarSize(s32 size);
//! executes an mouse action (like selectNew of CGUIListBox) //! executes an mouse action (like selectNew of CGUIListBox)
void mouseAction( s32 xpos, s32 ypos, bool onlyHover = false ); void mouseAction( s32 xpos, s32 ypos, bool onlyHover = false );
@ -329,6 +332,7 @@ namespace gui
s32 IndentWidth; s32 IndentWidth;
s32 TotalItemHeight; s32 TotalItemHeight;
s32 TotalItemWidth; s32 TotalItemWidth;
s32 ScrollBarSize;
IGUIFont* Font; IGUIFont* Font;
gui::IGUIFont* OverrideFont; gui::IGUIFont* OverrideFont;
IGUIFont* IconFont; IGUIFont* IconFont;