Skip to content

Commit d4624ce

Browse files
committed
added the icon preview to the PurchasePopups
1 parent dcb1a91 commit d4624ce

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/DialogLayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ bool DeltaruneDialogLayer::init(DialogObject* dialogObject, CCArray* objectsOrig
5656
alert->m_fields->dialog = true;
5757
alert->m_fields->dialogLayer = this;
5858

59-
Loader::get()->queueInMainThread([=, this] {
59+
Loader::get()->queueInMainThread([this, alert] {
6060
this->setVisible(false);
6161
if (!this->getParent()) {
6262
alert->addChild(this);

src/FLAlertLayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void DeltaruneAlertLayer::initCustomKeybinds() {
320320
}
321321
return ListenerResult::Propagate;
322322
}, "progress"_spr);
323-
this->template addEventListener<keybinds::InvokeBindFilter>([=, this](keybinds::InvokeBindEvent* event) {
323+
this->template addEventListener<keybinds::InvokeBindFilter>([this](keybinds::InvokeBindEvent* event) {
324324
if (event->isDown()) {
325325
skipText();
326326
return ListenerResult::Stop;

src/PurchaseItemPopup.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,21 @@
22

33
void DeltarunePurchaseItemPopup::handlePurchasePopup() {
44
auto& quickPopup = m_fields->quickPopup;
5-
5+
auto itemIcon = m_mainLayer->getChildByType<GJItemIcon>(0);
6+
auto bg = quickPopup->m_mainLayer->getChildByID("background");
7+
8+
if (!bg) return;
9+
10+
float xPos = bg->getPositionX();
11+
float yPos = bg->getContentHeight() + itemIcon->getContentHeight() / 2 - 3;
12+
13+
itemIcon->setPositionX(xPos);
14+
itemIcon->setPositionY(yPos);
15+
16+
quickPopup->m_mainLayer->addChild(itemIcon);
17+
618
this->setVisible(false);
19+
720
quickPopup->setTouchPriority(this->getTouchPriority() + 1);
821
quickPopup->setVisible(true);
922
}
@@ -54,6 +67,7 @@ bool DeltarunePurchaseItemPopup::init(GJStoreItem* p0) {
5467
}
5568
);
5669

70+
// teehee
5771
this->setKeyboardEnabled(false);
5872
this->setKeypadEnabled(false);
5973
this->setTouchEnabled(false);

0 commit comments

Comments
 (0)