mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Artifacts backpack window GUI improvements
This commit is contained in:
		| @@ -84,6 +84,7 @@ void CArtifactsOfHeroBackpack::scrollBackpack(int offset) | ||||
| 		slot = slot + 1; | ||||
| 	} | ||||
| 	redraw(); | ||||
| 	setRedrawParent(true); | ||||
| } | ||||
|  | ||||
| void CArtifactsOfHeroBackpack::updateBackpackSlots() | ||||
|   | ||||
| @@ -14,17 +14,32 @@ | ||||
| #include "../gui/Shortcut.h" | ||||
|  | ||||
| #include "../widgets/Buttons.h" | ||||
| #include "../widgets/Images.h" | ||||
| #include "CMessage.h" | ||||
| #include "render/Canvas.h" | ||||
|  | ||||
| CHeroBackpackWindow::CHeroBackpackWindow(const CGHeroInstance * hero) | ||||
| 	: CWindowObject(PLAYER_COLORED) | ||||
| 	: CWindowObject((EOptions)0) | ||||
| { | ||||
| 	OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE); | ||||
| 	 | ||||
| 	arts = std::make_shared<CArtifactsOfHeroBackpack>(Point(-100, -170)); | ||||
|  | ||||
| 	stretchedBackground = std::make_shared<CFilledTexture>("DIBOXBCK", Rect(0, 0, 410, 425)); | ||||
| 	pos.w = stretchedBackground->pos.w; | ||||
| 	pos.h = stretchedBackground->pos.h; | ||||
| 	center(); | ||||
|  | ||||
|  | ||||
| 	arts = std::make_shared<CArtifactsOfHeroBackpack>(/*Point(-100, -170)*/Point(10, 10)); | ||||
| 	arts->setHero(hero); | ||||
| 	addSet(arts); | ||||
|  | ||||
| 	addCloseCallback(std::bind(&CHeroBackpackWindow::close, this)); | ||||
|  | ||||
| 	quitButton = std::make_shared<CButton>(Point(242, 200), "hsbtns.def", CButton::tooltip(""), [this]() { close(); }, EShortcut::GLOBAL_RETURN); | ||||
| 	quitButton = std::make_shared<CButton>(Point(173, 385), "IOKAY32.def", CButton::tooltip(""), [this]() { close(); }, EShortcut::GLOBAL_RETURN); | ||||
| } | ||||
|  | ||||
| void CHeroBackpackWindow::showAll(Canvas &to) | ||||
| { | ||||
| 	CIntObject::showAll(to); | ||||
| 	CMessage::drawBorder(PlayerColor(1), to.getInternalSurface(), pos.w+28, pos.h+29, pos.x-14, pos.y-15); | ||||
| } | ||||
|   | ||||
| @@ -12,6 +12,8 @@ | ||||
| #include "../widgets/CWindowWithArtifacts.h" | ||||
| #include "CWindowObject.h" | ||||
|  | ||||
| class CFilledTexture; | ||||
|  | ||||
| class CHeroBackpackWindow : public CWindowObject, public CWindowWithArtifacts | ||||
| { | ||||
| public: | ||||
| @@ -20,4 +22,7 @@ public: | ||||
| private: | ||||
| 	std::shared_ptr<CArtifactsOfHeroBackpack> arts; | ||||
| 	std::shared_ptr<CButton> quitButton; | ||||
| 	std::shared_ptr<CFilledTexture> stretchedBackground; | ||||
|  | ||||
| 	void showAll(Canvas &to) override; | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user