From c250f28d374ac2afa22e4a13e35261dc894493d8 Mon Sep 17 00:00:00 2001 From: Pieter Hulshoff Date: Mon, 30 May 2016 10:45:04 +0200 Subject: [PATCH] Added support for adding the word Player or Players behind the number of players: - Use type "numberPlayersPlayers" or "numberPlayersRangePlayers" in the layout XML. - Examples: If number of players is 1: - type "numberPlayers" will print 1. - type "numberPlayersRange" will print 1. - type "numberPlayersPlayers" will print 1 Player. - type "numberPlayersRangePlayers" will print 1 Player. If number of players is 4: - type "numberPlayers" will print 4. - type "numberPlayersRange" will print 1-4. - type "numberPlayersPlayers" will print 4 Players. - type "numberPlayersRangePlayers" will print 1-4 Players. --- .../Graphics/Component/ReloadableText.cpp | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/RetroFE/Source/Graphics/Component/ReloadableText.cpp b/RetroFE/Source/Graphics/Component/ReloadableText.cpp index 4703f65..55b753a 100644 --- a/RetroFE/Source/Graphics/Component/ReloadableText.cpp +++ b/RetroFE/Source/Graphics/Component/ReloadableText.cpp @@ -127,6 +127,33 @@ void ReloadableText::ReloadTexture() else ss << selectedItem->numberPlayers; } + else if (type_ == "numberPlayersPlayers") + { + ss << selectedItem->numberPlayers; + if (selectedItem->numberPlayers != "") + { + if (selectedItem->numberPlayers == "1") + ss << " Player"; + else + ss << " Players"; + } + } + else if (type_ == "numberPlayersRangePlayers") + { + if (selectedItem->numberPlayers != "" && + selectedItem->numberPlayers != "0" && + selectedItem->numberPlayers != "1") + ss << "1-" << selectedItem->numberPlayers; + else + ss << selectedItem->numberPlayers; + if (selectedItem->numberPlayers != "") + { + if (selectedItem->numberPlayers == "1") + ss << " Player"; + else + ss << " Players"; + } + } else if (type_ == "numberJoyWays") { ss << selectedItem->joyWays;