1195 Multiplayer kart selection commit 18
This commit is contained in:
parent
de7d0aa995
commit
c5d23f7154
@ -145,6 +145,7 @@ when the border that intersect at this corner are enabled.
|
||||
left_border="110" right_border="110" top_border="0" bottom_border="36"
|
||||
preserve_h_aspect_ratios="true" hborder_out_portion="0.0" />
|
||||
|
||||
|
||||
<!-- This one is a bit special. Only area(s) LEFT and/or RIGHT will be rendered. They will be overlaid
|
||||
on top of the spinner's background -->
|
||||
<element type="spinner" state="down" image="ocean/glassspinner_down.png"
|
||||
|
@ -260,10 +260,10 @@ void BoxRenderParams::calculateYFlipIfNeeded()
|
||||
if (m_y_flip_set) return;
|
||||
|
||||
#define FLIP_Y( X ) { const int y1 = X.UpperLeftCorner.Y; \
|
||||
const int y2 = X.LowerRightCorner.Y; \
|
||||
X##_yflip = X; \
|
||||
X##_yflip.UpperLeftCorner.Y = y2;\
|
||||
X##_yflip.LowerRightCorner.Y = y1;}
|
||||
const int y2 = X.LowerRightCorner.Y; \
|
||||
X##_yflip = X; \
|
||||
X##_yflip.UpperLeftCorner.Y = y2;\
|
||||
X##_yflip.LowerRightCorner.Y = y1;}
|
||||
|
||||
FLIP_Y(m_source_area_left)
|
||||
FLIP_Y(m_source_area_center)
|
||||
@ -533,11 +533,11 @@ void Skin::drawBoxFromStretchableTexture(SkinWidgetContainer* w,
|
||||
{
|
||||
#define FLIP_Y( X ) { const int y1 = X.UpperLeftCorner.Y \
|
||||
- w->m_skin_dest_y; \
|
||||
const int y2 = X.LowerRightCorner.Y - w->m_skin_dest_y; \
|
||||
X##_yflip = X; \
|
||||
X##_yflip.UpperLeftCorner.Y = w->m_skin_dest_y + \
|
||||
const int y2 = X.LowerRightCorner.Y - w->m_skin_dest_y; \
|
||||
X##_yflip = X; \
|
||||
X##_yflip.UpperLeftCorner.Y = w->m_skin_dest_y + \
|
||||
(w->m_skin_dest_y2 - w->m_skin_dest_y) - y2;\
|
||||
X##_yflip.LowerRightCorner.Y = w->m_skin_dest_y + \
|
||||
X##_yflip.LowerRightCorner.Y = w->m_skin_dest_y + \
|
||||
(w->m_skin_dest_y2 - w->m_skin_dest_y) - y1;}
|
||||
|
||||
FLIP_Y(w->m_skin_dest_area_left)
|
||||
@ -1230,7 +1230,6 @@ void Skin::drawSpinnerBody(const core::recti &rect, Widget* widget,
|
||||
SpinnerWidget* q = dynamic_cast<SpinnerWidget*>(widget);
|
||||
if(q->getUseBackgroundColor())
|
||||
{
|
||||
|
||||
int player_id=q->getSpinnerWidgetPlayerID();
|
||||
if(player_id==0)
|
||||
params=SkinConfig::m_render_params["spinner1::neutral"];
|
||||
@ -1396,7 +1395,7 @@ void Skin::drawSpinnerChild(const core::recti &rect, Widget* widget,
|
||||
// ----------------------------------------------------------------------------
|
||||
/**
|
||||
* @param focused whether this element is focus by the master player (focus for
|
||||
* other players is not supported)
|
||||
* other players is not supported)
|
||||
*/
|
||||
void Skin::drawIconButton(const core::recti &rect, Widget* widget,
|
||||
const bool pressed, bool focused)
|
||||
@ -1514,7 +1513,7 @@ void Skin::drawIconButton(const core::recti &rect, Widget* widget,
|
||||
// ----------------------------------------------------------------------------
|
||||
/**
|
||||
* @param focused whether this element is focus by the master player (focus
|
||||
* for other players is not supported)
|
||||
* for other players is not supported)
|
||||
*/
|
||||
void Skin::drawCheckBox(const core::recti &rect, Widget* widget, bool focused)
|
||||
{
|
||||
@ -1578,7 +1577,7 @@ void Skin::drawList(const core::recti &rect, Widget* widget, bool focused)
|
||||
// ----------------------------------------------------------------------------
|
||||
/**
|
||||
* @param focused whether this element is focus by the master player (focus for
|
||||
* other players is not supported)
|
||||
* other players is not supported)
|
||||
*/
|
||||
void Skin::drawListSelection(const core::recti &rect, Widget* widget,
|
||||
bool focused, const core::recti *clip)
|
||||
|
@ -80,41 +80,41 @@ using namespace irr;
|
||||
You can thus give different looks for different states. Not all widgets
|
||||
support all states, see entries and comments below to know what's
|
||||
supported. Note that checkboxes are an exception and have the following
|
||||
styles :
|
||||
\li \lc "neutral+unchecked"
|
||||
\li \lc "neutral+checked"
|
||||
\li \lc "focused+unchecked"
|
||||
\li \lc "focused+checked"
|
||||
styles :
|
||||
\li \lc "neutral+unchecked"
|
||||
\li \lc "neutral+checked"
|
||||
\li \lc "focused+unchecked"
|
||||
\li \lc "focused+checked"
|
||||
|
||||
\section stretch Advanced stretching
|
||||
"Advanced stretching" images are split this way :
|
||||
\section stretch Advanced stretching
|
||||
"Advanced stretching" images are split this way :
|
||||
|
||||
\code
|
||||
+----+--------------------+----+
|
||||
| | | |
|
||||
+----+--------------------+----+
|
||||
| | | |
|
||||
| | | |
|
||||
| | | |
|
||||
+----+--------------------+----+
|
||||
| | | |
|
||||
+----+--------------------+----+
|
||||
\endcode
|
||||
\code
|
||||
+----+--------------------+----+
|
||||
| | | |
|
||||
+----+--------------------+----+
|
||||
| | | |
|
||||
| | | |
|
||||
| | | |
|
||||
+----+--------------------+----+
|
||||
| | | |
|
||||
+----+--------------------+----+
|
||||
\endcode
|
||||
|
||||
The center border will be stretched in all directions. The 4 corners will not
|
||||
stretch at all. Horizontal borders will stretch horizontally, vertical
|
||||
borders will stretch vertically. Use properties left_border="X"
|
||||
right_border="X" top_border="X" bottom_border="X" to specify the size of each
|
||||
border in pixels (setting all borders to '0' makes the whole image scaled).
|
||||
The center border will be stretched in all directions. The 4 corners will not
|
||||
stretch at all. Horizontal borders will stretch horizontally, vertical
|
||||
borders will stretch vertically. Use properties left_border="X"
|
||||
right_border="X" top_border="X" bottom_border="X" to specify the size of each
|
||||
border in pixels (setting all borders to '0' makes the whole image scaled).
|
||||
|
||||
In some cases, you may not want vertical stretching to occur (like if the left
|
||||
and right sides of the image must not be stretched vertically, e.g. for the
|
||||
spinner). In this case, pass parameter preserve_h_aspect_ratios="true" to
|
||||
make the left and right areas stretch by keeping their aspect ratio.
|
||||
In some cases, you may not want vertical stretching to occur (like if the left
|
||||
and right sides of the image must not be stretched vertically, e.g. for the
|
||||
spinner). In this case, pass parameter preserve_h_aspect_ratios="true" to
|
||||
make the left and right areas stretch by keeping their aspect ratio.
|
||||
|
||||
Some components may fill the full inner area with stuff; others will only take
|
||||
a smaller area at the center. To adjust for this, there are properties
|
||||
"hborder_out_portion" and "vborder_out_portion" that take a float from 0 to 1,
|
||||
Some components may fill the full inner area with stuff; others will only take
|
||||
a smaller area at the center. To adjust for this, there are properties
|
||||
"hborder_out_portion" and "vborder_out_portion" that take a float from 0 to 1,
|
||||
representing the percentage of each border that goes out of the widget's area
|
||||
(this might include stuff like shadows, etc.). The 'h' one is for horizontal
|
||||
borders, the 'v' one is for vertical borders.
|
||||
@ -127,10 +127,10 @@ a smaller area at the center. To adjust for this, there are properties
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
namespace GUIEngine
|
||||
namespace GUIEngine
|
||||
{
|
||||
/**
|
||||
* In order to avoid calculating render information every frame, it's
|
||||
|
@ -69,7 +69,7 @@ namespace GUIEngine
|
||||
*/
|
||||
bool m_gauge;
|
||||
|
||||
//for setting background in multiplayer kart selection screen
|
||||
//for setting background
|
||||
bool m_use_background_color;
|
||||
int m_spinner_widget_player_id;
|
||||
|
||||
@ -97,7 +97,8 @@ namespace GUIEngine
|
||||
|
||||
/** Call only if this spinner is graphical. Returns the current texture to display */
|
||||
irr::video::ITexture* getTexture();
|
||||
|
||||
// to set the background image
|
||||
// irr::video::ITexture* getBackgroundColor();
|
||||
|
||||
public:
|
||||
|
||||
@ -117,6 +118,7 @@ namespace GUIEngine
|
||||
int getSpinnerWidgetPlayerID() {return m_spinner_widget_player_id;}
|
||||
|
||||
|
||||
|
||||
void setListener(ISpinnerConfirmListener* listener) { m_listener = listener; }
|
||||
|
||||
/** \brief implement method from base class Widget */
|
||||
|
@ -986,10 +986,10 @@ void KartSelectionScreen::init()
|
||||
|
||||
/*
|
||||
|
||||
TODO: Ultimately, it'd be nice to *not* clear m_kart_widgets so that
|
||||
when players return to the kart selection screen, it will appear as
|
||||
it did when they left (at least when returning from the track menu).
|
||||
Rebuilding the screen is a little tricky.
|
||||
TODO: Ultimately, it'd be nice to *not* clear m_kart_widgets so that
|
||||
when players return to the kart selection screen, it will appear as
|
||||
it did when they left (at least when returning from the track menu).
|
||||
Rebuilding the screen is a little tricky.
|
||||
|
||||
*/
|
||||
|
||||
|
@ -52,7 +52,7 @@ class KartSelectionScreen : public GUIEngine::Screen
|
||||
friend class KartHoverListener;
|
||||
friend class PlayerNameSpinner;
|
||||
friend class FocusDispatcher;
|
||||
protected:
|
||||
protected:
|
||||
/** Contains the custom widget shown for every player. (ref only since
|
||||
* we're adding them to a Screen, and the Screen will take ownership
|
||||
* of these widgets)
|
||||
@ -112,7 +112,7 @@ class KartSelectionScreen : public GUIEngine::Screen
|
||||
|
||||
/** Stores a pointer to the current selection screen */
|
||||
static KartSelectionScreen* m_instance_ptr;
|
||||
public:
|
||||
public:
|
||||
/** Returns the current instance */
|
||||
static KartSelectionScreen* getRunningInstance();
|
||||
|
||||
@ -177,7 +177,7 @@ class FocusDispatcher : public GUIEngine::Widget
|
||||
|
||||
bool m_is_initialised;
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
LEAK_CHECK()
|
||||
|
||||
@ -206,7 +206,7 @@ class PlayerNameSpinner : public GUIEngine::SpinnerWidget
|
||||
KartSelectionScreen* m_parent;
|
||||
//virtual EventPropagation focused(const int m_playerID) ;
|
||||
|
||||
public:
|
||||
public:
|
||||
PlayerNameSpinner(KartSelectionScreen* parent, const int playerID);
|
||||
// ------------------------------------------------------------------------
|
||||
void setID(const int m_playerID);
|
||||
@ -258,7 +258,7 @@ class PlayerKartWidget : public GUIEngine::Widget,
|
||||
long m_magic_number;
|
||||
#endif
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
LEAK_CHECK()
|
||||
|
||||
@ -353,7 +353,7 @@ class PlayerKartWidget : public GUIEngine::Widget,
|
||||
class KartHoverListener : public GUIEngine::DynamicRibbonHoverListener
|
||||
{
|
||||
KartSelectionScreen* m_parent;
|
||||
public:
|
||||
public:
|
||||
unsigned int m_magic_number;
|
||||
|
||||
KartHoverListener(KartSelectionScreen* parent);
|
||||
|
Loading…
x
Reference in New Issue
Block a user