From 036df13f60e4d5c4e30d92c09fa376c147a68e9c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Oct 2016 01:58:12 +0300 Subject: Add option to show player name only for selected player. --- src/gui/widgets/tabs/setup_players.cpp | 22 +++++++++++++++++++--- src/gui/widgets/tabs/setup_players.h | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/widgets/tabs/setup_players.cpp b/src/gui/widgets/tabs/setup_players.cpp index 0ed677af0..4f6daa272 100644 --- a/src/gui/widgets/tabs/setup_players.cpp +++ b/src/gui/widgets/tabs/setup_players.cpp @@ -51,9 +51,22 @@ static const char *const badgesList[] = N_("show at bottom"), }; +static const int visibleNamesListSize = 3; + +static const char *const visibleNamesList[] = +{ + // TRANSLATORS: visible name type + N_("hide"), + // TRANSLATORS: visible name type + N_("show"), + // TRANSLATORS: visible name type + N_("show on selection") +}; + Setup_Players::Setup_Players(const Widget2 *const widget) : SetupTabScroll(widget), - mBadgesList(new NamesModel) + mBadgesList(new NamesModel), + mVisibleNamesList(new NamesModel) { // TRANSLATORS: settings tab name setName(_("Players")); @@ -82,9 +95,12 @@ Setup_Players::Setup_Players(const Widget2 *const widget) : new SetupItemCheckBox(_("Target dead players"), "", "targetDeadPlayers", this, "targetDeadPlayersEvent"); + mVisibleNamesList->fillFromArray(&visibleNamesList[0], + visibleNamesListSize); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Visible names"), "", - "visiblenames", this, "visiblenamesEvent"); + new SetupItemDropDown(_("Show player names"), "", + "visiblenames", this, "visiblenamesEvent", + mVisibleNamesList, 150); // TRANSLATORS: settings option new SetupItemCheckBox(_("Auto move names"), "", diff --git a/src/gui/widgets/tabs/setup_players.h b/src/gui/widgets/tabs/setup_players.h index c2fe43ba6..efc8e6ecd 100644 --- a/src/gui/widgets/tabs/setup_players.h +++ b/src/gui/widgets/tabs/setup_players.h @@ -42,6 +42,7 @@ class Setup_Players final : public SetupTabScroll private: NamesModel *mBadgesList; + NamesModel *mVisibleNamesList; }; #endif // GUI_WIDGETS_TABS_SETUP_PLAYERS_H -- cgit v1.2.3-70-g09d2