mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-23 21:29:13 +02:00
mobile adjustments
This commit is contained in:
parent
b568e2f628
commit
b8d872aa60
@ -426,7 +426,7 @@ QuickSpellPanel::QuickSpellPanel(BattleInterface & owner)
|
|||||||
|
|
||||||
addUsedEvents(LCLICK | SHOW_POPUP | MOVE);
|
addUsedEvents(LCLICK | SHOW_POPUP | MOVE);
|
||||||
|
|
||||||
pos = Rect(0, 0, 52, 713);
|
pos = Rect(0, 0, 52, 600);
|
||||||
background = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), pos);
|
background = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), pos);
|
||||||
rect = std::make_shared<TransparentFilledRectangle>(Rect(0, 0, pos.w + 1, pos.h + 1), ColorRGBA(0, 0, 0, 0), ColorRGBA(241, 216, 120, 255));
|
rect = std::make_shared<TransparentFilledRectangle>(Rect(0, 0, pos.w + 1, pos.h + 1), ColorRGBA(0, 0, 0, 0), ColorRGBA(241, 216, 120, 255));
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ void QuickSpellPanel::create()
|
|||||||
if(!hero)
|
if(!hero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for(int i = 0; i < 19; i++) {
|
for(int i = 0; i < 16; i++) {
|
||||||
std::string spellIdentifier = persistentStorage["quickSpell"][std::to_string(i)].String();
|
std::string spellIdentifier = persistentStorage["quickSpell"][std::to_string(i)].String();
|
||||||
|
|
||||||
SpellID id;
|
SpellID id;
|
||||||
@ -458,7 +458,7 @@ void QuickSpellPanel::create()
|
|||||||
id = SpellID::NONE;
|
id = SpellID::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto button = std::make_shared<CButton>(Point(2, 6 + 37 * i), AnimationPath::builtin("spellint"), CButton::tooltip(), [this, id, hero](){
|
auto button = std::make_shared<CButton>(Point(2, 5 + 37 * i), AnimationPath::builtin("spellint"), CButton::tooltip(), [this, id, hero](){
|
||||||
if(id.hasValue() && id.toSpell()->canBeCast(owner.getBattle().get(), spells::Mode::HERO, hero))
|
if(id.hasValue() && id.toSpell()->canBeCast(owner.getBattle().get(), spells::Mode::HERO, hero))
|
||||||
{
|
{
|
||||||
owner.castThisSpell(id);
|
owner.castThisSpell(id);
|
||||||
@ -468,15 +468,15 @@ void QuickSpellPanel::create()
|
|||||||
button->addPopupCallback([this, i](){
|
button->addPopupCallback([this, i](){
|
||||||
auto panelSelect = std::make_shared<QuickSpellPanelSelect>(this);
|
auto panelSelect = std::make_shared<QuickSpellPanelSelect>(this);
|
||||||
panelSelect->spellSlot = i;
|
panelSelect->spellSlot = i;
|
||||||
panelSelect->moveTo(Point(pos.x + 54, pos.y + 5));
|
panelSelect->moveTo(Point(pos.x + 54, pos.y + 4));
|
||||||
GH.windows().pushWindow(panelSelect);
|
GH.windows().pushWindow(panelSelect);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!id.hasValue() || !id.toSpell()->canBeCast(owner.getBattle().get(), spells::Mode::HERO, hero))
|
if(!id.hasValue() || !id.toSpell()->canBeCast(owner.getBattle().get(), spells::Mode::HERO, hero))
|
||||||
{
|
{
|
||||||
buttonsDisabled.push_back(std::make_shared<TransparentFilledRectangle>(Rect(2, 6 + 37 * i, 48, 36), ColorRGBA(0, 0, 0, 172)));
|
buttonsDisabled.push_back(std::make_shared<TransparentFilledRectangle>(Rect(2, 5 + 37 * i, 48, 36), ColorRGBA(0, 0, 0, 172)));
|
||||||
}
|
}
|
||||||
labels.push_back(std::make_shared<CLabel>(7, 9 + 37 * i, EFonts::FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, std::to_string(i)));
|
labels.push_back(std::make_shared<CLabel>(7, 8 + 37 * i, EFonts::FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, std::to_string(i)));
|
||||||
|
|
||||||
buttons.push_back(button);
|
buttons.push_back(button);
|
||||||
}
|
}
|
||||||
@ -529,7 +529,7 @@ QuickSpellPanelSelect::QuickSpellPanelSelect(QuickSpellPanel * Parent)
|
|||||||
|
|
||||||
void QuickSpellPanelSelect::clickReleased(const Point & cursorPosition)
|
void QuickSpellPanelSelect::clickReleased(const Point & cursorPosition)
|
||||||
{
|
{
|
||||||
if(!pos.isInside(cursorPosition))
|
if(!pos.isInside(cursorPosition) && !parent->pos.isInside(cursorPosition))
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ public:
|
|||||||
class QuickSpellPanelSelect : public CWindowObject
|
class QuickSpellPanelSelect : public CWindowObject
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
const int NUM_PER_COLUMN = 19;
|
const int NUM_PER_COLUMN = 16;
|
||||||
|
|
||||||
std::shared_ptr<CFilledTexture> background;
|
std::shared_ptr<CFilledTexture> background;
|
||||||
std::shared_ptr<TransparentFilledRectangle> rect;
|
std::shared_ptr<TransparentFilledRectangle> rect;
|
||||||
|
@ -81,25 +81,22 @@ BattleWindow::BattleWindow(BattleInterface & Owner):
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
addShortcut(EShortcut::BATTLE_TOGGLE_QUICKSPELL, [this](){ this->toggleStickyQuickSpellVisibility();});
|
addShortcut(EShortcut::BATTLE_TOGGLE_QUICKSPELL, [this](){ this->toggleStickyQuickSpellVisibility();});
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_0, [useSpellIfPossible](){ useSpellIfPossible(0); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_0, [useSpellIfPossible](){ useSpellIfPossible(0); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_1, [useSpellIfPossible](){ useSpellIfPossible(1); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_1, [useSpellIfPossible](){ useSpellIfPossible(1); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_2, [useSpellIfPossible](){ useSpellIfPossible(2); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_2, [useSpellIfPossible](){ useSpellIfPossible(2); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_3, [useSpellIfPossible](){ useSpellIfPossible(3); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_3, [useSpellIfPossible](){ useSpellIfPossible(3); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_4, [useSpellIfPossible](){ useSpellIfPossible(4); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_4, [useSpellIfPossible](){ useSpellIfPossible(4); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_5, [useSpellIfPossible](){ useSpellIfPossible(5); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_5, [useSpellIfPossible](){ useSpellIfPossible(5); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_6, [useSpellIfPossible](){ useSpellIfPossible(6); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_6, [useSpellIfPossible](){ useSpellIfPossible(6); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_7, [useSpellIfPossible](){ useSpellIfPossible(7); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_7, [useSpellIfPossible](){ useSpellIfPossible(7); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_8, [useSpellIfPossible](){ useSpellIfPossible(8); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_8, [useSpellIfPossible](){ useSpellIfPossible(8); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_9, [useSpellIfPossible](){ useSpellIfPossible(9); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_9, [useSpellIfPossible](){ useSpellIfPossible(9); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_10, [useSpellIfPossible](){ useSpellIfPossible(10); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_10, [useSpellIfPossible](){ useSpellIfPossible(10); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_11, [useSpellIfPossible](){ useSpellIfPossible(11); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_11, [useSpellIfPossible](){ useSpellIfPossible(11); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_12, [useSpellIfPossible](){ useSpellIfPossible(12); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_12, [useSpellIfPossible](){ useSpellIfPossible(12); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_13, [useSpellIfPossible](){ useSpellIfPossible(13); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_13, [useSpellIfPossible](){ useSpellIfPossible(13); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_14, [useSpellIfPossible](){ useSpellIfPossible(14); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_14, [useSpellIfPossible](){ useSpellIfPossible(14); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_15, [useSpellIfPossible](){ useSpellIfPossible(15); });
|
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_15, [useSpellIfPossible](){ useSpellIfPossible(15); });
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_16, [useSpellIfPossible](){ useSpellIfPossible(16); });
|
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_17, [useSpellIfPossible](){ useSpellIfPossible(17); });
|
|
||||||
addShortcut(EShortcut::BATTLE_SPELL_SHORTCUT_18, [useSpellIfPossible](){ useSpellIfPossible(18); });
|
|
||||||
|
|
||||||
addShortcut(EShortcut::GLOBAL_OPTIONS, std::bind(&BattleWindow::bOptionsf, this));
|
addShortcut(EShortcut::GLOBAL_OPTIONS, std::bind(&BattleWindow::bOptionsf, this));
|
||||||
addShortcut(EShortcut::BATTLE_SURRENDER, std::bind(&BattleWindow::bSurrenderf, this));
|
addShortcut(EShortcut::BATTLE_SURRENDER, std::bind(&BattleWindow::bSurrenderf, this));
|
||||||
@ -207,7 +204,7 @@ void BattleWindow::createQuickSpellWindow()
|
|||||||
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
||||||
|
|
||||||
quickSpellWindow = std::make_shared<QuickSpellPanel>(owner);
|
quickSpellWindow = std::make_shared<QuickSpellPanel>(owner);
|
||||||
quickSpellWindow->moveTo(Point(pos.x - 68, pos.y - 14));
|
quickSpellWindow->moveTo(Point(pos.x - 67, pos.y - 1));
|
||||||
|
|
||||||
if(settings["battle"]["enableQuickSpellPanel"].Bool())
|
if(settings["battle"]["enableQuickSpellPanel"].Bool())
|
||||||
showStickyQuickSpellWindow();
|
showStickyQuickSpellWindow();
|
||||||
|
@ -203,9 +203,6 @@ enum class EShortcut
|
|||||||
BATTLE_SPELL_SHORTCUT_13,
|
BATTLE_SPELL_SHORTCUT_13,
|
||||||
BATTLE_SPELL_SHORTCUT_14,
|
BATTLE_SPELL_SHORTCUT_14,
|
||||||
BATTLE_SPELL_SHORTCUT_15,
|
BATTLE_SPELL_SHORTCUT_15,
|
||||||
BATTLE_SPELL_SHORTCUT_16,
|
|
||||||
BATTLE_SPELL_SHORTCUT_17,
|
|
||||||
BATTLE_SPELL_SHORTCUT_18,
|
|
||||||
|
|
||||||
MARKET_DEAL,
|
MARKET_DEAL,
|
||||||
MARKET_MAX_AMOUNT,
|
MARKET_MAX_AMOUNT,
|
||||||
|
@ -239,9 +239,6 @@ EShortcut ShortcutHandler::findShortcut(const std::string & identifier ) const
|
|||||||
{"battleSpellShortcut13", EShortcut::BATTLE_SPELL_SHORTCUT_13 },
|
{"battleSpellShortcut13", EShortcut::BATTLE_SPELL_SHORTCUT_13 },
|
||||||
{"battleSpellShortcut14", EShortcut::BATTLE_SPELL_SHORTCUT_14 },
|
{"battleSpellShortcut14", EShortcut::BATTLE_SPELL_SHORTCUT_14 },
|
||||||
{"battleSpellShortcut15", EShortcut::BATTLE_SPELL_SHORTCUT_15 },
|
{"battleSpellShortcut15", EShortcut::BATTLE_SPELL_SHORTCUT_15 },
|
||||||
{"battleSpellShortcut16", EShortcut::BATTLE_SPELL_SHORTCUT_16 },
|
|
||||||
{"battleSpellShortcut17", EShortcut::BATTLE_SPELL_SHORTCUT_17 },
|
|
||||||
{"battleSpellShortcut18", EShortcut::BATTLE_SPELL_SHORTCUT_18 },
|
|
||||||
{"spectateTrackHero", EShortcut::SPECTATE_TRACK_HERO },
|
{"spectateTrackHero", EShortcut::SPECTATE_TRACK_HERO },
|
||||||
{"spectateSkipBattle", EShortcut::SPECTATE_SKIP_BATTLE },
|
{"spectateSkipBattle", EShortcut::SPECTATE_SKIP_BATTLE },
|
||||||
{"spectateSkipBattleResult", EShortcut::SPECTATE_SKIP_BATTLE_RESULT },
|
{"spectateSkipBattleResult", EShortcut::SPECTATE_SKIP_BATTLE_RESULT },
|
||||||
|
@ -81,9 +81,6 @@
|
|||||||
"battleSpellShortcut13": "Shift+3",
|
"battleSpellShortcut13": "Shift+3",
|
||||||
"battleSpellShortcut14": "Shift+4",
|
"battleSpellShortcut14": "Shift+4",
|
||||||
"battleSpellShortcut15": "Shift+5",
|
"battleSpellShortcut15": "Shift+5",
|
||||||
"battleSpellShortcut16": "Shift+6",
|
|
||||||
"battleSpellShortcut17": "Shift+7",
|
|
||||||
"battleSpellShortcut18": "Shift+8",
|
|
||||||
"battleSurrender": "S",
|
"battleSurrender": "S",
|
||||||
"battleTacticsEnd": [ "Return", "Keypad Enter"],
|
"battleTacticsEnd": [ "Return", "Keypad Enter"],
|
||||||
"battleTacticsNext": "Space",
|
"battleTacticsNext": "Space",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user