mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Merge pull request #1484 from kambala-decapitator/shipyard-fixes
Shipyard dialog fixes
This commit is contained in:
commit
1a7ec728d9
@ -16,6 +16,10 @@
|
||||
#include "CAnimation.h"
|
||||
#include "../../lib/CConfigHandler.h"
|
||||
|
||||
#ifdef VCMI_APPLE
|
||||
#include <dispatch/dispatch.h>
|
||||
#endif
|
||||
|
||||
std::unique_ptr<ICursor> CursorHandler::createCursor()
|
||||
{
|
||||
if (settings["video"]["cursor"].String() == "auto")
|
||||
@ -401,10 +405,16 @@ CursorHardware::~CursorHardware()
|
||||
|
||||
void CursorHardware::setVisible(bool on)
|
||||
{
|
||||
#ifdef VCMI_APPLE
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
#endif
|
||||
if (on)
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
else
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
#ifdef VCMI_APPLE
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
void CursorHardware::setImage(std::shared_ptr<IImage> image, const Point & pivotOffset)
|
||||
@ -422,10 +432,16 @@ void CursorHardware::setImage(std::shared_ptr<IImage> image, const Point & pivot
|
||||
logGlobal->error("Failed to set cursor! SDL says %s", SDL_GetError());
|
||||
|
||||
SDL_FreeSurface(cursorSurface);
|
||||
#ifdef VCMI_APPLE
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
#endif
|
||||
SDL_SetCursor(cursor);
|
||||
|
||||
if (oldCursor)
|
||||
SDL_FreeCursor(oldCursor);
|
||||
#ifdef VCMI_APPLE
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
void CursorHardware::setCursorPosition( const Point & newPos )
|
||||
|
@ -1594,7 +1594,6 @@ void CAdvMapInt::tileLClicked(const int3 &mapPos)
|
||||
LOCPLINT->openTownWindow(static_cast<const CGTownInstance*>(topBlocking));
|
||||
else if(canSelect)
|
||||
select(static_cast<const CArmedInstance*>(topBlocking), false);
|
||||
return;
|
||||
}
|
||||
else if(const CGHeroInstance * currentHero = curHero()) //hero is selected
|
||||
{
|
||||
|
@ -1316,7 +1316,7 @@ CShipyardWindow::CShipyardWindow(const std::vector<si32> & cost, int state, int
|
||||
goldPic = std::make_shared<CAnimImage>("RESOURCE", Res::GOLD, 0, 100, 244);
|
||||
woodPic = std::make_shared<CAnimImage>("RESOURCE", Res::WOOD, 0, 196, 244);
|
||||
|
||||
quit = std::make_shared<CButton>(Point(224, 312), "ICANCEL", CButton::tooltip(CGI->generaltexth->allTexts[599]), std::bind(&CShipyardWindow::close, this), SDLK_RETURN);
|
||||
quit = std::make_shared<CButton>(Point(224, 312), "ICANCEL", CButton::tooltip(CGI->generaltexth->allTexts[599]), std::bind(&CShipyardWindow::close, this), SDLK_ESCAPE);
|
||||
build = std::make_shared<CButton>(Point(42, 312), "IBUY30", CButton::tooltip(CGI->generaltexth->allTexts[598]), std::bind(&CShipyardWindow::close, this), SDLK_RETURN);
|
||||
build->addCallback(onBuy);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user