1995 Multiplayer kart selection screen commit 14

This commit is contained in:
Dk 2014-03-05 20:16:48 +05:30
parent 72346ee101
commit 1dab0daeb5
7 changed files with 33 additions and 59 deletions

View File

@ -148,7 +148,6 @@ when the border that intersect at this corner are enabled.
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"

View File

@ -146,7 +146,6 @@ 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="peach/glassspinner_down.png"

View File

@ -1196,8 +1196,6 @@ void Skin::drawRibbonChild(const core::recti &rect, Widget* widget,
* the widget is focused for other players is automatically determined)
* FIXME: ugly to pass some focuses through parameter and others not xD
*/
void Skin::drawSpinnerBody(const core::recti &rect, Widget* widget,
const bool pressed, bool focused)
{
@ -1224,33 +1222,33 @@ void Skin::drawSpinnerBody(const core::recti &rect, Widget* widget,
}
}
BoxRenderParams& params = (focused || pressed)
? SkinConfig::m_render_params["spinner::focused"]
: SkinConfig::m_render_params["spinner::neutral"];
// defining params and spinner widget to use spinner widget functions
SpinnerWidget* q = dynamic_cast<SpinnerWidget*>(widget);
BoxRenderParams params;
if(q->getBackgroundColor()==1)
{
// defining a spinner widget to use the spinner widget class property(getBackgroundColor)
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"];
if(player_id==1)
params=SkinConfig::m_render_params["spinner2::neutral"];
if(player_id==2)
params=SkinConfig::m_render_params["spinner3::neutral"];
if(player_id==3)
params=SkinConfig::m_render_params["spinner4::neutral"];
}
else if (focused|| pressed)
{
params=SkinConfig::m_render_params["spinner1::neutral"];
else if(player_id==1)
params=SkinConfig::m_render_params["spinner2::neutral"];
else if(player_id==2)
params=SkinConfig::m_render_params["spinner3::neutral"];
else if(player_id==3)
params=SkinConfig::m_render_params["spinner4::neutral"];
}
else if (focused|| pressed)
{
params=SkinConfig::m_render_params["spinner::focused"];
}
else
{
}
else
{
params=SkinConfig::m_render_params["spinner::neutral"];
}
}
if (widget->isFocusedForPlayer(0))
{

View File

@ -406,9 +406,6 @@ namespace GUIEngine
virtual void setSize (gui::EGUI_DEFAULT_SIZE which, s32 size);
virtual void setSpriteBank (gui::IGUISpriteBank *bank);
// BoxRenderParams& setBackground(const core::recti &rect, Widget* widget,BoxRenderParams& params);
void drawTooltips();
video::ITexture* getImage(const char* name);

View File

@ -47,7 +47,6 @@ SpinnerWidget::SpinnerWidget(const bool gauge) : Widget(WTYPE_SPINNER)
m_value = -1;
m_use_background_color=false;
m_spinner_widget_player_id=-1;
m_min = 0;
m_max = 999;
}
@ -181,25 +180,7 @@ void SpinnerWidget::add()
setValue(m_value);
}
void SpinnerWidget::setBackgroundColor()
{
m_use_background_color=true;
}
bool SpinnerWidget::getBackgroundColor()
{
return m_use_background_color;
}
void SpinnerWidget::setSpinnerWidgetPlayerID(int playerID)
{
m_spinner_widget_player_id=playerID;
printf("spinnerwidgetplayerid=%d",m_spinner_widget_player_id);
}
int SpinnerWidget::getSpinnerWidgetPlayerID()
{
return m_spinner_widget_player_id;
}
ITexture* SpinnerWidget::getTexture()
{
assert(m_graphical);

View File

@ -69,7 +69,7 @@ namespace GUIEngine
*/
bool m_gauge;
//for setting background
//for setting background in multiplayer kart selection screen
bool m_use_background_color;
int m_spinner_widget_player_id;
@ -109,11 +109,12 @@ namespace GUIEngine
void addLabel(irr::core::stringw label);
void clearLabels();
// next four functions are for background colour behind playername in multikart screen selection
void setBackgroundColor();
bool getBackgroundColor();
void setSpinnerWidgetPlayerID(int playerID);
int getSpinnerWidgetPlayerID();
void setUseBackgroundColor() {m_use_background_color=true;}
bool getUseBackgroundColor() {return m_use_background_color;}
void setSpinnerWidgetPlayerID(int playerID) {m_spinner_widget_player_id=playerID;}
int getSpinnerWidgetPlayerID() {return m_spinner_widget_player_id;}
void setListener(ISpinnerConfirmListener* listener) { m_listener = listener; }

View File

@ -132,11 +132,10 @@ PlayerNameSpinner::PlayerNameSpinner(KartSelectionScreen* parent,
{
m_player_id = player_id;
m_incorrect = false;
m_red_mark_widget = NULL;
m_parent = parent;
m_use_background_color = true;
setBackgroundColor();//already a_use_background_color is false
setUseBackgroundColor();//except for multiplayer kart selection, this is false
setSpinnerWidgetPlayerID(m_player_id);
}
// ------------------------------------------------------------------------
@ -419,9 +418,9 @@ void PlayerKartWidget::setPlayerID(const int newPlayerID)
// restore previous focus, but with new player ID
if (focus != NULL) focus->setFocusForPlayer(m_player_id);
if (m_player_ident_spinner != NULL){
if (m_player_ident_spinner != NULL)
{
m_player_ident_spinner->setID(m_player_id);
}
} // setPlayerID