Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Clean Nuclear Fallout" to "Unit Controls" widget #2274

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions client/hudwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,13 @@ int unit_actions::update_actions()
SC_NUKE));
}

// Clean nuclear fallout
if (can_unit_do_activity(current_unit, ACTIVITY_FALLOUT)) {
actions.append(new hud_action(
this, fcIcons::instance()->getIcon(QStringLiteral("fallout")),
SC_FALLOUT));
}

// Wait
actions.append(new hud_action(
this, fcIcons::instance()->getIcon(QStringLiteral("wait")), SC_WAIT));
Expand Down
2 changes: 1 addition & 1 deletion client/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ void mr_menu::setup_menus()
connect(act, &QAction::triggered, this, &mr_menu::slot_clean_pollution);
act = menu->addAction(_("Clean Nuclear Fallout"));
menu_list.insert(FALLOUT, act);
act->setShortcut(QKeySequence(tr("n")));
shortcuts->link_action(SC_FALLOUT, act);
connect(act, &QAction::triggered, this, &mr_menu::slot_clean_fallout);
act = menu->addAction(
QString(action_id_name_translation(ACTION_HELP_WONDER)));
Expand Down
4 changes: 3 additions & 1 deletion client/shortcuts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ static std::vector<fc_shortcut> default_shortcuts()
{SC_GOJOINCITY, fc_shortcut::keyboard, Qt::Key_J | Qt::ShiftModifier,
Qt::AllButtons, Qt::NoModifier, _("Go And Join City")},
{SC_PILLAGE, fc_shortcut::keyboard, Qt::Key_P | Qt::ShiftModifier,
Qt::AllButtons, Qt::NoModifier, _("Pillage")}};
Qt::AllButtons, Qt::NoModifier, _("Pillage")},
{SC_FALLOUT, fc_shortcut::keyboard, Qt::Key_N, Qt::AllButtons,
Qt::NoModifier, _("Clean Nuclear Fallout")}};
}

/**
Expand Down
1 change: 1 addition & 0 deletions client/shortcuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ enum shortcut_id {
SC_GOBUILDCITY = 57,
SC_GOJOINCITY = 58,
SC_PILLAGE = 59,
SC_FALLOUT = 60,
};

/**************************************************************************
Expand Down
1 change: 1 addition & 0 deletions data/themes/icons/fallout.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions data/themes/icons/fallout.svg.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SPDX-License-Identifier: CC-BY-SA-3.0
SPDX-FileCopyrightText: Petar Marjanovic
SPDX-FileCopyrightText: 2016 ChNPP
SPDX-FileCopyrightText: 2024 Tobias Rehbein
6 changes: 6 additions & 0 deletions docs/Manuals/Game/shortcut-options.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.. SPDX-License-Identifier: GPL-3.0-or-later
.. SPDX-FileCopyrightText: James Robertson <[email protected]>
.. SPDX-FileCopyrightText: Tobias Rehbein <[email protected]>

.. Custom Interpretive Text Roles for longturn.net/Freeciv21
.. role:: unit
Expand Down Expand Up @@ -360,3 +361,8 @@ Pillage
Instruct a unit to pillage infrastructure improvements on a tile.

Default: ``Shift+P``

Clean Nuclear Fallout
Instruct a unit to clean nuclear fallout on a tile.

Default: ``N``
Loading