summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/partywindow.cpp12
-rw-r--r--src/gui/partywindow.h2
2 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/partywindow.cpp b/src/gui/partywindow.cpp
index c13a0810..d9ba5a63 100644
--- a/src/gui/partywindow.cpp
+++ b/src/gui/partywindow.cpp
@@ -42,6 +42,7 @@ PartyWindow::PartyWindow() : Window(_("Party"))
setDefaultSize(620, 300, 110, 200);
loadWindowState();
+ setVisible(false); // Do not start out visible
}
PartyWindow::~PartyWindow()
@@ -72,8 +73,8 @@ PartyMember *PartyWindow::findOrCreateMember(int id)
{
member = new PartyMember;
member->avatar = new Avatar("");
- add(member->avatar, 0, (mMembers.size() - 1) * 14);
mMembers[id] = member;
+ add(member->avatar, 0, (mMembers.size() - 1) * 14);
}
return member;
@@ -99,9 +100,7 @@ int PartyWindow::findMember(const std::string &name) const
void PartyWindow::updateMember(int id, const std::string &memberName,
bool leader, bool online)
{
- // create new party member
PartyMember *player = findOrCreateMember(id);
- player->id = id;
player->name = memberName;
player->leader = leader;
player->online = online;
@@ -189,3 +188,10 @@ void PartyWindow::action(const gcn::ActionEvent &event)
mPartyInviter = "";
}
}
+
+void PartyWindow::clear()
+{
+ Window::clear();
+
+ mMembers.clear();
+}
diff --git a/src/gui/partywindow.h b/src/gui/partywindow.h
index 3729cc09..d7938f96 100644
--- a/src/gui/partywindow.h
+++ b/src/gui/partywindow.h
@@ -111,6 +111,8 @@ class PartyWindow : public Window, gcn::ActionListener
*/
void action(const gcn::ActionEvent &event);
+ void clear();
+
private:
/**
* Find a party member based on ID. Creates if not found.