Revert "Change highscore limit from 3 to 5 (#3417)"

This reverts commit 84359ad7da.

It broke "Max players supported" text in arena info screen. It also doesn't work well for hidpi_enabled property that is used on android. Additionally it causes incompatibility with older STK versions (STK 0.9.3 crashes when there is more than 3 entries in hiscore.xml).

Fixes #3424
Fixes #3425
This commit is contained in:
Deve 2018-09-04 21:15:19 +02:00
parent 8f6daefc73
commit 0f1f876874
5 changed files with 23 additions and 35 deletions

View File

@ -2,12 +2,12 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="2%" y="2%" width="96%" height="98%" layout="vertical-row">
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row">
<header id="name" height="7%" width="80%" align="center" text_align="center"/>
<spacer width="1" height="1%"/>
<box width="100%" height="42%" padding="10" layout="horizontal-row">
<box width="100%" height="40%" padding="10" layout="horizontal-row">
<!-- Left pane -->
<div proportion="1" height="100%" layout="vertical-row">
<icon-button proportion="1" width="100%" height="100%" id="screenshot" custom_ratio="1.33333"/>
@ -24,7 +24,7 @@
<label id="highscore1" proportion="1" text="(Empty)"/>
</div>
<spacer width="1" height="1%"/>
<spacer width="1" height="2%"/>
<div width="95%" height="fit" layout="horizontal-row">
<icon id="iconscore2" icon="gui/random_kart.png" width="font" height="font"/>
@ -32,7 +32,7 @@
<label id="highscore2" proportion="1" text="(Empty)"/>
</div>
<spacer width="1" height="1%"/>
<spacer width="1" height="2%"/>
<div width="95%" height="fit" layout="horizontal-row">
<icon id="iconscore3" icon="gui/random_kart.png" width="font" height="font"/>
@ -40,22 +40,6 @@
<label id="highscore3" proportion="1" text="(Empty)"/>
</div>
<spacer width="1" height="1%"/>
<div width="95%" height="fit" layout="horizontal-row">
<icon id="iconscore4" icon="gui/random_kart.png" width="font" height="font"/>
<spacer width="2%" height="1"/>
<label id="highscore4" proportion="1" text="(Empty)"/>
</div>
<spacer width="1" height="1%"/>
<div width="95%" height="fit" layout="horizontal-row">
<icon id="iconscore5" icon="gui/random_kart.png" width="font" height="font"/>
<spacer width="2%" height="1"/>
<label id="highscore5" proportion="1" text="(Empty)"/>
</div>
<spacer width="1" height="2%"/>
<label id="author" width="100%" text_align="center" word_wrap="true"/>
@ -66,7 +50,7 @@
</box>
<spacer width="1" height="1%"/>
<box width="100%" height="32%" padding="15" layout="vertical-row">
<box width="100%" height="33%" padding="15" layout="vertical-row">
<div width="100%" height="fit" layout="horizontal-row" >
<label id="lap-text" proportion="1" I18N="In the track info screen" text="Number of laps" text_align="right"/>
<spacer width="40"/>
@ -106,7 +90,7 @@
<spacer width="1" height="1%"/>
</box>
<spacer width="1" height="1%"/>
<buttonbar id="buttons" height="14%" width="100%" align="center">
<buttonbar id="buttons" height="15%" width="100%" align="center">
<icon-button id="start" width="64" height="64" icon="gui/green_check.png"
I18N="In the track info screen" text="Start Race"/>

View File

@ -40,7 +40,7 @@ public:
typedef std::string HighscoreType;
private:
enum {HIGHSCORE_LEN = 5}; // It's a top 5 list
enum {HIGHSCORE_LEN = 3}; // It's a top 3 list
std::string m_track;
HighscoreType m_highscore_type;
int m_number_of_karts;

View File

@ -1582,7 +1582,7 @@ void RaceResultGUI::displayCTFResults()
}
int current_x = x;
current_y = y + (int)((i + 1) * m_distance_between_rows);
current_y = y + (int)((i + 1) * m_distance_between_rows * 1.5f);
const KartProperties* prop = kart_properties_manager->getKart(kart_name);
if (prop != NULL)

View File

@ -72,11 +72,13 @@ void TrackInfoScreen::loadedFromFile()
m_highscore_label = getWidget<LabelWidget>("highscores");
for (unsigned int i=0;i<HIGHSCORE_COUNT;i++)
{
m_kart_icons[i] = getWidget<IconButtonWidget>(("iconscore"+std::to_string(i+1)).c_str());
m_highscore_entries[i] = getWidget<LabelWidget>(("highscore"+std::to_string(i+1)).c_str());
}
m_kart_icons[0] = getWidget<IconButtonWidget>("iconscore1");
m_kart_icons[1] = getWidget<IconButtonWidget>("iconscore2");
m_kart_icons[2] = getWidget<IconButtonWidget>("iconscore3");
m_highscore_entries[0] = getWidget<LabelWidget>("highscore1");
m_highscore_entries[1] = getWidget<LabelWidget>("highscore2");
m_highscore_entries[2] = getWidget<LabelWidget>("highscore3");
GUIEngine::IconButtonWidget* screenshot = getWidget<IconButtonWidget>("screenshot");
screenshot->setFocusable(false);
@ -257,11 +259,13 @@ void TrackInfoScreen::init()
// ---- High Scores
m_highscore_label->setVisible(has_highscores);
for (unsigned int i=0;i<HIGHSCORE_COUNT;i++)
{
m_kart_icons[i]->setVisible(has_highscores);
m_highscore_entries[i]->setVisible(has_highscores);
}
m_kart_icons[0]->setVisible(has_highscores);
m_kart_icons[1]->setVisible(has_highscores);
m_kart_icons[2]->setVisible(has_highscores);
m_highscore_entries[0]->setVisible(has_highscores);
m_highscore_entries[1]->setVisible(has_highscores);
m_highscore_entries[2]->setVisible(has_highscores);
RibbonWidget* bt_start = getWidget<GUIEngine::RibbonWidget>("buttons");
bt_start->setFocusForPlayer(PLAYER_ID_GAME_MASTER);

View File

@ -39,7 +39,7 @@ class Track;
class TrackInfoScreen : public GUIEngine::Screen,
public GUIEngine::ScreenSingleton<TrackInfoScreen>
{
static const int HIGHSCORE_COUNT = 5;
static const int HIGHSCORE_COUNT = 3;
/** A pointer to the track of which the info is shown. */
Track *m_track;