summaryrefslogtreecommitdiff
path: root/src/gui/npc.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-02-20 03:13:28 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-02-20 03:13:28 +0000
commit4be5313a359b326f80ee6e5903123c2bc298a8e6 (patch)
tree065c0e89fa30358e60dea0599376b0ba7364d485 /src/gui/npc.cpp
parent30b8b4ecb92bb208c25a970d767e41ca102b16f1 (diff)
downloadmana-4be5313a359b326f80ee6e5903123c2bc298a8e6.tar.gz
mana-4be5313a359b326f80ee6e5903123c2bc298a8e6.tar.bz2
mana-4be5313a359b326f80ee6e5903123c2bc298a8e6.tar.xz
mana-4be5313a359b326f80ee6e5903123c2bc298a8e6.zip
Fixed Cancel button for NPC choice dialog, thanks to Mra. Also some small
changes to map and map reader.
Diffstat (limited to 'src/gui/npc.cpp')
-rw-r--r--src/gui/npc.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/gui/npc.cpp b/src/gui/npc.cpp
index 73e1393a..4706112b 100644
--- a/src/gui/npc.cpp
+++ b/src/gui/npc.cpp
@@ -33,27 +33,29 @@ NpcListDialog::NpcListDialog():
itemList = new ListBox(this);
scrollArea = new ScrollArea(itemList);
okButton = new Button("OK");
- //cancelButton = new Button("Cancel");
+ cancelButton = new Button("Cancel");
setSize(260, 175);
scrollArea->setDimension(gcn::Rectangle(
5, 5, 250, 160 - okButton->getHeight()));
+ cancelButton->setPosition(
+ 260 - 5 - cancelButton->getWidth(),
+ 175 - 5 - cancelButton->getHeight());
okButton->setPosition(
- 260 - 5 - okButton->getWidth(),
- 175 - 5 - okButton->getHeight());
- //cancelButton->setPosition(208, 145);
+ cancelButton->getX() - 5 - okButton->getWidth(),
+ cancelButton->getY());
itemList->setEventId("item");
okButton->setEventId("ok");
- //cancelButton->setEventId("cancel");
+ cancelButton->setEventId("cancel");
itemList->addActionListener(this);
okButton->addActionListener(this);
- //cancelButton->addActionListener(this);
+ cancelButton->addActionListener(this);
add(scrollArea);
add(okButton);
- //add(cancelButton);
+ add(cancelButton);
setLocationRelativeTo(getParent());
}
@@ -61,7 +63,7 @@ NpcListDialog::NpcListDialog():
NpcListDialog::~NpcListDialog()
{
delete okButton;
- //delete cancelButton;
+ delete cancelButton;
delete itemList;
delete scrollArea;
}
@@ -109,10 +111,13 @@ void NpcListDialog::action(const std::string& eventId)
reset();
}
}
- /*
else if (eventId == "cancel") {
+ // 0xff packet means cancel
+ WFIFOW(0) = net_w_value(0x00b8);
+ WFIFOL(2) = net_l_value(current_npc);
+ WFIFOB(6) = net_b_value(0xff);
+ WFIFOSET(7);
setVisible(false);
reset();
}
- */
}