mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Popup - Mapselection
This commit is contained in:
parent
280085b95d
commit
c28c0d2a13
@ -131,7 +131,7 @@ static ESortBy getSortBySelectionScreen(ESelectionScreen Type)
|
||||
}
|
||||
|
||||
SelectionTab::SelectionTab(ESelectionScreen Type)
|
||||
: CIntObject(LCLICK | KEYBOARD | DOUBLECLICK), callOnSelect(nullptr), tabType(Type), selectionPos(0), sortModeAscending(true), inputNameRect{32, 539, 350, 20}
|
||||
: CIntObject(LCLICK | SHOW_POPUP | KEYBOARD | DOUBLECLICK), callOnSelect(nullptr), tabType(Type), selectionPos(0), sortModeAscending(true), inputNameRect{32, 539, 350, 20}
|
||||
{
|
||||
OBJ_CONSTRUCTION;
|
||||
|
||||
@ -324,6 +324,22 @@ void SelectionTab::clickDouble(const Point & cursorPosition)
|
||||
}
|
||||
}
|
||||
|
||||
void SelectionTab::showPopupWindow(const Point & cursorPosition)
|
||||
{
|
||||
if(!curItems.size())
|
||||
return;
|
||||
|
||||
int position = getLine();
|
||||
int py = position + slider->getValue();
|
||||
|
||||
std::string text = "{" + curItems[py]->getName() + "}\n\n" + curItems[py]->fileURI;
|
||||
|
||||
if(curItems[py]->date != "")
|
||||
text += "\n\n" + curItems[py]->date;
|
||||
|
||||
CRClickPopup::createAndPush(text);
|
||||
}
|
||||
|
||||
// A new size filter (Small, Medium, ...) has been selected. Populate
|
||||
// selMaps with the relevant data.
|
||||
void SelectionTab::filter(int size, bool selectFirst)
|
||||
|
@ -68,6 +68,7 @@ public:
|
||||
void clickReleased(const Point & cursorPosition) override;
|
||||
void keyPressed(EShortcut key) override;
|
||||
void clickDouble(const Point & cursorPosition) override;
|
||||
void showPopupWindow(const Point & cursorPosition) override;
|
||||
bool receiveEvent(const Point & position, int eventType) const override;
|
||||
|
||||
void filter(int size, bool selectFirst = false); //0 - all
|
||||
|
Loading…
Reference in New Issue
Block a user