diff options
author | David Athay <ko2fan@gmail.com> | 2008-03-05 14:37:52 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2008-03-05 14:37:52 +0000 |
commit | 8d2f8756b0e85f14b5d80ec63dc5e5a7f5f5de3d (patch) | |
tree | 5dcb0df1685c542063323621f5212a81a3c08761 | |
parent | e063ed2b10f1eae5b592e3edb2116f50f7395b55 (diff) | |
download | mana-8d2f8756b0e85f14b5d80ec63dc5e5a7f5f5de3d.tar.gz mana-8d2f8756b0e85f14b5d80ec63dc5e5a7f5f5de3d.tar.bz2 mana-8d2f8756b0e85f14b5d80ec63dc5e5a7f5f5de3d.tar.xz mana-8d2f8756b0e85f14b5d80ec63dc5e5a7f5f5de3d.zip |
Fixed typing in guild dialogs
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/game.cpp | 8 | ||||
-rw-r--r-- | src/gui/guildwindow.cpp | 72 |
3 files changed, 42 insertions, 43 deletions
@@ -1,3 +1,8 @@ +2008-03-05 David Athay <ko2fan@gmail.com> + + * src/game.cpp, src/gui/guildwindow.cpp: Fixed key presses during + text dialog in guild window and changed license to standard GPL. + 2008-03-04 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/CMakeLists.txt, data/graphics/gui/CMakeLists.txt, diff --git a/src/game.cpp b/src/game.cpp index 72350122..e07a70bd 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -509,7 +509,7 @@ void Game::handleInput() { break; } - + // Don not focus chat input when quit dialog is active if(quitDialog != NULL && quitDialog->isVisible()) break; @@ -524,6 +524,10 @@ void Game::handleInput() { setupWindow->action(gcn::ActionEvent(NULL, "cancel")); } + else if (guildWindow->isVisible()) + { + // TODO: Check if a dialog is open and close it if so + } // Else, open the chat edit box else { @@ -547,7 +551,7 @@ void Game::handleInput() break; } - if (keyboard.isEnabled() && !chatWindow->isFocused()) + if (keyboard.isEnabled() && !chatWindow->isFocused() && !guildWindow->isFocused()) { const int tKey = keyboard.getKeyIndex(event.key.keysym.sym); // Checks if any item shortcut is pressed. 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; } |