summaryrefslogtreecommitdiff
path: root/src/gui/guildwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/guildwindow.cpp')
-rw-r--r--src/gui/guildwindow.cpp72
1 files changed, 31 insertions, 41 deletions
diff --git a/src/gui/guildwindow.cpp b/src/gui/guildwindow.cpp
index a3d46ff5..c7a828b9 100644
--- a/src/gui/guildwindow.cpp
+++ b/src/gui/guildwindow.cpp
@@ -1,34 +1,24 @@
/*
- * guildwindow.cpp
- * A file part of The Mana World
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
*
- * Created by David Athay on 06/03/2007.
- *
- * Copyright (c) 2007, David Athay
- * All rights reserved.
+ * This file is part of The Mana World.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * My name may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * The Mana World is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ * The Mana World is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * $Id$
+ * You should have received a copy of the GNU General Public License
+ * along with The Mana World; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $$
*/
#include "guildwindow.h"
@@ -61,22 +51,22 @@ GuildWindow::GuildWindow(LocalPlayer *player):
setMinWidth(200);
setMinHeight(280);
setDefaultSize(124, 41, 288, 330);
-
+
// Set button events Id
mGuildButton[0] = new Button("Create Guild", "CREATE_GUILD", this);
mGuildButton[1] = new Button("Invite User", "INVITE_USER", this);
mGuildButton[0]->setPosition(15,10);
mGuildButton[1]->setPosition(115,10);
mGuildButton[1]->setEnabled(false);
-
+
mGuildsContainer = new TabbedContainer();
mGuildsContainer->setOpaque(false);
-
+
add(mGuildButton[0]);
add(mGuildButton[1]);
add(mGuildsContainer);
-
+
loadWindowState(player->getName());
}
@@ -93,7 +83,7 @@ void GuildWindow::update()
void GuildWindow::draw(gcn::Graphics *g)
{
update();
-
+
Window::draw(g);
}
@@ -128,7 +118,7 @@ void GuildWindow::action(const gcn::ActionEvent &event)
}
// Process guild name to be created, and unfocus.
Net::ChatServer::Guild::createGuild(name);
-
+
// Defocus dialog
mFocus = false;
chatWindow->chatLog("Creating Guild called " + name, BY_SERVER);
@@ -138,10 +128,10 @@ void GuildWindow::action(const gcn::ActionEvent &event)
{
std::string name = inviteDialog->getText();
short selectedGuild = getSelectedGuild();
-
+
// Process invited user to be created and unfocus.
Net::ChatServer::Guild::invitePlayer(name, selectedGuild);
-
+
// Defocus dialog
mFocus = false;
chatWindow->chatLog("Invited user " + name, BY_SERVER);
@@ -156,7 +146,7 @@ void GuildWindow::action(const gcn::ActionEvent &event)
void GuildWindow::newGuildTab(const std::string &guildName)
{
-
+
// Create new tab
GCContainer *tab = new GCContainer();
tab->setWidth(getWidth() - 2 * tab->getBorderSize());
@@ -167,12 +157,12 @@ void GuildWindow::newGuildTab(const std::string &guildName)
ScrollArea *sa = new ScrollArea(list);
sa->setDimension(gcn::Rectangle(5, 5, 135, 250));
tab->add(sa);
-
+
mGuildsContainer->addTab(tab, guildName);
mGuildsContainer->setDimension(gcn::Rectangle(28,35,280,250));
-
+
mTabs.push_back(tab);
-
+
updateTab();
}
@@ -183,7 +173,7 @@ void GuildWindow::updateTab()
void GuildWindow::setTab(const std::string &guildName)
{
-
+
// Only enable invite button if user has rights
if(mPlayer->checkInviteRights(guildName))
{
@@ -209,10 +199,10 @@ void GuildWindow::openAcceptDialog(const std::string &inviterName, const std::st
{
std::string msg = inviterName + " has invited you to join the guild " + guildName;
chatWindow->chatLog(msg, BY_SERVER);
-
+
acceptDialog = new ConfirmDialog("Accept Guild Invite", msg, this);
acceptDialog->addActionListener(this);
-
+
invitedGuild = guildName;
}