mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
format fix
This commit is contained in:
parent
cb92778e00
commit
05efb12d82
@ -28,42 +28,43 @@ CTutorialWindow::CTutorialWindow(const TutorialMode & m)
|
|||||||
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
||||||
|
|
||||||
pos = Rect(pos.x, pos.y, 540, 400); //video: 480x320
|
pos = Rect(pos.x, pos.y, 540, 400); //video: 480x320
|
||||||
background = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), Rect(0, 0, pos.w, pos.h));
|
background = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), Rect(0, 0, pos.w, pos.h));
|
||||||
|
|
||||||
updateShadow();
|
updateShadow();
|
||||||
|
|
||||||
center();
|
center();
|
||||||
|
|
||||||
addUsedEvents(LCLICK);
|
addUsedEvents(LCLICK);
|
||||||
|
|
||||||
buttonOk = std::make_shared<CButton>(Point(239, 367), AnimationPath::builtin("IOKAY"), CButton::tooltip(), std::bind(&CTutorialWindow::close, this), EShortcut::GLOBAL_ACCEPT); //62x28
|
buttonOk = std::make_shared<CButton>(Point(239, 367), AnimationPath::builtin("IOKAY"), CButton::tooltip(), std::bind(&CTutorialWindow::close, this), EShortcut::GLOBAL_ACCEPT); //62x28
|
||||||
buttonLeft = std::make_shared<CButton>(Point(5, 177), AnimationPath::builtin("HSBTNS3"), CButton::tooltip(), std::bind(&CTutorialWindow::previous, this), EShortcut::MOVE_LEFT); //22x46
|
buttonLeft = std::make_shared<CButton>(Point(5, 177), AnimationPath::builtin("HSBTNS3"), CButton::tooltip(), std::bind(&CTutorialWindow::previous, this), EShortcut::MOVE_LEFT); //22x46
|
||||||
buttonRight = std::make_shared<CButton>(Point(513, 177), AnimationPath::builtin("HSBTNS5"), CButton::tooltip(), std::bind(&CTutorialWindow::next, this), EShortcut::MOVE_RIGHT); //22x46
|
buttonRight = std::make_shared<CButton>(Point(513, 177), AnimationPath::builtin("HSBTNS5"), CButton::tooltip(), std::bind(&CTutorialWindow::next, this), EShortcut::MOVE_RIGHT); //22x46
|
||||||
buttonRight->block(true);
|
|
||||||
|
|
||||||
labelTitle = std::make_shared<CLabel>(270, 15, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, "Touchscreen Intro");
|
buttonLeft->block(true);
|
||||||
labelInformation = std::make_shared<CMultiLineLabel>(Rect(5, 50, 530, 60), EFonts::FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.");
|
|
||||||
|
labelTitle = std::make_shared<CLabel>(270, 15, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, "Touchscreen Intro");
|
||||||
|
labelInformation = std::make_shared<CMultiLineLabel>(Rect(5, 50, 530, 60), EFonts::FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTutorialWindow::openWindowFirstTime(const TutorialMode & m)
|
void CTutorialWindow::openWindowFirstTime(const TutorialMode & m)
|
||||||
{
|
{
|
||||||
if(GH.input().hasTouchInputDevice() && !persistentStorage["gui"]["tutorialCompleted" + std::to_string(m)].Bool())
|
if(GH.input().hasTouchInputDevice() && !persistentStorage["gui"]["tutorialCompleted" + std::to_string(m)].Bool())
|
||||||
{
|
{
|
||||||
if(LOCPLINT)
|
if(LOCPLINT)
|
||||||
LOCPLINT->showingDialog->set(true);
|
LOCPLINT->showingDialog->set(true);
|
||||||
GH.windows().pushWindow(std::make_shared<CTutorialWindow>(m));
|
GH.windows().pushWindow(std::make_shared<CTutorialWindow>(m));
|
||||||
|
|
||||||
Settings s = persistentStorage.write["gui"]["tutorialCompleted" + std::to_string(m)];
|
Settings s = persistentStorage.write["gui"]["tutorialCompleted" + std::to_string(m)];
|
||||||
s->Bool() = true;
|
s->Bool() = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTutorialWindow::close()
|
void CTutorialWindow::close()
|
||||||
{
|
{
|
||||||
if(LOCPLINT)
|
if(LOCPLINT)
|
||||||
LOCPLINT->showingDialog->setn(false);
|
LOCPLINT->showingDialog->setn(false);
|
||||||
|
|
||||||
WindowBase::close();
|
WindowBase::close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTutorialWindow::next()
|
void CTutorialWindow::next()
|
||||||
|
@ -18,27 +18,27 @@ class CMultiLineLabel;
|
|||||||
|
|
||||||
enum TutorialMode
|
enum TutorialMode
|
||||||
{
|
{
|
||||||
TOUCH_ADVENTUREMAP,
|
TOUCH_ADVENTUREMAP,
|
||||||
TOUCH_BATTLE
|
TOUCH_BATTLE
|
||||||
};
|
};
|
||||||
|
|
||||||
class CTutorialWindow : public CWindowObject
|
class CTutorialWindow : public CWindowObject
|
||||||
{
|
{
|
||||||
TutorialMode mode;
|
TutorialMode mode;
|
||||||
std::shared_ptr<CFilledTexture> background;
|
std::shared_ptr<CFilledTexture> background;
|
||||||
|
|
||||||
std::shared_ptr<CButton> buttonOk;
|
std::shared_ptr<CButton> buttonOk;
|
||||||
std::shared_ptr<CButton> buttonLeft;
|
std::shared_ptr<CButton> buttonLeft;
|
||||||
std::shared_ptr<CButton> buttonRight;
|
std::shared_ptr<CButton> buttonRight;
|
||||||
|
|
||||||
std::shared_ptr<CLabel> labelTitle;
|
std::shared_ptr<CLabel> labelTitle;
|
||||||
std::shared_ptr<CMultiLineLabel> labelInformation;
|
std::shared_ptr<CMultiLineLabel> labelInformation;
|
||||||
|
|
||||||
void close();
|
void close();
|
||||||
void next();
|
void next();
|
||||||
void previous();
|
void previous();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CTutorialWindow(const TutorialMode & m);
|
CTutorialWindow(const TutorialMode & m);
|
||||||
static void openWindowFirstTime(const TutorialMode & m);
|
static void openWindowFirstTime(const TutorialMode & m);
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user