diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-05-02 11:23:05 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-05-02 11:23:05 +0000 |
commit | b8dbdb628ba7a07a785e494d0ed76ebfe9e06615 (patch) | |
tree | 173d22e656ac771e473cdb7c1d035963d39c27e1 /src/gui | |
parent | b05628214d64e579504c87da72e79c024245a631 (diff) | |
download | mana-client-b8dbdb628ba7a07a785e494d0ed76ebfe9e06615.tar.gz mana-client-b8dbdb628ba7a07a785e494d0ed76ebfe9e06615.tar.bz2 mana-client-b8dbdb628ba7a07a785e494d0ed76ebfe9e06615.tar.xz mana-client-b8dbdb628ba7a07a785e494d0ed76ebfe9e06615.zip |
Made config.xml, tmw.log and chatlog.txt always appear in ~/.tmw on *nix.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/char_select.cpp | 8 | ||||
-rw-r--r-- | src/gui/char_server.cpp | 2 | ||||
-rw-r--r-- | src/gui/chat.cpp | 6 | ||||
-rw-r--r-- | src/gui/chat.h | 2 | ||||
-rw-r--r-- | src/gui/equipment.cpp | 6 | ||||
-rw-r--r-- | src/gui/gui.cpp | 2 | ||||
-rw-r--r-- | src/gui/itemcontainer.cpp | 4 | ||||
-rw-r--r-- | src/gui/login.cpp | 8 | ||||
-rw-r--r-- | src/gui/setup.cpp | 10 | ||||
-rw-r--r-- | src/gui/window.cpp | 4 |
10 files changed, 26 insertions, 26 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index 31c5298a..008c7e8d 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -215,11 +215,11 @@ void CharSelectDialog::serverCharSelect() flush(); } - logger.log("CharSelect: Packet ID: %x, Length: %d, Packet_in_size %d", + logger->log("CharSelect: Packet ID: %x, Length: %d, Packet_in_size %d", RFIFOW(0), get_length(RFIFOW(0)), RFIFOW(2)); - logger.log("CharSelect: In_size: %d", in_size); + logger->log("CharSelect: In_size: %d", in_size); if (RFIFOW(0) == 0x0071) { while (in_size < 28) { @@ -233,8 +233,8 @@ void CharSelectDialog::serverCharSelect() map_port = RFIFOW(26); state = GAME; - logger.log("CharSelect: Map: %s", map_name); - logger.log("CharSelect: Server: %s:%d", iptostring(map_address), map_port); + logger->log("CharSelect: Map: %s", map_name); + logger->log("CharSelect: Server: %s:%d", iptostring(map_address), map_port); RFIFOSKIP(28); close_session(); } diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp index d7faf0c6..a2bd352f 100644 --- a/src/gui/char_server.cpp +++ b/src/gui/char_server.cpp @@ -206,7 +206,7 @@ void server_char_server(int serverIndex) { } state = CHAR_SELECT; - logger.log("CharServer: Player: %s (Packet ID: %x, Length: %d)", + logger->log("CharServer: Player: %s (Packet ID: %x, Length: %d)", char_info->name, RFIFOW(0), RFIFOW(2)); diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 40a44b13..cc625358 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -29,12 +29,12 @@ #include "../main.h" #include <iostream> -ChatWindow::ChatWindow(const char *logfile, int item_num): +ChatWindow::ChatWindow(const std::string &logfile): Window("") { - chatlog_file.open(logfile, std::ios::out | std::ios::app); + chatlog_file.open(logfile.c_str(), std::ios::out | std::ios::app); items = 0; - items_keep = item_num; + items_keep = 20; setContentSize(600, 100); textOutput = new TextBox(); diff --git a/src/gui/chat.h b/src/gui/chat.h index 1c3fc007..61fe902a 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -107,7 +107,7 @@ class ChatWindow : public Window, public gcn::ActionListener, /** * Constructor. */ - ChatWindow(const char *logfile, int item_num); + ChatWindow(const std::string &logfile); /** * Destructor. diff --git a/src/gui/equipment.cpp b/src/gui/equipment.cpp index 5393459f..8ca23833 100644 --- a/src/gui/equipment.cpp +++ b/src/gui/equipment.cpp @@ -34,12 +34,12 @@ EquipmentWindow::EquipmentWindow(): { setContentSize(134, 60); setPosition(40, 40); - + ResourceManager *resman = ResourceManager::getInstance(); Image *itemImg = resman->getImage("graphics/sprites/items.png", IMG_ALPHA); - if (!itemImg) logger.error("Unable to load items.png"); + if (!itemImg) logger->error("Unable to load items.png"); itemset = new Spriteset(itemImg, 20, 20); - + for (int i = 0; i < 10; i++ ) { equipments[i].id = 0; equipments[i].inventoryIndex = -1; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 97423af6..5b527904 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -73,7 +73,7 @@ Gui::Gui(Graphics *graphics): } catch (gcn::Exception e) { - logger.error("Unable to load fixedfont.png!"); + logger->error("Unable to load fixedfont.png!"); } gcn::Widget::setGlobalFont(guiFont); diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 5bb3eb35..61e9383f 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -30,11 +30,11 @@ ItemContainer::ItemContainer() { ResourceManager *resman = ResourceManager::getInstance(); Image *itemImg = resman->getImage("graphics/sprites/items.png", IMG_ALPHA); - if (!itemImg) logger.error("Unable to load items.png"); + if (!itemImg) logger->error("Unable to load items.png"); itemset = new Spriteset(itemImg, 20, 20); selImg = resman->getImage("graphics/gui/selection.png", IMG_ALPHA); - if (!selImg) logger.error("Unable to load selection.png"); + if (!selImg) logger->error("Unable to load selection.png"); selectedItem = -1; // No item selected diff --git a/src/gui/login.cpp b/src/gui/login.cpp index 56373011..3b9c3cac 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -113,7 +113,7 @@ void LoginDialog::action(const std::string& eventId) { if (eventId == "ok") { const std::string user = userField->getText(); - logger.log("Network: Username is %s", user.c_str()); + logger->log("Network: Username is %s", user.c_str()); // Store config settings config.setValue("remember", keepCheck->isMarked()); @@ -134,7 +134,7 @@ void LoginDialog::action(const std::string& eventId) state = EXIT; } else if (eventId == "register") { const std::string user = userField->getText(); - logger.log("LoginDialog::register Username is %s", user.c_str()); + logger->log("LoginDialog::register Username is %s", user.c_str()); // Store config settings config.setValue("remember", keepCheck->isMarked()); @@ -239,13 +239,13 @@ void server_login(const std::string& user, const std::string& pass) { server_info[i].port = RFIFOW(47 + 32 * i + 4); state = CHAR_SERVER; } - logger.log("Network: Server: %s (%s:%d)", server_info[0].name, + logger->log("Network: Server: %s (%s:%d)", server_info[0].name, iptostring(server_info[0].address), server_info[0].port); RFIFOSKIP(RFIFOW(2)); } else if (RFIFOW(0) == 0x006a) { - logger.log("Login::error code: %i", RFIFOB(2)); + logger->log("Login::error code: %i", RFIFOB(2)); switch (RFIFOB(2)) { case 0: new OkDialog("Error", "Unregistered ID"); diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index a0be66cc..e6987766 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -43,18 +43,18 @@ ModeListModel::ModeListModel() /* Check is there are any modes available */ if (modes == (SDL_Rect **)0) { - logger.log("No modes available"); + logger->log("No modes available"); } /* Check if our resolution is restricted */ if (modes == (SDL_Rect **)-1) { - logger.log("All resolutions available"); + logger->log("All resolutions available"); } else{ /* Print valid modes */ - logger.log("Available Modes"); + logger->log("Available Modes"); for (int i = 0; modes[i]; ++i) { - logger.log(" %dx%d", modes[i]->w, modes[i]->h); + logger->log(" %dx%d", modes[i]->w, modes[i]->h); std::stringstream mode; mode << (int)modes[i]->w << "x" << (int)modes[i]->h; videoModes.push_back(mode.str()); @@ -228,7 +228,7 @@ void Setup::action(const std::string &eventId) } catch (const char *err) { new OkDialog(this, "Sound Engine", err); - logger.log("Warning: %s", err); + logger->log("Warning: %s", err); } } else { config.setValue("sound", 0); diff --git a/src/gui/window.cpp b/src/gui/window.cpp index eacb3d6d..c9042ffd 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -39,7 +39,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent): maxWinWidth(512), maxWinHeight(512) { - logger.log("Window::Window(\"%s\")", caption.c_str()); + logger->log("Window::Window(\"%s\")", caption.c_str()); setBorderSize(0); setPadding(3); @@ -81,7 +81,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent): Window::~Window() { - logger.log("Window::~Window(\"%s\")", getCaption().c_str()); + logger->log("Window::~Window(\"%s\")", getCaption().c_str()); // Free dialog bitmaps //release_bitmap(dLeft); |