1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

reduce to 12 with gap

This commit is contained in:
Laserlicht 2024-07-17 19:26:18 +02:00
parent 4415f645a7
commit e629b7a371
5 changed files with 8 additions and 24 deletions

View File

@ -450,7 +450,7 @@ void QuickSpellPanel::create()
if(!hero)
return;
for(int i = 0; i < 16; i++) {
for(int i = 0; i < 12; i++) {
std::string spellIdentifier = persistentStorage["quickSpell"][std::to_string(i)].String();
SpellID id;
@ -463,7 +463,7 @@ void QuickSpellPanel::create()
id = SpellID::NONE;
}
auto button = std::make_shared<CButton>(Point(2, 5 + 37 * i), AnimationPath::builtin("spellint"), CButton::tooltip(), [this, id, hero](){
auto button = std::make_shared<CButton>(Point(2, 7 + 50 * i), AnimationPath::builtin("spellint"), CButton::tooltip(), [this, id, hero](){
if(id.hasValue() && id.toSpell()->canBeCast(owner.getBattle().get(), spells::Mode::HERO, hero))
{
owner.castThisSpell(id);
@ -481,9 +481,9 @@ void QuickSpellPanel::create()
if(!id.hasValue() || !id.toSpell()->canBeCast(owner.getBattle().get(), spells::Mode::HERO, hero))
{
buttonsDisabled.push_back(std::make_shared<TransparentFilledRectangle>(Rect(2, 5 + 37 * i, 48, 36), ColorRGBA(0, 0, 0, 172)));
buttonsDisabled.push_back(std::make_shared<TransparentFilledRectangle>(Rect(2, 7 + 50 * i, 48, 36), ColorRGBA(0, 0, 0, 172)));
}
labels.push_back(std::make_shared<CLabel>(7, 8 + 37 * i, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, config["keyboard"]["battleSpellShortcut" + std::to_string(i)].String()));
labels.push_back(std::make_shared<CLabel>(7, 10 + 50 * i, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, config["keyboard"]["battleSpellShortcut" + std::to_string(i)].String()));
buttons.push_back(button);
}

View File

@ -77,10 +77,6 @@ BattleWindow::BattleWindow(BattleInterface & Owner):
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_9, [this](){ useSpellIfPossible(9); });
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_10, [this](){ useSpellIfPossible(10); });
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_11, [this](){ useSpellIfPossible(11); });
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_12, [this](){ useSpellIfPossible(12); });
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_13, [this](){ useSpellIfPossible(13); });
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_14, [this](){ useSpellIfPossible(14); });
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_15, [this](){ useSpellIfPossible(15); });
addShortcut(EShortcut::GLOBAL_OPTIONS, std::bind(&BattleWindow::bOptionsf, this));
addShortcut(EShortcut::BATTLE_SURRENDER, std::bind(&BattleWindow::bSurrenderf, this));

View File

@ -199,10 +199,6 @@ enum class EShortcut
BATTLE_SPELL_SHORTCUT_9,
BATTLE_SPELL_SHORTCUT_10,
BATTLE_SPELL_SHORTCUT_11,
BATTLE_SPELL_SHORTCUT_12,
BATTLE_SPELL_SHORTCUT_13,
BATTLE_SPELL_SHORTCUT_14,
BATTLE_SPELL_SHORTCUT_15,
MARKET_DEAL,
MARKET_MAX_AMOUNT,

View File

@ -235,10 +235,6 @@ EShortcut ShortcutHandler::findShortcut(const std::string & identifier ) const
{"battleSpellShortcut9", EShortcut::BATTLE_SPELL_SHORTCUT_9 },
{"battleSpellShortcut10", EShortcut::BATTLE_SPELL_SHORTCUT_10 },
{"battleSpellShortcut11", EShortcut::BATTLE_SPELL_SHORTCUT_11 },
{"battleSpellShortcut12", EShortcut::BATTLE_SPELL_SHORTCUT_12 },
{"battleSpellShortcut13", EShortcut::BATTLE_SPELL_SHORTCUT_13 },
{"battleSpellShortcut14", EShortcut::BATTLE_SPELL_SHORTCUT_14 },
{"battleSpellShortcut15", EShortcut::BATTLE_SPELL_SHORTCUT_15 },
{"spectateTrackHero", EShortcut::SPECTATE_TRACK_HERO },
{"spectateSkipBattle", EShortcut::SPECTATE_SKIP_BATTLE },
{"spectateSkipBattleResult", EShortcut::SPECTATE_SKIP_BATTLE_RESULT },

View File

@ -73,14 +73,10 @@
"battleSpellShortcut5": "6",
"battleSpellShortcut6": "7",
"battleSpellShortcut7": "8",
"battleSpellShortcut8": "Shift+1",
"battleSpellShortcut9": "Shift+2",
"battleSpellShortcut10": "Shift+3",
"battleSpellShortcut11": "Shift+4",
"battleSpellShortcut12": "Shift+5",
"battleSpellShortcut13": "Shift+6",
"battleSpellShortcut14": "Shift+7",
"battleSpellShortcut15": "Shift+8",
"battleSpellShortcut8": "9",
"battleSpellShortcut9": "0",
"battleSpellShortcut10": "N",
"battleSpellShortcut11": "M",
"battleSurrender": "S",
"battleTacticsEnd": [ "Return", "Keypad Enter"],
"battleTacticsNext": "Space",