mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Main menu buttons are now defined using position of their center
Fixes positioning of main menu buttons in localized versions of the game
This commit is contained in:
@ -236,7 +236,13 @@ std::shared_ptr<CButton> CMenuEntry::createButton(CMenuScreen * parent, const Js
|
||||
if(posy < 0)
|
||||
posy = pos.h + posy;
|
||||
|
||||
return std::make_shared<CButton>(Point(posx, posy), button["name"].String(), help, command, (int)button["hotkey"].Float());
|
||||
auto result = std::make_shared<CButton>(Point(posx, posy), button["name"].String(), help, command, (int)button["hotkey"].Float());
|
||||
|
||||
if (button["center"].Bool())
|
||||
result->moveBy(Point(-result->pos.w/2, -result->pos.h/2));
|
||||
return result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
CMenuEntry::CMenuEntry(CMenuScreen * parent, const JsonNode & config)
|
||||
|
Reference in New Issue
Block a user