diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-03-09 13:26:59 -0600 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-09 15:02:54 -0600 |
commit | 4463387e133b0cd238ebb1ff89b8362fc2adbe75 (patch) | |
tree | 37675fed8f6515bc155f1dd7b41fff627440801d /src/gui | |
parent | 40883938ceb60b0999f9b693dadbe2239e83f139 (diff) | |
download | mana-4463387e133b0cd238ebb1ff89b8362fc2adbe75.tar.gz mana-4463387e133b0cd238ebb1ff89b8362fc2adbe75.tar.bz2 mana-4463387e133b0cd238ebb1ff89b8362fc2adbe75.tar.xz mana-4463387e133b0cd238ebb1ff89b8362fc2adbe75.zip |
Send the correct packet for the NPC close button
Both packets do the same, but we should be explicit anyways. Also,
seperate out NPC client packets.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/npc_text.cpp | 8 | ||||
-rw-r--r-- | src/gui/npc_text.h | 2 | ||||
-rw-r--r-- | src/gui/npclistdialog.cpp | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp index b94e8aa4..ec8a4b6e 100644 --- a/src/gui/npc_text.cpp +++ b/src/gui/npc_text.cpp @@ -38,6 +38,7 @@ NpcTextDialog::NpcTextDialog(Network *network): Window(_("NPC")), mNetwork(network) { setResizable(true); + setCloseButton(true); setMinWidth(200); setMinHeight(150); @@ -103,6 +104,13 @@ void NpcTextDialog::nextDialog(int npcID) outMsg.writeInt32(npcID); } +void NpcTextDialog::closeDialog(int npcID) +{ + MessageOut outMsg(mNetwork); + outMsg.writeInt16(CMSG_NPC_CLOSE); + outMsg.writeInt32(npcID); +} + void NpcTextDialog::widgetResized(const gcn::Event &event) { Window::widgetResized(event); diff --git a/src/gui/npc_text.h b/src/gui/npc_text.h index a72de5d0..615902db 100644 --- a/src/gui/npc_text.h +++ b/src/gui/npc_text.h @@ -76,6 +76,8 @@ class NpcTextDialog : public Window, public gcn::ActionListener void nextDialog(int npcID = current_npc); + void closeDialog(int npcID = current_npc); + /** * Called when resizing the window. * diff --git a/src/gui/npclistdialog.cpp b/src/gui/npclistdialog.cpp index 73b00239..c639411d 100644 --- a/src/gui/npclistdialog.cpp +++ b/src/gui/npclistdialog.cpp @@ -58,8 +58,8 @@ NpcListDialog::NpcListDialog(Network *network): scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); place(0, 0, scrollArea, 5).setPadding(3); - place(3, 1, okButton); - place(4, 1, cancelButton); + place(3, 1, cancelButton); + place(4, 1, okButton); Layout &layout = getLayout(); layout.setRowHeight(0, Layout::AUTO_SET); |