summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLloyd Bryant <lloyd_bryant@netzero.net>2008-07-18 00:48:14 +0000
committerLloyd Bryant <lloyd_bryant@netzero.net>2008-07-18 00:48:14 +0000
commit159285c5aa24611ceee7e3847a87bf9ea5f7fb7a (patch)
treefa48eb8bb8ed1e62ede1e7a2f95632c2243facab
parent4dbc9b7af344d3ff006a40e3e0c06ce160f365f9 (diff)
downloadmana-159285c5aa24611ceee7e3847a87bf9ea5f7fb7a.tar.gz
mana-159285c5aa24611ceee7e3847a87bf9ea5f7fb7a.tar.bz2
mana-159285c5aa24611ceee7e3847a87bf9ea5f7fb7a.tar.xz
mana-159285c5aa24611ceee7e3847a87bf9ea5f7fb7a.zip
Import of client tree
-rw-r--r--CMakeLists.txt2
-rw-r--r--ChangeLog64
-rw-r--r--Makefile.am2
-rw-r--r--README51
-rw-r--r--aclocal.m4868
-rw-r--r--autom4te.cache/traces.0698
-rwxr-xr-xconfigure.ac2
-rwxr-xr-xdepcomp589
-rw-r--r--docs/Makefile.am2
-rw-r--r--docs/tme.6 (renamed from docs/tmw.6)51
-rwxr-xr-xinstall-sh519
-rwxr-xr-xmissing367
-rw-r--r--src/.deps/tmw-action.Po1
-rw-r--r--src/.deps/tmw-ambientoverlay.Po1
-rw-r--r--src/.deps/tmw-animatedsprite.Po1
-rw-r--r--src/.deps/tmw-animation.Po1
-rw-r--r--src/.deps/tmw-animationparticle.Po1
-rw-r--r--src/.deps/tmw-base64.Po1
-rw-r--r--src/.deps/tmw-being.Po1
-rw-r--r--src/.deps/tmw-beinghandler.Po1
-rw-r--r--src/.deps/tmw-beingmanager.Po1
-rw-r--r--src/.deps/tmw-box.Po1
-rw-r--r--src/.deps/tmw-browserbox.Po1
-rw-r--r--src/.deps/tmw-buddylist.Po1
-rw-r--r--src/.deps/tmw-buddywindow.Po1
-rw-r--r--src/.deps/tmw-button.Po1
-rw-r--r--src/.deps/tmw-buy.Po1
-rw-r--r--src/.deps/tmw-buysell.Po1
-rw-r--r--src/.deps/tmw-buysellhandler.Po1
-rw-r--r--src/.deps/tmw-char_select.Po1
-rw-r--r--src/.deps/tmw-char_server.Po1
-rw-r--r--src/.deps/tmw-chargedialog.Po1
-rw-r--r--src/.deps/tmw-charserverhandler.Po1
-rw-r--r--src/.deps/tmw-chat.Po1
-rw-r--r--src/.deps/tmw-chathandler.Po1
-rw-r--r--src/.deps/tmw-chatinput.Po1
-rw-r--r--src/.deps/tmw-checkbox.Po1
-rw-r--r--src/.deps/tmw-configuration.Po1
-rw-r--r--src/.deps/tmw-confirm_dialog.Po1
-rw-r--r--src/.deps/tmw-connection.Po1
-rw-r--r--src/.deps/tmw-debugwindow.Po1
-rw-r--r--src/.deps/tmw-dropdown.Po1
-rw-r--r--src/.deps/tmw-dye.Po1
-rw-r--r--src/.deps/tmw-engine.Po1
-rw-r--r--src/.deps/tmw-equipment.Po1
-rw-r--r--src/.deps/tmw-equipmenthandler.Po1
-rw-r--r--src/.deps/tmw-equipmentwindow.Po1
-rw-r--r--src/.deps/tmw-floor_item.Po1
-rw-r--r--src/.deps/tmw-flooritemmanager.Po1
-rw-r--r--src/.deps/tmw-focushandler.Po1
-rw-r--r--src/.deps/tmw-game.Po1
-rw-r--r--src/.deps/tmw-gccontainer.Po1
-rw-r--r--src/.deps/tmw-graphics.Po1
-rw-r--r--src/.deps/tmw-gui.Po1
-rw-r--r--src/.deps/tmw-hbox.Po1
-rw-r--r--src/.deps/tmw-help.Po1
-rw-r--r--src/.deps/tmw-image.Po1
-rw-r--r--src/.deps/tmw-imageloader.Po1
-rw-r--r--src/.deps/tmw-imageparticle.Po1
-rw-r--r--src/.deps/tmw-imageset.Po1
-rw-r--r--src/.deps/tmw-imagewriter.Po1
-rw-r--r--src/.deps/tmw-inttextbox.Po1
-rw-r--r--src/.deps/tmw-inventory.Po1
-rw-r--r--src/.deps/tmw-inventoryhandler.Po1
-rw-r--r--src/.deps/tmw-inventorywindow.Po1
-rw-r--r--src/.deps/tmw-item.Po1
-rw-r--r--src/.deps/tmw-item_amount.Po1
-rw-r--r--src/.deps/tmw-itemcontainer.Po1
-rw-r--r--src/.deps/tmw-itemdb.Po1
-rw-r--r--src/.deps/tmw-itemhandler.Po1
-rw-r--r--src/.deps/tmw-iteminfo.Po1
-rw-r--r--src/.deps/tmw-itemshortcut.Po1
-rw-r--r--src/.deps/tmw-itemshortcutcontainer.Po1
-rw-r--r--src/.deps/tmw-itemshortcutwindow.Po1
-rw-r--r--src/.deps/tmw-joystick.Po1
-rw-r--r--src/.deps/tmw-keyboardconfig.Po1
-rw-r--r--src/.deps/tmw-listbox.Po1
-rw-r--r--src/.deps/tmw-localplayer.Po1
-rw-r--r--src/.deps/tmw-log.Po1
-rw-r--r--src/.deps/tmw-login.Po1
-rw-r--r--src/.deps/tmw-loginhandler.Po1
-rw-r--r--src/.deps/tmw-main.Po1
-rw-r--r--src/.deps/tmw-map.Po1
-rw-r--r--src/.deps/tmw-maploginhandler.Po1
-rw-r--r--src/.deps/tmw-mapreader.Po1
-rw-r--r--src/.deps/tmw-menuwindow.Po1
-rw-r--r--src/.deps/tmw-messagehandler.Po1
-rw-r--r--src/.deps/tmw-messagein.Po1
-rw-r--r--src/.deps/tmw-messageout.Po1
-rw-r--r--src/.deps/tmw-minimap.Po1
-rw-r--r--src/.deps/tmw-ministatus.Po1
-rw-r--r--src/.deps/tmw-monster.Po1
-rw-r--r--src/.deps/tmw-monsterdb.Po1
-rw-r--r--src/.deps/tmw-monsterinfo.Po1
-rw-r--r--src/.deps/tmw-music.Po1
-rw-r--r--src/.deps/tmw-network.Po1
-rw-r--r--src/.deps/tmw-newskill.Po1
-rw-r--r--src/.deps/tmw-npc.Po1
-rw-r--r--src/.deps/tmw-npc_text.Po1
-rw-r--r--src/.deps/tmw-npcdb.Po1
-rw-r--r--src/.deps/tmw-npchandler.Po1
-rw-r--r--src/.deps/tmw-npclistdialog.Po1
-rw-r--r--src/.deps/tmw-ok_dialog.Po1
-rw-r--r--src/.deps/tmw-openglgraphics.Po1
-rw-r--r--src/.deps/tmw-particle.Po1
-rw-r--r--src/.deps/tmw-particleemitter.Po1
-rw-r--r--src/.deps/tmw-passwordfield.Po1
-rw-r--r--src/.deps/tmw-player.Po1
-rw-r--r--src/.deps/tmw-player_relations.Po1
-rw-r--r--src/.deps/tmw-playerbox.Po1
-rw-r--r--src/.deps/tmw-playerhandler.Po1
-rw-r--r--src/.deps/tmw-popupmenu.Po1
-rw-r--r--src/.deps/tmw-progressbar.Po1
-rw-r--r--src/.deps/tmw-protocol.Po1
-rw-r--r--src/.deps/tmw-radiobutton.Po1
-rw-r--r--src/.deps/tmw-register.Po1
-rw-r--r--src/.deps/tmw-resizegrip.Po1
-rw-r--r--src/.deps/tmw-resource.Po1
-rw-r--r--src/.deps/tmw-resourcemanager.Po1
-rw-r--r--src/.deps/tmw-scrollarea.Po1
-rw-r--r--src/.deps/tmw-sell.Po1
-rw-r--r--src/.deps/tmw-setup.Po1
-rw-r--r--src/.deps/tmw-setup_audio.Po1
-rw-r--r--src/.deps/tmw-setup_joystick.Po1
-rw-r--r--src/.deps/tmw-setup_keyboard.Po1
-rw-r--r--src/.deps/tmw-setup_players.Po1
-rw-r--r--src/.deps/tmw-setup_video.Po1
-rw-r--r--src/.deps/tmw-shop.Po1
-rw-r--r--src/.deps/tmw-shoplistbox.Po1
-rw-r--r--src/.deps/tmw-simpleanimation.Po1
-rw-r--r--src/.deps/tmw-skill.Po1
-rw-r--r--src/.deps/tmw-skillhandler.Po1
-rw-r--r--src/.deps/tmw-slider.Po1
-rw-r--r--src/.deps/tmw-sound.Po1
-rw-r--r--src/.deps/tmw-soundeffect.Po1
-rw-r--r--src/.deps/tmw-spritedef.Po1
-rw-r--r--src/.deps/tmw-status.Po1
-rw-r--r--src/.deps/tmw-strprintf.Po1
-rw-r--r--src/.deps/tmw-tabbedcontainer.Po1
-rw-r--r--src/.deps/tmw-table.Po1
-rw-r--r--src/.deps/tmw-table_model.Po1
-rw-r--r--src/.deps/tmw-textbox.Po1
-rw-r--r--src/.deps/tmw-textfield.Po1
-rw-r--r--src/.deps/tmw-textparticle.Po1
-rw-r--r--src/.deps/tmw-trade.Po1
-rw-r--r--src/.deps/tmw-tradehandler.Po1
-rw-r--r--src/.deps/tmw-updatewindow.Po1
-rw-r--r--src/.deps/tmw-vbox.Po1
-rw-r--r--src/.deps/tmw-viewport.Po1
-rw-r--r--src/.deps/tmw-window.Po1
-rw-r--r--src/.deps/tmw-windowcontainer.Po1
-rw-r--r--src/.deps/tmw-xml.Po1
-rw-r--r--src/Makefile.am28
-rw-r--r--src/animatedsprite.cpp2
-rw-r--r--src/animatedsprite.h2
-rw-r--r--src/being.cpp55
-rw-r--r--src/being.h30
-rw-r--r--src/beingmanager.cpp2
-rw-r--r--src/beingmanager.h2
-rw-r--r--src/configlistener.h2
-rw-r--r--src/configuration.cpp2
-rw-r--r--src/configuration.h2
-rw-r--r--src/engine.cpp2
-rw-r--r--src/engine.h2
-rw-r--r--src/equipment.cpp2
-rw-r--r--src/equipment.h2
-rw-r--r--src/floor_item.cpp2
-rw-r--r--src/floor_item.h2
-rw-r--r--src/flooritemmanager.cpp2
-rw-r--r--src/flooritemmanager.h2
-rw-r--r--src/game.cpp936
-rw-r--r--src/game.h50
-rw-r--r--src/graphics.cpp2
-rw-r--r--src/graphics.h2
-rw-r--r--src/gui/box.cpp2
-rw-r--r--src/gui/box.h2
-rw-r--r--src/gui/browserbox.cpp2
-rw-r--r--src/gui/browserbox.h2
-rw-r--r--src/gui/buddywindow.cpp85
-rw-r--r--src/gui/button.cpp2
-rw-r--r--src/gui/button.h2
-rw-r--r--src/gui/buttonbox.cpp47
-rw-r--r--src/gui/buttonbox.h70
-rw-r--r--src/gui/buy.cpp2
-rw-r--r--src/gui/buy.h2
-rw-r--r--src/gui/buysell.cpp2
-rw-r--r--src/gui/buysell.h2
-rw-r--r--src/gui/char_select.cpp2
-rw-r--r--src/gui/char_select.h2
-rw-r--r--src/gui/char_server.cpp7
-rw-r--r--src/gui/char_server.h2
-rw-r--r--src/gui/chat.cpp758
-rw-r--r--src/gui/chat.h270
-rw-r--r--src/gui/chatinput.cpp2
-rw-r--r--src/gui/chatinput.h2
-rw-r--r--src/gui/checkbox.cpp2
-rw-r--r--src/gui/checkbox.h2
-rw-r--r--src/gui/confirm_dialog.cpp2
-rw-r--r--src/gui/confirm_dialog.h2
-rw-r--r--src/gui/connection.cpp2
-rw-r--r--src/gui/connection.h2
-rw-r--r--src/gui/debugwindow.cpp2
-rw-r--r--src/gui/debugwindow.h2
-rw-r--r--src/gui/equipmentwindow.cpp2
-rw-r--r--src/gui/equipmentwindow.h2
-rw-r--r--src/gui/focushandler.cpp2
-rw-r--r--src/gui/focushandler.h2
-rw-r--r--src/gui/gccontainer.cpp2
-rw-r--r--src/gui/gccontainer.h2
-rw-r--r--src/gui/gui.cpp2
-rw-r--r--src/gui/gui.h2
-rw-r--r--src/gui/hbox.cpp2
-rw-r--r--src/gui/hbox.h2
-rw-r--r--src/gui/help.cpp2
-rw-r--r--src/gui/help.h2
-rw-r--r--src/gui/inttextbox.cpp2
-rw-r--r--src/gui/inttextbox.h2
-rw-r--r--src/gui/inventorywindow.cpp2
-rw-r--r--src/gui/inventorywindow.h2
-rw-r--r--src/gui/item_amount.cpp2
-rw-r--r--src/gui/item_amount.h2
-rw-r--r--src/gui/itemcontainer.cpp2
-rw-r--r--src/gui/itemcontainer.h2
-rw-r--r--src/gui/itemshortcutcontainer.cpp2
-rw-r--r--src/gui/itemshortcutcontainer.h2
-rw-r--r--src/gui/itemshortcutwindow.cpp2
-rw-r--r--src/gui/itemshortcutwindow.h2
-rw-r--r--src/gui/linkhandler.h2
-rw-r--r--src/gui/listbox.cpp2
-rw-r--r--src/gui/listbox.h2
-rw-r--r--src/gui/login.cpp250
-rw-r--r--src/gui/login.h58
-rw-r--r--src/gui/menuwindow.cpp2
-rw-r--r--src/gui/menuwindow.h2
-rw-r--r--src/gui/minimap.cpp2
-rw-r--r--src/gui/minimap.h2
-rw-r--r--src/gui/ministatus.cpp2
-rw-r--r--src/gui/ministatus.h2
-rw-r--r--src/gui/newskill.cpp2
-rw-r--r--src/gui/newskill.h2
-rw-r--r--src/gui/npc_text.cpp2
-rw-r--r--src/gui/npc_text.h2
-rw-r--r--src/gui/npclistdialog.cpp2
-rw-r--r--src/gui/npclistdialog.h2
-rw-r--r--src/gui/ok_dialog.cpp2
-rw-r--r--src/gui/ok_dialog.h2
-rw-r--r--src/gui/passwordfield.cpp2
-rw-r--r--src/gui/passwordfield.h2
-rw-r--r--src/gui/playerbox.cpp2
-rw-r--r--src/gui/playerbox.h2
-rw-r--r--src/gui/popupmenu.cpp211
-rw-r--r--src/gui/popupmenu.h2
-rw-r--r--src/gui/progressbar.cpp2
-rw-r--r--src/gui/progressbar.h2
-rw-r--r--src/gui/radiobutton.cpp2
-rw-r--r--src/gui/radiobutton.h2
-rw-r--r--src/gui/register.cpp122
-rw-r--r--src/gui/register.h23
-rw-r--r--src/gui/scrollarea.cpp2
-rw-r--r--src/gui/scrollarea.h2
-rw-r--r--src/gui/sell.cpp2
-rw-r--r--src/gui/sell.h2
-rw-r--r--src/gui/setup.cpp2
-rw-r--r--src/gui/setup.h2
-rw-r--r--src/gui/setup_audio.cpp2
-rw-r--r--src/gui/setup_audio.h2
-rw-r--r--src/gui/setup_joystick.cpp2
-rw-r--r--src/gui/setup_joystick.h2
-rw-r--r--src/gui/setup_keyboard.cpp2
-rw-r--r--src/gui/setup_keyboard.h2
-rw-r--r--src/gui/setup_players.cpp2
-rw-r--r--src/gui/setup_video.cpp2
-rw-r--r--src/gui/setup_video.h2
-rw-r--r--src/gui/setuptab.h2
-rw-r--r--src/gui/shop.cpp2
-rw-r--r--src/gui/shop.h2
-rw-r--r--src/gui/skill.cpp2
-rw-r--r--src/gui/skill.h2
-rw-r--r--src/gui/slider.cpp2
-rw-r--r--src/gui/slider.h2
-rw-r--r--src/gui/status.cpp2
-rw-r--r--src/gui/status.h2
-rw-r--r--src/gui/tabbedcontainer.cpp2
-rw-r--r--src/gui/tabbedcontainer.h2
-rw-r--r--src/gui/textbox.cpp2
-rw-r--r--src/gui/textbox.h2
-rw-r--r--src/gui/textfield.cpp2
-rw-r--r--src/gui/textfield.h2
-rw-r--r--src/gui/updatewindow.cpp2
-rw-r--r--src/gui/updatewindow.h2
-rw-r--r--src/gui/vbox.cpp2
-rw-r--r--src/gui/vbox.h2
-rw-r--r--src/gui/viewport.cpp30
-rw-r--r--src/gui/viewport.h2
-rw-r--r--src/gui/widgets/dropdown.cpp169
-rw-r--r--src/gui/widgets/dropdown.h85
-rw-r--r--src/gui/widgets/resizegrip.cpp2
-rw-r--r--src/gui/widgets/resizegrip.h2
-rw-r--r--src/gui/window.cpp2
-rw-r--r--src/gui/window.h2
-rw-r--r--src/gui/windowcontainer.cpp2
-rw-r--r--src/gui/windowcontainer.h2
-rw-r--r--src/guichanfwd.h2
-rw-r--r--src/imageparticle.cpp2
-rw-r--r--src/imageparticle.h2
-rw-r--r--src/inventory.cpp2
-rw-r--r--src/inventory.h2
-rw-r--r--src/item.cpp2
-rw-r--r--src/item.h2
-rw-r--r--src/itemshortcut.cpp2
-rw-r--r--src/itemshortcut.h2
-rw-r--r--src/joystick.cpp2
-rw-r--r--src/joystick.h2
-rw-r--r--src/keyboardconfig.cpp2
-rw-r--r--src/keyboardconfig.h2
-rw-r--r--src/localplayer.cpp30
-rw-r--r--src/localplayer.h13
-rw-r--r--src/lockedarray.h2
-rw-r--r--src/logindata.h3
-rw-r--r--src/main.cpp159
-rw-r--r--src/main.h2
-rw-r--r--src/map.cpp2
-rw-r--r--src/map.h2
-rw-r--r--src/monster.cpp47
-rw-r--r--src/monster.h18
-rw-r--r--src/net/beinghandler.cpp51
-rw-r--r--src/net/beinghandler.h2
-rw-r--r--src/net/buysellhandler.cpp2
-rw-r--r--src/net/buysellhandler.h2
-rw-r--r--src/net/charserverhandler.cpp2
-rw-r--r--src/net/charserverhandler.h2
-rw-r--r--src/net/chathandler.cpp2
-rw-r--r--src/net/chathandler.h2
-rw-r--r--src/net/equipmenthandler.cpp2
-rw-r--r--src/net/equipmenthandler.h2
-rw-r--r--src/net/inventoryhandler.cpp2
-rw-r--r--src/net/inventoryhandler.h2
-rw-r--r--src/net/itemhandler.cpp2
-rw-r--r--src/net/itemhandler.h2
-rw-r--r--src/net/loginhandler.cpp16
-rw-r--r--src/net/loginhandler.h6
-rw-r--r--src/net/maploginhandler.cpp2
-rw-r--r--src/net/maploginhandler.h2
-rw-r--r--src/net/messagehandler.cpp2
-rw-r--r--src/net/messagehandler.h2
-rw-r--r--src/net/messagein.cpp2
-rw-r--r--src/net/messagein.h2
-rw-r--r--src/net/messageout.cpp2
-rw-r--r--src/net/messageout.h2
-rw-r--r--src/net/network.cpp4
-rw-r--r--src/net/network.h2
-rw-r--r--src/net/npchandler.cpp2
-rw-r--r--src/net/npchandler.h2
-rw-r--r--src/net/partyhandler.cpp127
-rw-r--r--src/net/partyhandler.h (renamed from src/gui/buddywindow.h)37
-rw-r--r--src/net/playerhandler.cpp29
-rw-r--r--src/net/playerhandler.h2
-rw-r--r--src/net/protocol.cpp2
-rw-r--r--src/net/protocol.h27
-rw-r--r--src/net/skillhandler.cpp2
-rw-r--r--src/net/skillhandler.h2
-rw-r--r--src/net/tradehandler.cpp2
-rw-r--r--src/net/tradehandler.h2
-rw-r--r--src/npc.cpp43
-rw-r--r--src/npc.h13
-rw-r--r--src/openglgraphics.cpp2
-rw-r--r--src/openglgraphics.h2
-rw-r--r--src/particle.cpp2
-rw-r--r--src/particle.h2
-rw-r--r--src/particleemitter.cpp2
-rw-r--r--src/particleemitter.h2
-rw-r--r--src/party.cpp219
-rw-r--r--src/party.h75
-rw-r--r--src/player.cpp67
-rw-r--r--src/player.h43
-rw-r--r--src/player_relations.cpp28
-rw-r--r--src/properties.h2
-rw-r--r--src/recorder.cpp112
-rw-r--r--src/recorder.h50
-rw-r--r--src/resources/action.cpp2
-rw-r--r--src/resources/action.h2
-rw-r--r--src/resources/ambientoverlay.cpp2
-rw-r--r--src/resources/ambientoverlay.h2
-rw-r--r--src/resources/animation.cpp2
-rw-r--r--src/resources/animation.h2
-rw-r--r--src/resources/buddylist.cpp2
-rw-r--r--src/resources/buddylist.h2
-rw-r--r--src/resources/image.cpp2
-rw-r--r--src/resources/image.h2
-rw-r--r--src/resources/imageset.cpp2
-rw-r--r--src/resources/imageset.h2
-rw-r--r--src/resources/imagewriter.cpp2
-rw-r--r--src/resources/imagewriter.h2
-rw-r--r--src/resources/itemdb.cpp2
-rw-r--r--src/resources/itemdb.h2
-rw-r--r--src/resources/iteminfo.cpp2
-rw-r--r--src/resources/iteminfo.h2
-rw-r--r--src/resources/mapreader.cpp2
-rw-r--r--src/resources/mapreader.h2
-rw-r--r--src/resources/monsterdb.cpp2
-rw-r--r--src/resources/monsterdb.h2
-rw-r--r--src/resources/music.cpp2
-rw-r--r--src/resources/music.h2
-rw-r--r--src/resources/npcdb.cpp2
-rw-r--r--src/resources/npcdb.h2
-rw-r--r--src/resources/resource.cpp2
-rw-r--r--src/resources/resource.h2
-rw-r--r--src/resources/resourcemanager.cpp2
-rw-r--r--src/resources/resourcemanager.h2
-rw-r--r--src/resources/soundeffect.cpp2
-rw-r--r--src/resources/soundeffect.h2
-rw-r--r--src/resources/spritedef.cpp2
-rw-r--r--src/resources/spritedef.h2
-rw-r--r--src/serverinfo.h3
-rw-r--r--src/shopitem.cpp2
-rw-r--r--src/shopitem.h2
-rw-r--r--src/simpleanimation.cpp2
-rw-r--r--src/simpleanimation.h2
-rw-r--r--src/sound.cpp2
-rw-r--r--src/sound.h2
-rw-r--r--src/sprite.h2
-rw-r--r--src/text.cpp102
-rw-r--r--src/text.h93
-rw-r--r--src/textmanager.cpp177
-rw-r--r--src/textmanager.h75
-rw-r--r--src/textparticle.cpp2
-rw-r--r--src/textparticle.h2
-rw-r--r--src/tileset.h2
-rw-r--r--src/utils/base64.cpp2
-rw-r--r--src/utils/base64.h2
-rw-r--r--src/utils/dtor.h2
-rw-r--r--src/utils/fastsqrt.h2
-rw-r--r--src/utils/minmax.h2
-rw-r--r--src/utils/tostring.h2
-rw-r--r--src/utils/trim.h2
-rw-r--r--src/utils/xml.cpp2
-rw-r--r--src/utils/xml.h2
-rw-r--r--src/vector.h2
-rw-r--r--stamp-h11
-rw-r--r--tme.desktop (renamed from tmw.desktop)6
-rw-r--r--tmw.cbp2
-rw-r--r--tools/adler32.c2
-rw-r--r--tools/tmxcopy/Makefile18
-rw-r--r--tools/tmxcopy/base64.cpp2
-rw-r--r--tools/tmxcopy/base64.h2
-rw-r--r--tools/tmxcopy/tostring.h2
446 files changed, 7122 insertions, 1697 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32bffc37..13399ef9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ IF (WIN32)
SET(PKG_DATADIR ".")
SET(PKG_BINDIR ".")
ELSE (WIN32)
- SET(PKG_DATADIR ${CMAKE_INSTALL_PREFIX}/share/tmw)
+ SET(PKG_DATADIR ${CMAKE_INSTALL_PREFIX}/share/tme)
SET(PKG_BINDIR ${CMAKE_INSTALL_PREFIX}/bin)
ENDIF (WIN32)
diff --git a/ChangeLog b/ChangeLog
index 160e3b58..83ab07d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,49 @@
+2008-07-11 Douglas Boffey <DougABoffey@netscape.net>
+
+ * Added code to avoid collision between different displayed text.
+
+2008-07-08 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net>
+
+ * Added handling for a "Stop Walking" packet. This will
+ force the client back into sync during those "can't run
+ away from a battle" sync error conditions.
+
+2008-07-07 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net>
+
+ * Added support for update host provided by login server
+ * Changed startup sequence to login first, then update
+
+2008-07-05 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net>
+
+ * Applied patch from kraant to convert into a TME branded client
+ * Removed redundant autoconf files
+
+2008-07-01 Douglas Boffey <DougABoffey@netscape.net>
+
+ * Split ChatWindow into ChatWindow, Recorder and Party.
+ * Added /toggle command.
+
+2008-06-28 Kevin Day <blame582@gmail.com>
+
+ * Updated configure and configure.ac to reflect tme version info.
+
+2008-06-25 Kevin Day <blame582@gmail.com>
+
+ * Updated README added /commands and updated skill level listing.
+
+2008-06-25 Douglas Boffey <DougABoffey@netscape.net>
+
+ * Added a command to display the characters present within hearing
+ distance (/help present for details).
+ * Removed the need to select the map server if only one available.
+ * Added a text entry for the port to the login dialog.
+ * Added the basis of the party subsystem. (/help party for details).
+ * Added the recording subsystem (/help record for details).
+ * Add a dropdown to the login dialog to make it easier to log in
+ on different servers.
+ * Made the chatlog entry sticky (Cancelled by a blank line) -
+ TODO Make an option.
+
2008-06-24 Philipp Sehmisch <tmw@crushnet.org>
* src/particle.cpp, src/particle.h, src/particleemitter.cpp,
@@ -17,7 +63,7 @@
2008-06-17 Fate <fate.tmw@googlemail.com>
- * src/net/tradehandler.cpp: bug #333: Suppress `trade with X cancelled'
+ * src/net/tradehandler.cpp: bug #333: Suppress `trade with X cancelled'
messages for ignored players.
2008-06-16 Fate <fate.tmw@googlemail.com>
@@ -291,7 +337,7 @@
* src/winver.h, README, configure.ac, data/help/changes.txt,
data/help/header.txt, NEWS, CMakeLists.txt: Updated version, release
date and changes.
-
+
2008-04-03 David Athay <ko2fan@gmail.com>
* src/game.cpp: Tweaked disconnect dialog, hoping to fix a crash bug.
@@ -302,7 +348,7 @@
src/resources/npcdb.cpp, data/npcs.xml, src/Makefile.am, tmc.cbp:
Implemented NPC XML database which maps NPC IDs to one or more
animation files and thus enables animated NPCs.
-
+
2008-03-30 Dennis Friis <peavey@placid.dk>
* configure.ac: Updated for tmwdata split.
@@ -536,7 +582,7 @@
2007-12-28 Philipp Sehmisch <tmw@crushnet.org>
* data/maps/new_3-1.tmx: Some mapping errors fixed by Zipon.
- * src/being.cpp, src/monster.cpp, src/resources/monsterinfo.cpp,
+ * src/being.cpp, src/monster.cpp, src/resources/monsterinfo.cpp,
src/resources/monsterinfo.h: Added the possibility to assign particle
effects to monsters in the monster database.
* data/monsters.xml: Added flame particle effect to fire goblin as a
@@ -721,7 +767,7 @@
data/graphics/sprites/head-xmaself.png,
data/graphics/sprites/head-xmaself.xml: New versions of funky hat
and elf hat by QOAL.
-
+
2007-12-04 Philipp Sehmisch <tmw@crushnet.org>
* data/graphics/items/generic-santacookie.png,
@@ -984,7 +1030,7 @@
* src/player.cpp, data/graphics/sprites/hairstyle*:
Added support for different hairstyles for male and female characters
- (current female hairstyles are copies of the male ones until the
+ (current female hairstyles are copies of the male ones until the
real female ones are finished)
2007-09-30 Philipp Sehmisch <tmw@crushnet.org>
@@ -1376,15 +1422,15 @@
* src/particle.cpp, src/particleemitter.cpp: Corrected some perspective
issues of the particle engine and fixed a crash caused by particles
with child emitters that have an image than isn't used elsewhere.
- * data/maps/new-3-1.tmx.gz: Added a particle effect at the spawn point
+ * data/maps/new-3-1.tmx.gz: Added a particle effect at the spawn point
in Tulimshar.
2007-06-21 Philipp Sehmisch <tmw@crushnet.org>
- * data/monsters.xml, data/graphics/sprites/monster-logmonster.png,
+ * data/monsters.xml, data/graphics/sprites/monster-logmonster.png,
data/graphics/sprites/monster-logmonster.xml: Added logmonster by
Enigmatik (Monster ID is 23).
- * data/items.xml, data/equipment.xml,
+ * data/items.xml, data/equipment.xml,
data/graphics/items/armor-chest-lightplatemail.png,
data/graphics/sprites/chest-lightplatemail-male.xml,
data/graphics/sprites/chest-lightplatemail-male.png,
diff --git a/Makefile.am b/Makefile.am
index 7306c71f..c7f45241 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,7 @@ SUBDIRS = data docs src
desktopdir = $(datadir)/applications
-desktop_DATA = tmw.desktop
+desktop_DATA = tme.desktop
# Extra files to include
EXTRA_DIST = $(desktop_DATA)
diff --git a/README b/README
index 4d9fe6af..98772d58 100644
--- a/README
+++ b/README
@@ -52,6 +52,7 @@ Use arrow keys to move around. Other keys:
- Alt + S sit down / stand up
- Alt + F toggle debug pathfinding feature
- Alt + P take screenshot
+- Alt + T turns on anti-trade function
- A target nearest monster
- H hide all non-sticky windows
- G or Z pick up item
@@ -64,6 +65,38 @@ Left click to execute default action: walk, pick up an item, attack a monster
and talk to NPCs (be sure to click on their feet). Right click to show up a
context menu. Holding [Left Shift] prevents from walking when attacking.
+/Commands:
+
+- /help Displays the list of commands
+- /announce broadcasts a global msg(Gm Cammand only)
+- /clear clears the chat window
+- /who shows how many players are online
+- /where displays the map name your currently on
+- /whisper send a private msg to another player
+ (format: /whisper <charname> <message>)
+ If the <nick> has spaces in it, enclose it in double
+ quotes
+- /record Records the Chat output
+ (format: /record <filename to write to> starts the record
+ session /record again
+ stops the session)
+- /party <command> <params>: Party commands
+ - /party new creates a new party /party new <party name>
+ - /party create creates a new party /party create <party name>
+ - /party prefix This commands sets the party prefix character
+ /party prefix <prefix-char>
+ "/party prefix" reports the current party prefix
+ character
+ - /party leave This command causes the player to leave the party.
+Type /help party <option> for further help.
+- /present This command gets a list of players within hearing
+- /toggle make the chatlog lose focus on a blank line or after
+ message. (format: /toggle <option>, where option can be
+ '1', 'y' or 't' to make the chatlog lose focus on a
+ blank line, and '0', 'n' or 'f' to make the chatlog lose
+ focus after every message. /toggle displays the status)
+For more information, type /help <command>
+
3. Skills
---------
@@ -72,10 +105,16 @@ point to spend on skills.
BASIC SKILLS:
-Level 1: enables the ability to trade with others
-Level 2: enables the ability to express emotions
-Level 3: enables character to sit
-Other level not yet implemented.
+Level 1: enables the ability to trade with others
+Level 2: enables the ability to express emotions
+Level 3: enables character to sit
+Level 4: enables not used
+level 5: enables the ability to join a party
+level 6: enables not used
+level 7: enables the ability to create a party
+level 8: enables not used
+level 9: enables not used
+level 10: enables not used
4. Support
----------
@@ -83,9 +122,9 @@ Other level not yet implemented.
If you're having troubles, please first of all read the FAQ.
If you can't find a solution to your problem, feel free to check our
Bugs/Support section of the forum:
-- http://themanaworld.org/phpBB2/viewforum.php?f=3
+- http://216.139.126.36/forums
or come visit us on our IRC channel:
-- #themanaworld @ irc.freenode.net
+- #themanaexperiment @ irc.freenode.net
Otherwise check the AUTHORS file to have a list of developers and how to
contact them.
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 00000000..eb3b99a2
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,868 @@
+# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(AC_AUTOCONF_VERSION, [2.61],,
+[m4_warning([this file was generated for autoconf 2.61.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.10.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 13
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/autom4te.cache/traces.0 b/autom4te.cache/traces.0
new file mode 100644
index 00000000..ac0ed47f
--- /dev/null
+++ b/autom4te.cache/traces.0
@@ -0,0 +1,698 @@
+m4trace:/usr/share/aclocal-1.10/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.10.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+m4trace:/usr/share/aclocal-1.10/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+m4trace:/usr/share/aclocal-1.10/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+m4trace:/usr/share/aclocal-1.10/cond.m4:15: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+m4trace:/usr/share/aclocal-1.10/depend.m4:28: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+m4trace:/usr/share/aclocal-1.10/depend.m4:139: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+m4trace:/usr/share/aclocal-1.10/depend.m4:147: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+m4trace:/usr/share/aclocal-1.10/depout.m4:14: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])
+m4trace:/usr/share/aclocal-1.10/depout.m4:64: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+m4trace:/usr/share/aclocal-1.10/init.m4:26: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+m4trace:/usr/share/aclocal-1.10/init.m4:113: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+m4trace:/usr/share/aclocal-1.10/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+m4trace:/usr/share/aclocal-1.10/lead-dot.m4:12: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+m4trace:/usr/share/aclocal-1.10/make.m4:14: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+m4trace:/usr/share/aclocal-1.10/missing.m4:14: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+m4trace:/usr/share/aclocal-1.10/missing.m4:24: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+m4trace:/usr/share/aclocal-1.10/mkdirp.m4:11: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+m4trace:/usr/share/aclocal-1.10/options.m4:13: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+m4trace:/usr/share/aclocal-1.10/options.m4:19: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+m4trace:/usr/share/aclocal-1.10/options.m4:25: -1- AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+m4trace:/usr/share/aclocal-1.10/options.m4:31: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+m4trace:/usr/share/aclocal-1.10/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+m4trace:/usr/share/aclocal-1.10/sanity.m4:14: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+m4trace:/usr/share/aclocal-1.10/strip.m4:17: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+m4trace:/usr/share/aclocal-1.10/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE])
+m4trace:/usr/share/aclocal-1.10/tar.m4:24: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+])
+m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?A[CHUM]_])
+m4trace:configure.ac:2: -1- m4_pattern_forbid([_AC_])
+m4trace:configure.ac:2: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^AS_FLAGS$])
+m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?m4_])
+m4trace:configure.ac:2: -1- m4_pattern_forbid([^dnl$])
+m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?AS_])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^SHELL$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^PATH_SEPARATOR$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^exec_prefix$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^prefix$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^program_transform_name$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^bindir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^sbindir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^libexecdir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^datarootdir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^datadir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^sysconfdir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^sharedstatedir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^localstatedir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^includedir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^oldincludedir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^docdir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^infodir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^htmldir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^dvidir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^pdfdir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^psdir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^libdir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^localedir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^mandir$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^DEFS$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_C$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_N$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_T$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^build_alias$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^host_alias$])
+m4trace:configure.ac:2: -1- m4_pattern_allow([^target_alias$])
+m4trace:configure.ac:4: -1- _m4_warn([obsolete], [The macro `AC_LANG_CPLUSPLUS' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/c.m4:105: AC_LANG_CPLUSPLUS is expanded from...
+configure.ac:4: the top level])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CXXFLAGS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^ac_ct_CXX$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^EXEEXT$])
+m4trace:configure.ac:7: -1- m4_pattern_allow([^OBJEXT$])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
+m4trace:configure.ac:8: -1- m4_pattern_allow([^INSTALL_DATA$])
+m4trace:configure.ac:9: -1- m4_pattern_allow([^SET_MAKE$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^CXXCPP$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^CXXCPP$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^GREP$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^GREP$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^EGREP$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^EGREP$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^STDC_HEADERS$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^HAVE__BOOL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^HAVE_STDBOOL_H$])
+m4trace:configure.ac:13: -1- m4_pattern_allow([^const$])
+m4trace:configure.ac:14: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$])
+m4trace:configure.ac:15: -1- m4_pattern_allow([^volatile$])
+m4trace:configure.ac:18: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^HAVE_MALLOC$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^HAVE_MALLOC$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.ac:19: -1- m4_pattern_allow([^malloc$])
+m4trace:configure.ac:20: -1- m4_pattern_allow([^HAVE_REALLOC$])
+m4trace:configure.ac:20: -1- m4_pattern_allow([^HAVE_REALLOC$])
+m4trace:configure.ac:20: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.ac:20: -1- m4_pattern_allow([^realloc$])
+m4trace:configure.ac:21: -1- m4_pattern_allow([^SELECT_TYPE_ARG1$])
+m4trace:configure.ac:21: -1- m4_pattern_allow([^SELECT_TYPE_ARG234$])
+m4trace:configure.ac:21: -1- m4_pattern_allow([^SELECT_TYPE_ARG5$])
+m4trace:configure.ac:22: -1- m4_pattern_allow([^HAVE_DOPRNT$])
+m4trace:configure.ac:26: -1- m4_pattern_allow([^HAVE_LIBPTHREAD$])
+m4trace:configure.ac:29: -1- m4_pattern_allow([^HAVE_LIBGUICHAN$])
+m4trace:configure.ac:35: -1- m4_pattern_allow([^HAVE_LIBZ$])
+m4trace:configure.ac:38: -1- m4_pattern_allow([^HAVE_LIBPHYSFS$])
+m4trace:configure.ac:41: -1- m4_pattern_allow([^HAVE_LIBCURL$])
+m4trace:configure.ac:45: -1- m4_pattern_allow([^CURL_LIBS$])
+m4trace:configure.ac:46: -1- m4_pattern_allow([^CURL_CFLAGS$])
+m4trace:configure.ac:48: -1- m4_pattern_allow([^HAVE_LIBXML2$])
+m4trace:configure.ac:51: -1- m4_pattern_allow([^HAVE_LIBPNG$])
+m4trace:configure.ac:54: -1- m4_pattern_allow([^HAVE_LIBSDL_IMAGE$])
+m4trace:configure.ac:58: -1- m4_pattern_allow([^HAVE_LIBSDL_MIXER$])
+m4trace:configure.ac:61: -1- m4_pattern_allow([^HAVE_LIBSDL_NET$])
+m4trace:configure.ac:65: -1- m4_pattern_allow([^STDC_HEADERS$])
+m4trace:configure.ac:72: -1- AM_INIT_AUTOMAKE
+m4trace:configure.ac:72: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
+m4trace:configure.ac:72: -1- AM_SET_CURRENT_AUTOMAKE_VERSION
+m4trace:configure.ac:72: -1- AM_AUTOMAKE_VERSION([1.10.1])
+m4trace:configure.ac:72: -1- _AM_AUTOCONF_VERSION([2.61])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^am__isrc$])
+m4trace:configure.ac:72: -1- _AM_SUBST_NOTMAKE([am__isrc])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^CYGPATH_W$])
+m4trace:configure.ac:72: -1- _AM_SET_OPTIONS([])
+m4trace:configure.ac:72: -1- _m4_warn([obsolete], [The macro `AC_FOREACH' is obsolete.
+You should run autoupdate.], [../../lib/autoconf/general.m4:196: AC_FOREACH is expanded from...
+/usr/share/aclocal-1.10/options.m4:25: _AM_SET_OPTIONS is expanded from...
+/usr/share/aclocal-1.10/init.m4:26: AM_INIT_AUTOMAKE is expanded from...
+configure.ac:72: the top level])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.ac:72: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+m4trace:configure.ac:72: -2- _AM_MANGLE_OPTION([no-define])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.ac:72: -1- AM_SANITY_CHECK
+m4trace:configure.ac:72: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+m4trace:configure.ac:72: -1- AM_MISSING_HAS_RUN
+m4trace:configure.ac:72: -1- AM_AUX_DIR_EXPAND
+m4trace:configure.ac:72: -1- m4_pattern_allow([^ACLOCAL$])
+m4trace:configure.ac:72: -1- AM_MISSING_PROG([AUTOCONF], [autoconf])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^AUTOCONF$])
+m4trace:configure.ac:72: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^AUTOMAKE$])
+m4trace:configure.ac:72: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^AUTOHEADER$])
+m4trace:configure.ac:72: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^MAKEINFO$])
+m4trace:configure.ac:72: -1- AM_PROG_INSTALL_SH
+m4trace:configure.ac:72: -1- m4_pattern_allow([^install_sh$])
+m4trace:configure.ac:72: -1- AM_PROG_INSTALL_STRIP
+m4trace:configure.ac:72: -1- m4_pattern_allow([^STRIP$])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
+m4trace:configure.ac:72: -1- AM_PROG_MKDIR_P
+m4trace:configure.ac:72: -1- m4_pattern_allow([^mkdir_p$])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^AWK$])
+m4trace:configure.ac:72: -1- AM_SET_LEADING_DOT
+m4trace:configure.ac:72: -1- m4_pattern_allow([^am__leading_dot$])
+m4trace:configure.ac:72: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+m4trace:configure.ac:72: -2- _AM_MANGLE_OPTION([tar-ustar])
+m4trace:configure.ac:72: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])
+m4trace:configure.ac:72: -2- _AM_MANGLE_OPTION([tar-pax])
+m4trace:configure.ac:72: -1- _AM_PROG_TAR([v7])
+m4trace:configure.ac:72: -1- AM_MISSING_PROG([AMTAR], [tar])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^AMTAR$])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^am__tar$])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^am__untar$])
+m4trace:configure.ac:72: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+m4trace:configure.ac:72: -2- _AM_MANGLE_OPTION([no-dependencies])
+m4trace:configure.ac:72: -1- _AM_DEPENDENCIES([CXX])
+m4trace:configure.ac:72: -1- AM_SET_DEPDIR
+m4trace:configure.ac:72: -1- m4_pattern_allow([^DEPDIR$])
+m4trace:configure.ac:72: -1- AM_OUTPUT_DEPENDENCY_COMMANDS
+m4trace:configure.ac:72: -1- AM_MAKE_INCLUDE
+m4trace:configure.ac:72: -1- m4_pattern_allow([^am__include$])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^am__quote$])
+m4trace:configure.ac:72: -1- AM_DEP_TRACK
+m4trace:configure.ac:72: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^AMDEP_TRUE$])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^AMDEP_FALSE$])
+m4trace:configure.ac:72: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE])
+m4trace:configure.ac:72: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
+m4trace:configure.ac:72: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^CXXDEPMODE$])
+m4trace:configure.ac:72: -1- AM_CONDITIONAL([am__fastdepCXX], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
+m4trace:configure.ac:72: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
+m4trace:configure.ac:72: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE])
+m4trace:configure.ac:72: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE])
+m4trace:configure.ac:80: -1- m4_pattern_allow([^HAVE_LIBGL$])
+m4trace:configure.ac:82: -1- m4_pattern_allow([^USE_OPENGL$])
+m4trace:configure.ac:86: -1- m4_pattern_allow([^LIBSDL_CONFIG$])
+m4trace:configure.ac:91: -1- m4_pattern_allow([^LIBSDL_LIBS$])
+m4trace:configure.ac:92: -1- m4_pattern_allow([^LIBSDL_CFLAGS$])
+m4trace:configure.ac:94: -1- m4_pattern_allow([^HAVE_LIBSDL$])
+m4trace:configure.ac:97: -1- m4_pattern_allow([^HAVE_LIBSDL$])
+m4trace:configure.ac:114: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.ac:114: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.ac:114: -1- _AC_AM_CONFIG_HEADER_HOOK([$ac_file])
+m4trace:configure.ac:114: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
diff --git a/configure.ac b/configure.ac
index 6816c743..b85683ff 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
AC_PREREQ(2.59)
-AC_INIT([The Mana World], [0.0.24.1], [elvenprogrammer@gmail.com], [tmw])
+AC_INIT([The Mana Experiment], [Tme SVN 0.0.25], [blame582@gmail.com], [tme])
AC_CONFIG_HEADERS([config.h:config.h.in])
AC_LANG_CPLUSPLUS
diff --git a/depcomp b/depcomp
new file mode 100755
index 00000000..e5f9736c
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,589 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2007-03-29.01
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
+# Foundation, Inc.
+
+# This program 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, or (at your option)
+# any later version.
+
+# This program 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 1ee9a9a6..43c0f6cc 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1,4 +1,4 @@
-man6_MANS = tmw.6
+man6_MANS = tme.6
EXTRA_DIST = $(man6_MANS) \
packages.txt \
diff --git a/docs/tmw.6 b/docs/tme.6
index 0dee82c7..f4fe85cf 100644
--- a/docs/tmw.6
+++ b/docs/tme.6
@@ -1,13 +1,13 @@
-.TH "TMW" "6"
+.TH "TME" "6"
.SH "NAME"
-tmw \- tmw is The Mana World: A fantasy online game
+tme \- tme is The Mana Experiment: A fantasy online game
.SH "SYNOPSIS"
-\fBtmw\fR
+\fBtme\fR
.SH "DESCRIPTION"
This manual page documents briefly the
-\fBtmw\fR ingame
+\fBtme\fR ingame
commands.
-\fBtmw\fR is a great online game based upon the Seiken Densetsu Serie.
+\fBtme\fR is a great online game based upon the Seiken Densetsu Serie.
It has its own universe, and and its own character management system, which will
give you the opportunity to play in a 2D heroic-fantasy world forever.
.SH "BINARY PARAMETERS"
@@ -49,26 +49,49 @@ Make your character attack.
.B Key A:
Target nearest monster.
.TP
-.B Key G:
+.B Key Z:
Get items on the ground or in a chest.
.TP
+.B Key S:
+Make your character sit.
+.TP
.B Alt + 1...9:
Shows an emoticon above your character.
.TP
-.B Alt + I:
-Shows / Hide inventory window.
+.B F1:
+Displays / Hides in game help.
+.TP
+.B F2:
+Displays / Hides status window.
+.TP
+.B F3:
+Displays / Hides inventory window.
+.TP
+.B F4:
+Displays / Hides equipment window.
+.TP
+.B F5:
+Displays / Hides skills window.
+.TP
+.B F6:
+Displays / Hides map.
+.TP
+.B F7
+Displays / Hides messages.
.TP
-.B Alt + K:
-Shows / Hide skills window.
+.B F8
+Displays / Hides hot-keys.
.TP
-.B Alt + E:
-Shows / Hide equipment window.
+.B F9:
+Displays / Hides configuration window.
.TP
-.B Alt + C:
-Shows configuration window.
+.B F10
+Displays / Hides debug window.
.SH "AUTHOR"
This manual page was written by Patrick Matth\[:a]i <patrick.matthaei@web.de>
for The Mana World project.
+With slight alterations by Daniel Thomas\[:a]i <kraant@gmail.com>,
+for The Mana Experiment.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU General Public License, Version 2 any
later version published by the Free Software Foundation.
diff --git a/install-sh b/install-sh
new file mode 100755
index 00000000..a5897de6
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,519 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2006-12-25.00
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/missing b/missing
new file mode 100755
index 00000000..1c8ff704
--- /dev/null
+++ b/missing
@@ -0,0 +1,367 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program 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, or (at your option)
+# any later version.
+
+# This program 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case $firstarg in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case $firstarg in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/src/.deps/tmw-action.Po b/src/.deps/tmw-action.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-action.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-ambientoverlay.Po b/src/.deps/tmw-ambientoverlay.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-ambientoverlay.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-animatedsprite.Po b/src/.deps/tmw-animatedsprite.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-animatedsprite.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-animation.Po b/src/.deps/tmw-animation.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-animation.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-animationparticle.Po b/src/.deps/tmw-animationparticle.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-animationparticle.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-base64.Po b/src/.deps/tmw-base64.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-base64.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-being.Po b/src/.deps/tmw-being.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-being.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-beinghandler.Po b/src/.deps/tmw-beinghandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-beinghandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-beingmanager.Po b/src/.deps/tmw-beingmanager.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-beingmanager.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-box.Po b/src/.deps/tmw-box.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-box.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-browserbox.Po b/src/.deps/tmw-browserbox.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-browserbox.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-buddylist.Po b/src/.deps/tmw-buddylist.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-buddylist.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-buddywindow.Po b/src/.deps/tmw-buddywindow.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-buddywindow.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-button.Po b/src/.deps/tmw-button.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-button.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-buy.Po b/src/.deps/tmw-buy.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-buy.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-buysell.Po b/src/.deps/tmw-buysell.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-buysell.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-buysellhandler.Po b/src/.deps/tmw-buysellhandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-buysellhandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-char_select.Po b/src/.deps/tmw-char_select.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-char_select.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-char_server.Po b/src/.deps/tmw-char_server.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-char_server.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-chargedialog.Po b/src/.deps/tmw-chargedialog.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-chargedialog.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-charserverhandler.Po b/src/.deps/tmw-charserverhandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-charserverhandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-chat.Po b/src/.deps/tmw-chat.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-chat.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-chathandler.Po b/src/.deps/tmw-chathandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-chathandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-chatinput.Po b/src/.deps/tmw-chatinput.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-chatinput.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-checkbox.Po b/src/.deps/tmw-checkbox.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-checkbox.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-configuration.Po b/src/.deps/tmw-configuration.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-configuration.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-confirm_dialog.Po b/src/.deps/tmw-confirm_dialog.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-confirm_dialog.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-connection.Po b/src/.deps/tmw-connection.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-connection.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-debugwindow.Po b/src/.deps/tmw-debugwindow.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-debugwindow.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-dropdown.Po b/src/.deps/tmw-dropdown.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-dropdown.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-dye.Po b/src/.deps/tmw-dye.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-dye.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-engine.Po b/src/.deps/tmw-engine.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-engine.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-equipment.Po b/src/.deps/tmw-equipment.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-equipment.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-equipmenthandler.Po b/src/.deps/tmw-equipmenthandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-equipmenthandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-equipmentwindow.Po b/src/.deps/tmw-equipmentwindow.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-equipmentwindow.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-floor_item.Po b/src/.deps/tmw-floor_item.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-floor_item.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-flooritemmanager.Po b/src/.deps/tmw-flooritemmanager.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-flooritemmanager.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-focushandler.Po b/src/.deps/tmw-focushandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-focushandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-game.Po b/src/.deps/tmw-game.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-game.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-gccontainer.Po b/src/.deps/tmw-gccontainer.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-gccontainer.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-graphics.Po b/src/.deps/tmw-graphics.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-graphics.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-gui.Po b/src/.deps/tmw-gui.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-gui.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-hbox.Po b/src/.deps/tmw-hbox.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-hbox.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-help.Po b/src/.deps/tmw-help.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-help.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-image.Po b/src/.deps/tmw-image.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-image.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-imageloader.Po b/src/.deps/tmw-imageloader.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-imageloader.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-imageparticle.Po b/src/.deps/tmw-imageparticle.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-imageparticle.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-imageset.Po b/src/.deps/tmw-imageset.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-imageset.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-imagewriter.Po b/src/.deps/tmw-imagewriter.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-imagewriter.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-inttextbox.Po b/src/.deps/tmw-inttextbox.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-inttextbox.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-inventory.Po b/src/.deps/tmw-inventory.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-inventory.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-inventoryhandler.Po b/src/.deps/tmw-inventoryhandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-inventoryhandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-inventorywindow.Po b/src/.deps/tmw-inventorywindow.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-inventorywindow.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-item.Po b/src/.deps/tmw-item.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-item.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-item_amount.Po b/src/.deps/tmw-item_amount.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-item_amount.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-itemcontainer.Po b/src/.deps/tmw-itemcontainer.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-itemcontainer.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-itemdb.Po b/src/.deps/tmw-itemdb.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-itemdb.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-itemhandler.Po b/src/.deps/tmw-itemhandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-itemhandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-iteminfo.Po b/src/.deps/tmw-iteminfo.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-iteminfo.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-itemshortcut.Po b/src/.deps/tmw-itemshortcut.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-itemshortcut.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-itemshortcutcontainer.Po b/src/.deps/tmw-itemshortcutcontainer.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-itemshortcutcontainer.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-itemshortcutwindow.Po b/src/.deps/tmw-itemshortcutwindow.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-itemshortcutwindow.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-joystick.Po b/src/.deps/tmw-joystick.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-joystick.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-keyboardconfig.Po b/src/.deps/tmw-keyboardconfig.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-keyboardconfig.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-listbox.Po b/src/.deps/tmw-listbox.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-listbox.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-localplayer.Po b/src/.deps/tmw-localplayer.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-localplayer.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-log.Po b/src/.deps/tmw-log.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-log.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-login.Po b/src/.deps/tmw-login.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-login.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-loginhandler.Po b/src/.deps/tmw-loginhandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-loginhandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-main.Po b/src/.deps/tmw-main.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-main.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-map.Po b/src/.deps/tmw-map.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-map.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-maploginhandler.Po b/src/.deps/tmw-maploginhandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-maploginhandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-mapreader.Po b/src/.deps/tmw-mapreader.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-mapreader.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-menuwindow.Po b/src/.deps/tmw-menuwindow.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-menuwindow.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-messagehandler.Po b/src/.deps/tmw-messagehandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-messagehandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-messagein.Po b/src/.deps/tmw-messagein.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-messagein.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-messageout.Po b/src/.deps/tmw-messageout.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-messageout.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-minimap.Po b/src/.deps/tmw-minimap.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-minimap.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-ministatus.Po b/src/.deps/tmw-ministatus.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-ministatus.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-monster.Po b/src/.deps/tmw-monster.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-monster.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-monsterdb.Po b/src/.deps/tmw-monsterdb.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-monsterdb.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-monsterinfo.Po b/src/.deps/tmw-monsterinfo.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-monsterinfo.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-music.Po b/src/.deps/tmw-music.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-music.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-network.Po b/src/.deps/tmw-network.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-network.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-newskill.Po b/src/.deps/tmw-newskill.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-newskill.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-npc.Po b/src/.deps/tmw-npc.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-npc.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-npc_text.Po b/src/.deps/tmw-npc_text.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-npc_text.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-npcdb.Po b/src/.deps/tmw-npcdb.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-npcdb.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-npchandler.Po b/src/.deps/tmw-npchandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-npchandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-npclistdialog.Po b/src/.deps/tmw-npclistdialog.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-npclistdialog.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-ok_dialog.Po b/src/.deps/tmw-ok_dialog.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-ok_dialog.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-openglgraphics.Po b/src/.deps/tmw-openglgraphics.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-openglgraphics.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-particle.Po b/src/.deps/tmw-particle.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-particle.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-particleemitter.Po b/src/.deps/tmw-particleemitter.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-particleemitter.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-passwordfield.Po b/src/.deps/tmw-passwordfield.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-passwordfield.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-player.Po b/src/.deps/tmw-player.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-player.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-player_relations.Po b/src/.deps/tmw-player_relations.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-player_relations.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-playerbox.Po b/src/.deps/tmw-playerbox.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-playerbox.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-playerhandler.Po b/src/.deps/tmw-playerhandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-playerhandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-popupmenu.Po b/src/.deps/tmw-popupmenu.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-popupmenu.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-progressbar.Po b/src/.deps/tmw-progressbar.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-progressbar.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-protocol.Po b/src/.deps/tmw-protocol.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-protocol.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-radiobutton.Po b/src/.deps/tmw-radiobutton.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-radiobutton.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-register.Po b/src/.deps/tmw-register.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-register.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-resizegrip.Po b/src/.deps/tmw-resizegrip.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-resizegrip.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-resource.Po b/src/.deps/tmw-resource.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-resource.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-resourcemanager.Po b/src/.deps/tmw-resourcemanager.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-resourcemanager.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-scrollarea.Po b/src/.deps/tmw-scrollarea.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-scrollarea.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-sell.Po b/src/.deps/tmw-sell.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-sell.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-setup.Po b/src/.deps/tmw-setup.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-setup.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-setup_audio.Po b/src/.deps/tmw-setup_audio.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-setup_audio.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-setup_joystick.Po b/src/.deps/tmw-setup_joystick.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-setup_joystick.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-setup_keyboard.Po b/src/.deps/tmw-setup_keyboard.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-setup_keyboard.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-setup_players.Po b/src/.deps/tmw-setup_players.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-setup_players.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-setup_video.Po b/src/.deps/tmw-setup_video.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-setup_video.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-shop.Po b/src/.deps/tmw-shop.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-shop.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-shoplistbox.Po b/src/.deps/tmw-shoplistbox.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-shoplistbox.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-simpleanimation.Po b/src/.deps/tmw-simpleanimation.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-simpleanimation.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-skill.Po b/src/.deps/tmw-skill.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-skill.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-skillhandler.Po b/src/.deps/tmw-skillhandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-skillhandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-slider.Po b/src/.deps/tmw-slider.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-slider.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-sound.Po b/src/.deps/tmw-sound.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-sound.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-soundeffect.Po b/src/.deps/tmw-soundeffect.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-soundeffect.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-spritedef.Po b/src/.deps/tmw-spritedef.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-spritedef.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-status.Po b/src/.deps/tmw-status.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-status.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-strprintf.Po b/src/.deps/tmw-strprintf.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-strprintf.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-tabbedcontainer.Po b/src/.deps/tmw-tabbedcontainer.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-tabbedcontainer.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-table.Po b/src/.deps/tmw-table.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-table.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-table_model.Po b/src/.deps/tmw-table_model.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-table_model.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-textbox.Po b/src/.deps/tmw-textbox.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-textbox.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-textfield.Po b/src/.deps/tmw-textfield.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-textfield.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-textparticle.Po b/src/.deps/tmw-textparticle.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-textparticle.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-trade.Po b/src/.deps/tmw-trade.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-trade.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-tradehandler.Po b/src/.deps/tmw-tradehandler.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-tradehandler.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-updatewindow.Po b/src/.deps/tmw-updatewindow.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-updatewindow.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-vbox.Po b/src/.deps/tmw-vbox.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-vbox.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-viewport.Po b/src/.deps/tmw-viewport.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-viewport.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-window.Po b/src/.deps/tmw-window.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-window.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-windowcontainer.Po b/src/.deps/tmw-windowcontainer.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-windowcontainer.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/.deps/tmw-xml.Po b/src/.deps/tmw-xml.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/src/.deps/tmw-xml.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/src/Makefile.am b/src/Makefile.am
index 3156a800..f1352f9e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,14 +1,16 @@
-bin_PROGRAMS = tmw
-tmw_SOURCES = gui/widgets/resizegrip.cpp \
+bin_PROGRAMS = tme
+tme_SOURCES = gui/widgets/dropdown.cpp \
+ gui/widgets/dropdown.h \
+ gui/widgets/resizegrip.cpp \
gui/widgets/resizegrip.h \
gui/box.h \
gui/box.cpp \
gui/browserbox.cpp \
gui/browserbox.h \
- gui/buddywindow.cpp \
- gui/buddywindow.h \
gui/button.cpp \
gui/button.h \
+ gui/buttonbox.cpp \
+ gui/buttonbox.h \
gui/buy.cpp \
gui/buy.h \
gui/buysell.cpp \
@@ -163,6 +165,8 @@ tmw_SOURCES = gui/widgets/resizegrip.cpp \
net/network.h \
net/npchandler.cpp \
net/npchandler.h \
+ net/partyhandler.cpp \
+ net/partyhandler.h \
net/playerhandler.cpp \
net/playerhandler.h \
net/protocol.cpp \
@@ -278,11 +282,15 @@ tmw_SOURCES = gui/widgets/resizegrip.cpp \
particle.h \
particleemitter.cpp \
particleemitter.h \
+ party.cpp \
+ party.h \
player.cpp \
player.h \
player_relations.cpp \
player_relations.h \
properties.h \
+ recorder.cpp \
+ recorder.h \
serverinfo.h \
shopitem.cpp \
shopitem.h \
@@ -291,6 +299,10 @@ tmw_SOURCES = gui/widgets/resizegrip.cpp \
sound.cpp \
sound.h \
sprite.h \
+ text.cpp \
+ text.h \
+ textmanager.cpp \
+ textmanager.h \
textparticle.cpp \
textparticle.h \
tileset.h \
@@ -302,7 +314,7 @@ INCLUDES = \
-DTMW_DATADIR=\""$(pkgdatadir)/"\"
# the library search path.
-tmw_LDFLAGS = $(all_libraries) $(LIBSDL_RPATH) `pkg-config --libs libxml-2.0`
-tmw_CXXFLAGS = -Wall $(LIBSDL_CFLAGS) `pkg-config --cflags libxml-2.0` $(CURL_CFLAGS)
-tmw_LDADD = $(LIBSDL_LIBS) -lguichan_sdl $(CURL_LIBS)
-tmw_TARGET = tmw
+tme_LDFLAGS = $(all_libraries) $(LIBSDL_RPATH) `pkg-config --libs libxml-2.0`
+tme_CXXFLAGS = -Wall $(LIBSDL_CFLAGS) `pkg-config --cflags libxml-2.0` $(CURL_CFLAGS)
+tme_LDADD = $(LIBSDL_LIBS) -lguichan_sdl $(CURL_LIBS)
+tme_TARGET = tme
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp
index 466779fd..dd43e0f1 100644
--- a/src/animatedsprite.cpp
+++ b/src/animatedsprite.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: animatedsprite.cpp 3752 2007-11-20 10:50:00Z b_lindeijer $
*/
#include "animatedsprite.h"
diff --git a/src/animatedsprite.h b/src/animatedsprite.h
index a1fbe7a0..1fac5220 100644
--- a/src/animatedsprite.h
+++ b/src/animatedsprite.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: animatedsprite.h 3752 2007-11-20 10:50:00Z b_lindeijer $
*/
#ifndef _TMW_ANIMATEDSPRITE_H
diff --git a/src/being.cpp b/src/being.cpp
index 625b0eef..14f7ce20 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: being.cpp 4301 2008-05-28 16:06:48Z peaveydk $
*/
#include "being.h"
@@ -32,6 +32,7 @@
#include "log.h"
#include "map.h"
#include "particle.h"
+#include "text.h"
#include "resources/resourcemanager.h"
#include "resources/imageset.h"
@@ -45,6 +46,9 @@
int Being::instances = 0;
ImageSet *Being::emotionSet = NULL;
+static const int X_SPEECH_OFFSET = 18;
+static const int Y_SPEECH_OFFSET = 60;
+
Being::Being(int id, int job, Map *map):
mJob(job),
mX(0), mY(0),
@@ -77,6 +81,7 @@ Being::Being(int id, int job, Map *map):
}
instances++;
+ mSpeech = 0;
}
Being::~Being()
@@ -100,6 +105,10 @@ Being::~Being()
emotionSet->decRef();
emotionSet = NULL;
}
+ if (mSpeech)
+ {
+ delete mSpeech;
+ }
}
void
@@ -147,7 +156,13 @@ Being::setSprite(int slot, int id, std::string color)
void
Being::setSpeech(const std::string &text, Uint32 time)
{
- mSpeech = text;
+ if (mSpeech) // don't introduce a memory leak
+ {
+ delete mSpeech;
+ }
+ mSpeech = new Text(text, mPx + X_SPEECH_OFFSET, mPy - Y_SPEECH_OFFSET,
+ gcn::Graphics::CENTER, speechFont,
+ gcn::Color(255, 255, 255));
mSpeechTime = 500;
}
@@ -355,13 +370,28 @@ void
Being::logic()
{
// Reduce the time that speech is still displayed
- if (mSpeechTime > 0)
- mSpeechTime--;
+ if (mSpeechTime > 0 && mSpeech)
+ {
+ if (--mSpeechTime == 0)
+ {
+ delete mSpeech;
+ mSpeech = 0;
+ }
+ }
+ int oldPx = mPx;
+ int oldPy = mPy;
// Update pixel coordinates
mPx = mX * 32 + getXOffset();
mPy = mY * 32 + getYOffset();
-
+ if (mPx != oldPx || mPy != oldPy)
+ {
+ if (mSpeech)
+ {
+ mSpeech->adviseXY(mPx + X_SPEECH_OFFSET, mPy - Y_SPEECH_OFFSET);
+ }
+ updateCoords();
+ }
if (mEmotion != 0)
{
mEmotionTime--;
@@ -426,21 +456,6 @@ Being::drawEmotion(Graphics *graphics, int offsetX, int offsetY)
graphics->drawImage(emotionSet->get(emotionIndex), px, py);
}
-void
-Being::drawSpeech(Graphics *graphics, int offsetX, int offsetY)
-{
- int px = mPx + offsetX;
- int py = mPy + offsetY;
-
- // Draw speech above this being
- if (mSpeechTime > 0)
- {
- graphics->setFont(speechFont);
- graphics->setColor(gcn::Color(255, 255, 255));
- graphics->drawText(mSpeech, px + 18, py - 60, gcn::Graphics::CENTER);
- }
-}
-
Being::Type
Being::getType() const
{
diff --git a/src/being.h b/src/being.h
index 5ea8c0be..2f711fb8 100644
--- a/src/being.h
+++ b/src/being.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: being.h 4321 2008-06-02 11:42:26Z b_lindeijer $
*/
#ifndef _TMW_BEING_H
@@ -47,6 +47,7 @@ class Map;
class Graphics;
class ImageSet;
class Particle;
+class Text;
/**
* A position along a being's path.
@@ -183,7 +184,7 @@ class Being : public Sprite
*
* @param name The name that should appear.
*/
- void
+ virtual void
setName(const std::string &name) { mName = name; }
/**
@@ -235,24 +236,12 @@ class Being : public Sprite
logic();
/**
- * Draws the speech text above the being.
- */
- void
- drawSpeech(Graphics *graphics, int offsetX, int offsetY);
-
- /**
* Draws the emotion picture above the being.
*/
void
drawEmotion(Graphics *graphics, int offsetX, int offsetY);
/**
- * Draws the name text below the being.
- */
- virtual void
- drawName(Graphics *, int, int) {};
-
- /**
* Returns the type of the being.
*/
virtual Type getType() const;
@@ -359,7 +348,11 @@ class Being : public Sprite
*/
void controlParticle(Particle *particle);
- void setEmote(Uint8 emotion, Uint8 emote_time) { mEmotion = emotion; mEmotionTime = emote_time; }
+ void setEmote(Uint8 emotion, Uint8 emote_time)
+ {
+ mEmotion = emotion;
+ mEmotionTime = emote_time;
+ }
const std::auto_ptr<Equipment> mEquipment;
@@ -370,6 +363,11 @@ class Being : public Sprite
void setPath(const Path &path);
/**
+ * Let the sub-classes react to a replacement
+ */
+ virtual void updateCoords() {}
+
+ /**
* Returns the sprite direction of this being.
*/
SpriteDirection getSpriteDirection() const;
@@ -385,7 +383,7 @@ class Being : public Sprite
const ItemInfo* mEquippedWeapon;
Path mPath;
- std::string mSpeech;
+ Text *mSpeech;
Uint16 mHairStyle, mHairColor;
Uint8 mGender;
Uint32 mSpeechTime;
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp
index b683b1bd..d1a333d0 100644
--- a/src/beingmanager.cpp
+++ b/src/beingmanager.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: beingmanager.cpp 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/beingmanager.h b/src/beingmanager.h
index 243486e4..ff2d1980 100644
--- a/src/beingmanager.h
+++ b/src/beingmanager.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: beingmanager.h 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
#ifndef _TMW_BEINGMANAGER_H
diff --git a/src/configlistener.h b/src/configlistener.h
index 7ce5d949..bf00f3ef 100644
--- a/src/configlistener.h
+++ b/src/configlistener.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: configlistener.h 1673 2005-08-29 22:00:35Z der_doener $
*/
#ifndef _TMW_CONFIGLISTENER_H
diff --git a/src/configuration.cpp b/src/configuration.cpp
index 7e8cb542..e9c8db7a 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: configuration.cpp 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
diff --git a/src/configuration.h b/src/configuration.h
index 36d9e150..7dadb083 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: configuration.h 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
#ifndef _TMW_CONFIGURATION_H
diff --git a/src/engine.cpp b/src/engine.cpp
index d4033193..d1912b0d 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: engine.cpp 4000 2008-03-23 11:47:52Z b_lindeijer $
*/
#include "engine.h"
diff --git a/src/engine.h b/src/engine.h
index 4575051e..ed76a595 100644
--- a/src/engine.h
+++ b/src/engine.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: engine.h 4000 2008-03-23 11:47:52Z b_lindeijer $
*/
#ifndef _ENGINE_H
diff --git a/src/equipment.cpp b/src/equipment.cpp
index d1f9a6cf..0a285447 100644
--- a/src/equipment.cpp
+++ b/src/equipment.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: equipment.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "equipment.h"
diff --git a/src/equipment.h b/src/equipment.h
index 80a2ae49..04017549 100644
--- a/src/equipment.h
+++ b/src/equipment.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: equipment.h 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#ifndef _TMW_EQUIPMENT_H_
diff --git a/src/floor_item.cpp b/src/floor_item.cpp
index 9727093f..399a4149 100644
--- a/src/floor_item.cpp
+++ b/src/floor_item.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: floor_item.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "floor_item.h"
diff --git a/src/floor_item.h b/src/floor_item.h
index a87e3f79..7771d935 100644
--- a/src/floor_item.h
+++ b/src/floor_item.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: floor_item.h 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#ifndef _TMW_FLOORITEM_H_
diff --git a/src/flooritemmanager.cpp b/src/flooritemmanager.cpp
index 8a00cc51..f6ad3442 100644
--- a/src/flooritemmanager.cpp
+++ b/src/flooritemmanager.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: flooritemmanager.cpp 3754 2007-11-20 15:19:50Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/flooritemmanager.h b/src/flooritemmanager.h
index c12883a4..a6bfbdc3 100644
--- a/src/flooritemmanager.h
+++ b/src/flooritemmanager.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: flooritemmanager.h 2150 2006-02-06 02:56:48Z der_doener $
*/
#ifndef _TMW_FLOORITEMMANAGER_H
diff --git a/src/game.cpp b/src/game.cpp
index 58c28640..d018852b 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: game.cpp 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
#include "game.h"
@@ -68,7 +68,6 @@
#include "gui/status.h"
#include "gui/trade.h"
#include "gui/viewport.h"
-
#include "net/beinghandler.h"
#include "net/buysellhandler.h"
#include "net/chathandler.h"
@@ -135,14 +134,14 @@ const int MAX_TIME = 10000;
namespace {
struct ExitListener : public gcn::ActionListener
{
- void action(const gcn::ActionEvent &event)
- {
- if (event.getId() == "yes" || event.getId() == "ok") {
- done = true;
- }
- exitConfirm = NULL;
- disconnectedDialog = NULL;
- }
+ void action(const gcn::ActionEvent &event)
+ {
+ if (event.getId() == "yes" || event.getId() == "ok") {
+ done = true;
+ }
+ exitConfirm = NULL;
+ disconnectedDialog = NULL;
+ }
} exitListener;
}
@@ -169,10 +168,10 @@ Uint32 nextSecond(Uint32 interval, void *param)
int get_elapsed_time(int start_time)
{
if (start_time <= tick_time) {
- return (tick_time - start_time) * 10;
+ return (tick_time - start_time) * 10;
}
else {
- return (tick_time + (MAX_TIME - start_time)) * 10;
+ return (tick_time + (MAX_TIME - start_time)) * 10;
}
}
@@ -219,7 +218,7 @@ void createGuiWindows(Network *network)
if (config.getValue("logToChat", 0))
{
- logger->setChatWindow(chatWindow);
+ logger->setChatWindow(chatWindow);
}
}
@@ -291,7 +290,7 @@ Game::Game(Network *network):
// Open the first device
if (Joystick::getNumberOfJoysticks() > 0)
{
- joystick = new Joystick(0);
+ joystick = new Joystick(0);
}
network->registerHandler(mBeingHandler.get());
@@ -332,30 +331,30 @@ bool saveScreenshot(SDL_Surface *screenshot)
bool found = false;
do {
- screenshotCount++;
- filename.str("");
+ screenshotCount++;
+ filename.str("");
#if (defined __USE_UNIX98 || defined __FreeBSD__)
- filename << PHYSFS_getUserDir() << ".tmw/";
+ filename << PHYSFS_getUserDir() << ".tme/";
#elif defined __APPLE__
- filename << PHYSFS_getUserDir() << "Desktop/";
+ filename << PHYSFS_getUserDir() << "Desktop/";
#endif
- filename << "TMW_Screenshot_" << screenshotCount << ".png";
- testExists.open(filename.str().c_str(), std::ios::in);
- found = !testExists.is_open();
- testExists.close();
+ filename << "TMW_Screenshot_" << screenshotCount << ".png";
+ testExists.open(filename.str().c_str(), std::ios::in);
+ found = !testExists.is_open();
+ testExists.close();
} while (!found);
if (ImageWriter::writePNG(screenshot, filename.str()))
{
- std::stringstream chatlogentry;
- chatlogentry << "Screenshot saved to " << filename.str().c_str();
- chatWindow->chatLog(chatlogentry.str(), BY_SERVER);
- return true;
+ std::stringstream chatlogentry;
+ chatlogentry << "Screenshot saved to " << filename.str().c_str();
+ chatWindow->chatLog(chatlogentry.str(), BY_SERVER);
+ return true;
}
else
{
- chatWindow->chatLog("Saving screenshot failed!", BY_SERVER);
- return false;
+ chatWindow->chatLog("Saving screenshot failed!", BY_SERVER);
+ return false;
}
}
@@ -379,60 +378,61 @@ void Game::logic()
while (!done)
{
- // Handle all necessary game logic
- while (get_elapsed_time(gameTime) > 0)
- {
- handleInput();
- engine->logic();
- gameTime++;
- }
-
- // This is done because at some point tick_time will wrap.
- gameTime = tick_time;
-
- // Update the screen when application is active, delay otherwise.
- if (SDL_GetAppState() & SDL_APPACTIVE)
- {
- // Draw a frame if either frames are not limited or enough time has
- // passed since the last frame.
- if (!mMinFrameTime ||
- get_elapsed_time(mDrawTime / 10) > mMinFrameTime)
- {
- frame++;
- gui->draw();
- graphics->updateScreen();
- mDrawTime += mMinFrameTime;
-
- // Make sure to wrap mDrawTime, since tick_time will wrap.
- if (mDrawTime > MAX_TIME * 10)
- mDrawTime -= MAX_TIME * 10;
- }
- else
- {
- SDL_Delay(10);
- }
- }
- else
- {
- SDL_Delay(10);
- mDrawTime = tick_time * 10;
- }
-
- // Handle network stuff
- mNetwork->flush();
- mNetwork->dispatchMessages();
-
- if (!mNetwork->isConnected())
- {
- if (!disconnectedDialog)
- {
- disconnectedDialog = new
- OkDialog("Network Error",
- "The connection to the server was lost, the program will now quit");
- disconnectedDialog->addActionListener(&exitListener);
- disconnectedDialog->requestMoveToTop();
- }
- }
+ // Handle all necessary game logic
+ while (get_elapsed_time(gameTime) > 0)
+ {
+ handleInput();
+ engine->logic();
+ gameTime++;
+ }
+
+ // This is done because at some point tick_time will wrap.
+ gameTime = tick_time;
+
+ // Update the screen when application is active, delay otherwise.
+ if (SDL_GetAppState() & SDL_APPACTIVE)
+ {
+ // Draw a frame if either frames are not limited or enough time has
+ // passed since the last frame.
+ if (!mMinFrameTime ||
+ get_elapsed_time(mDrawTime / 10) > mMinFrameTime)
+ {
+ frame++;
+ gui->draw();
+ graphics->updateScreen();
+ mDrawTime += mMinFrameTime;
+
+ // Make sure to wrap mDrawTime, since tick_time will wrap.
+ if (mDrawTime > MAX_TIME * 10)
+ mDrawTime -= MAX_TIME * 10;
+ }
+ else
+ {
+ SDL_Delay(10);
+ }
+ }
+ else
+ {
+ SDL_Delay(10);
+ mDrawTime = tick_time * 10;
+ }
+
+ // Handle network stuff
+ mNetwork->flush();
+ mNetwork->dispatchMessages();
+
+ if (!mNetwork->isConnected())
+ {
+ if (!disconnectedDialog)
+ {
+ disconnectedDialog = new
+ OkDialog("Network Error",
+ "The connection to the server was lost, the "
+ "program will now quit");
+ disconnectedDialog->addActionListener(&exitListener);
+ disconnectedDialog->requestMoveToTop();
+ }
+ }
}
}
@@ -440,289 +440,296 @@ void Game::handleInput()
{
if (joystick != NULL)
{
- joystick->update();
+ joystick->update();
}
// Events
SDL_Event event;
while (SDL_PollEvent(&event))
{
- bool used = false;
-
- // Keyboard events (for discontinuous keys)
- if (event.type == SDL_KEYDOWN)
- {
- gcn::Window *requestedWindow = NULL;
-
- if (setupWindow->isVisible() &&
- keyboard.getNewKeyIndex() > keyboard.KEY_NO_VALUE)
- {
- keyboard.setNewKey((int) event.key.keysym.sym);
- keyboard.callbackNewKey();
- keyboard.setNewKeyIndex(keyboard.KEY_NO_VALUE);
- return;
- }
- // Keys pressed together with Alt/Meta
- // Emotions and some internal gui windows
- #ifndef __APPLE__
- if (event.key.keysym.mod & KMOD_ALT)
- #else
- if (event.key.keysym.mod & KMOD_LMETA)
- #endif
- {
- switch (event.key.keysym.sym)
- {
- case SDLK_p:
- // Screenshot (picture, hence the p)
- {
- SDL_Surface *screenshot = graphics->getScreenshot();
- if (!saveScreenshot(screenshot))
- {
- logger->log("Error: could not save Screenshot.");
- }
- SDL_FreeSurface(screenshot);
- }
- used = true;
- break;
-
- default:
- break;
-
- case SDLK_f:
- // Find path to mouse (debug purpose)
- viewport->toggleDebugPath();
- used = true;
- break;
-
- case SDLK_t:
- // Toggle accepting of incoming trade requests
- {
- unsigned int deflt = player_relations.getDefault();
- if (deflt & PlayerRelation::TRADE) {
- chatWindow->chatLog("Ignoring incoming trade requests", BY_SERVER);
- deflt &= ~PlayerRelation::TRADE;
- } else {
- chatWindow->chatLog("Accepting incoming trade requests", BY_SERVER);
- deflt |= PlayerRelation::TRADE;
- }
-
- player_relations.setDefault(deflt);
- }
- used = true;
- break;
- }
-
- // Emotions
- Uint8 emotion;
- switch (event.key.keysym.sym)
- {
- case SDLK_1: emotion = 1; break;
- case SDLK_2: emotion = 2; break;
- case SDLK_3: emotion = 3; break;
- case SDLK_4: emotion = 4; break;
- case SDLK_5: emotion = 5; break;
- case SDLK_6: emotion = 6; break;
- case SDLK_7: emotion = 7; break;
- case SDLK_8: emotion = 8; break;
- case SDLK_9: emotion = 9; break;
- case SDLK_0: emotion = 10; break;
- case SDLK_MINUS: emotion = 11; break;
- case SDLK_EQUALS: emotion = 12; break;
- default: emotion = 0; break;
- }
-
- if (emotion)
- {
- player_node->emote(emotion);
- used = true;
- }
- }
- switch (event.key.keysym.sym)
- {
- case SDLK_PAGEUP:
- if (chatWindow->isVisible())
- {
- chatWindow->scroll(-DEFAULT_CHAT_WINDOW_SCROLL);
- used = true;
- }
- break;
-
- case SDLK_PAGEDOWN:
- if (chatWindow->isVisible())
- {
- chatWindow->scroll(DEFAULT_CHAT_WINDOW_SCROLL);
- used = true;
- }
- break;
-
- case SDLK_F1:
- // In-game Help
- if (helpWindow->isVisible())
- {
- helpWindow->setVisible(false);
- }
- else
- {
- helpWindow->loadHelp("index");
- helpWindow->requestMoveToTop();
- }
- used = true;
- break;
-
- case SDLK_F2: requestedWindow = statusWindow; break;
- case SDLK_F3: requestedWindow = inventoryWindow; break;
- case SDLK_F4: requestedWindow = equipmentWindow; break;
- case SDLK_F5: requestedWindow = skillDialog; break;
- case SDLK_F6: requestedWindow = minimap; break;
- case SDLK_F7: requestedWindow = chatWindow; break;
- case SDLK_F8: requestedWindow = itemShortcutWindow; break;
- case SDLK_F9: requestedWindow = setupWindow; break;
- case SDLK_F10: requestedWindow = debugWindow; break;
- //case SDLK_F11: requestedWindow = newSkillWindow; break;
-
- case SDLK_RETURN:
- // Input chat window
- if (chatWindow->isInputFocused() ||
- deathNotice != NULL ||
- weightNotice != NULL)
- {
- break;
- }
-
- // Quit by pressing Enter if the exit confirm is there
- if (exitConfirm)
- {
- done = true;
- }
- // Close the Browser if opened
- else if (helpWindow->isVisible())
- {
- helpWindow->setVisible(false);
- }
- // Close the config window, cancelling changes if opened
- else if (setupWindow->isVisible())
- {
- setupWindow->action(gcn::ActionEvent(NULL, "cancel"));
- }
- // Else, open the chat edit box
- else
- {
- chatWindow->requestChatFocus();
- used = true;
- }
- break;
- // Quitting confirmation dialog
- case SDLK_ESCAPE:
- if (!exitConfirm) {
- exitConfirm = new ConfirmDialog(
- "Quit", "Are you sure you want to quit?");
- exitConfirm->addActionListener(&exitListener);
- exitConfirm->requestMoveToTop();
- }
- else
- {
- exitConfirm->action(gcn::ActionEvent(NULL, "no"));
- }
- break;
-
- default:
- break;
- }
- if (keyboard.isEnabled() && !chatWindow->isInputFocused())
- {
- const int tKey = keyboard.getKeyIndex(event.key.keysym.sym);
- // Checks if any item shortcut is pressed.
- for (int i = KeyboardConfig::KEY_SHORTCUT_0;
- i <= KeyboardConfig::KEY_SHORTCUT_9;
- i++)
- {
- if (tKey == i && !used) {
- itemShortcut->useItem(
- i - KeyboardConfig::KEY_SHORTCUT_0);
- break;
- }
- }
- switch (tKey) {
- case KeyboardConfig::KEY_PICKUP:
- {
- FloorItem *item = floorItemManager->findByCoordinates(
- player_node->mX, player_node->mY);
-
- // If none below the player, try the tile in front of
- // the player
- if (!item) {
- Uint16 x = player_node->mX;
- Uint16 y = player_node->mY;
- if (player_node->getDirection() & Being::UP)
- y--;
- if (player_node->getDirection() & Being::DOWN)
- y++;
- if (player_node->getDirection() & Being::LEFT)
- x--;
- if (player_node->getDirection() & Being::RIGHT)
- x++;
-
- item = floorItemManager->findByCoordinates(x, y);
- }
-
- if (item)
- player_node->pickUp(item);
-
- used = true;
- }
- break;
- case KeyboardConfig::KEY_SIT:
- // Player sit action
- player_node->toggleSit();
- used = true;
- break;
- case KeyboardConfig::KEY_HIDE_WINDOWS:
- // Hide certain windows
- if (!chatWindow->isInputFocused())
- {
- statusWindow->setVisible(false);
- inventoryWindow->setVisible(false);
- skillDialog->setVisible(false);
- setupWindow->setVisible(false);
- equipmentWindow->setVisible(false);
- helpWindow->setVisible(false);
- debugWindow->setVisible(false);
- }
- break;
- }
- }
-
- if (requestedWindow)
- {
- requestedWindow->setVisible(!requestedWindow->isVisible());
- if (requestedWindow->isVisible())
- {
- requestedWindow->requestMoveToTop();
- }
- used = true;
- }
-
- }
-
- // Quit event
- else if (event.type == SDL_QUIT)
- {
- done = true;
- }
-
- // Push input to GUI when not used
- if (!used)
- {
- try
- {
- guiInput->pushInput(event);
- }
- catch (gcn::Exception e)
- {
- const char* err = e.getMessage().c_str();
- logger->log("Warning: guichan input exception: %s", err);
- }
- }
+ bool used = false;
+
+ // Keyboard events (for discontinuous keys)
+ if (event.type == SDL_KEYDOWN)
+ {
+ gcn::Window *requestedWindow = NULL;
+
+ if (setupWindow->isVisible() &&
+ keyboard.getNewKeyIndex() > keyboard.KEY_NO_VALUE)
+ {
+ keyboard.setNewKey((int) event.key.keysym.sym);
+ keyboard.callbackNewKey();
+ keyboard.setNewKeyIndex(keyboard.KEY_NO_VALUE);
+ return;
+ }
+ // Keys pressed together with Alt/Meta
+ // Emotions and some internal gui windows
+ #ifndef __APPLE__
+ if (event.key.keysym.mod & KMOD_ALT)
+ #else
+ if (event.key.keysym.mod & KMOD_LMETA)
+ #endif
+ {
+ switch (event.key.keysym.sym)
+ {
+ case SDLK_p:
+ // Screenshot (picture, hence the p)
+ {
+ SDL_Surface *screenshot =
+ graphics->getScreenshot();
+ if (!saveScreenshot(screenshot))
+ {
+ logger->
+ log("Error: could not save Screenshot.");
+ }
+ SDL_FreeSurface(screenshot);
+ }
+ used = true;
+ break;
+
+ default:
+ break;
+
+ case SDLK_f:
+ // Find path to mouse (debug purpose)
+ viewport->toggleDebugPath();
+ used = true;
+ break;
+
+ case SDLK_t:
+ // Toggle accepting of incoming trade requests
+ {
+ unsigned int deflt = player_relations.getDefault();
+ if (deflt & PlayerRelation::TRADE) {
+ chatWindow->
+ chatLog("Ignoring incoming trade requests",
+ BY_SERVER);
+ deflt &= ~PlayerRelation::TRADE;
+ } else {
+ chatWindow->chatLog("Accepting incoming trade "
+ "requests", BY_SERVER);
+ deflt |= PlayerRelation::TRADE;
+ }
+
+ player_relations.setDefault(deflt);
+ }
+ used = true;
+ break;
+ }
+
+ // Emotions
+ Uint8 emotion;
+ switch (event.key.keysym.sym)
+ {
+ case SDLK_1: emotion = 1; break;
+ case SDLK_2: emotion = 2; break;
+ case SDLK_3: emotion = 3; break;
+ case SDLK_4: emotion = 4; break;
+ case SDLK_5: emotion = 5; break;
+ case SDLK_6: emotion = 6; break;
+ case SDLK_7: emotion = 7; break;
+ case SDLK_8: emotion = 8; break;
+ case SDLK_9: emotion = 9; break;
+ case SDLK_0: emotion = 10; break;
+ case SDLK_MINUS: emotion = 11; break;
+ case SDLK_EQUALS: emotion = 12; break;
+ default: emotion = 0; break;
+ }
+
+ if (emotion)
+ {
+ player_node->emote(emotion);
+ used = true;
+ }
+ }
+ switch (event.key.keysym.sym)
+ {
+ case SDLK_PAGEUP:
+ if (chatWindow->isVisible())
+ {
+ chatWindow->scroll(-DEFAULT_CHAT_WINDOW_SCROLL);
+ used = true;
+ }
+ break;
+
+ case SDLK_PAGEDOWN:
+ if (chatWindow->isVisible())
+ {
+ chatWindow->scroll(DEFAULT_CHAT_WINDOW_SCROLL);
+ used = true;
+ }
+ break;
+
+ case SDLK_F1:
+ // In-game Help
+ if (helpWindow->isVisible())
+ {
+ helpWindow->setVisible(false);
+ }
+ else
+ {
+ helpWindow->loadHelp("index");
+ helpWindow->requestMoveToTop();
+ }
+ used = true;
+ break;
+
+ case SDLK_F2: requestedWindow = statusWindow; break;
+ case SDLK_F3: requestedWindow = inventoryWindow; break;
+ case SDLK_F4: requestedWindow = equipmentWindow; break;
+ case SDLK_F5: requestedWindow = skillDialog; break;
+ case SDLK_F6: requestedWindow = minimap; break;
+ case SDLK_F7: requestedWindow = chatWindow; break;
+ case SDLK_F8: requestedWindow = itemShortcutWindow; break;
+ case SDLK_F9: requestedWindow = setupWindow; break;
+ case SDLK_F10: requestedWindow = debugWindow; break;
+ //case SDLK_F11: requestedWindow = newSkillWindow; break;
+
+ case SDLK_RETURN:
+ // Input chat window
+ if (chatWindow->isInputFocused() ||
+ deathNotice != NULL ||
+ weightNotice != NULL)
+ {
+ break;
+ }
+
+ // Quit by pressing Enter if the exit confirm is there
+ if (exitConfirm)
+ {
+ done = true;
+ }
+ // Close the Browser if opened
+ else if (helpWindow->isVisible())
+ {
+ helpWindow->setVisible(false);
+ }
+ // Close the config window, cancelling changes if opened
+ else if (setupWindow->isVisible())
+ {
+ setupWindow->action(gcn::ActionEvent(NULL, "cancel"));
+ }
+ // Else, open the chat edit box
+ else
+ {
+ chatWindow->requestChatFocus();
+ used = true;
+ }
+ break;
+ // Quitting confirmation dialog
+ case SDLK_ESCAPE:
+ if (!exitConfirm) {
+ exitConfirm = new ConfirmDialog(
+ "Quit", "Are you sure you want to quit?");
+ exitConfirm->addActionListener(&exitListener);
+ exitConfirm->requestMoveToTop();
+ }
+ else
+ {
+ exitConfirm->action(gcn::ActionEvent(NULL, "no"));
+ }
+ break;
+
+ default:
+ break;
+ }
+ if (keyboard.isEnabled() && !chatWindow->isInputFocused())
+ {
+ const int tKey = keyboard.getKeyIndex(event.key.keysym.sym);
+ // Checks if any item shortcut is pressed.
+ for (int i = KeyboardConfig::KEY_SHORTCUT_0;
+ i <= KeyboardConfig::KEY_SHORTCUT_9;
+ i++)
+ {
+ if (tKey == i && !used) {
+ itemShortcut->useItem(
+ i - KeyboardConfig::KEY_SHORTCUT_0);
+ break;
+ }
+ }
+ switch (tKey) {
+ case KeyboardConfig::KEY_PICKUP:
+ {
+ FloorItem *item =
+ floorItemManager->findByCoordinates(
+ player_node->mX, player_node->mY);
+
+ // If none below the player, try the tile in front
+ // of the player
+ if (!item) {
+ Uint16 x = player_node->mX;
+ Uint16 y = player_node->mY;
+ if (player_node->getDirection() & Being::UP)
+ y--;
+ if (player_node->getDirection() & Being::DOWN)
+ y++;
+ if (player_node->getDirection() & Being::LEFT)
+ x--;
+ if (player_node->getDirection() & Being::RIGHT)
+ x++;
+
+ item = floorItemManager->
+ findByCoordinates(x, y);
+ }
+
+ if (item)
+ player_node->pickUp(item);
+
+ used = true;
+ }
+ break;
+ case KeyboardConfig::KEY_SIT:
+ // Player sit action
+ player_node->toggleSit();
+ used = true;
+ break;
+ case KeyboardConfig::KEY_HIDE_WINDOWS:
+ // Hide certain windows
+ if (!chatWindow->isInputFocused())
+ {
+ statusWindow->setVisible(false);
+ inventoryWindow->setVisible(false);
+ skillDialog->setVisible(false);
+ setupWindow->setVisible(false);
+ equipmentWindow->setVisible(false);
+ helpWindow->setVisible(false);
+ debugWindow->setVisible(false);
+ }
+ break;
+ }
+ }
+
+ if (requestedWindow)
+ {
+ requestedWindow->setVisible(!requestedWindow->isVisible());
+ if (requestedWindow->isVisible())
+ {
+ requestedWindow->requestMoveToTop();
+ }
+ used = true;
+ }
+
+ }
+
+ // Quit event
+ else if (event.type == SDL_QUIT)
+ {
+ done = true;
+ }
+
+ // Push input to GUI when not used
+ if (!used)
+ {
+ try
+ {
+ guiInput->pushInput(event);
+ }
+ catch (gcn::Exception e)
+ {
+ const char* err = e.getMessage().c_str();
+ logger->log("Warning: guichan input exception: %s", err);
+ }
+ }
} // End while
// If the user is configuring the keys then don't respond.
@@ -732,111 +739,112 @@ void Game::handleInput()
}
// Moving player around
if (player_node->mAction != Being::DEAD &&
- current_npc == 0 &&
- !chatWindow->isInputFocused())
+ current_npc == 0 &&
+ !chatWindow->isInputFocused())
{
- // Get the state of the keyboard keys
- keyboard.refreshActiveKeys();
-
- const Uint16 x = player_node->mX;
- const Uint16 y = player_node->mY;
- unsigned char direction = 0;
-
- // Translate pressed keys to movement and direction
- if (keyboard.isKeyActive(keyboard.KEY_MOVE_UP) ||
- (joystick && joystick->isUp()))
- {
- direction |= Being::UP;
- }
- else if (keyboard.isKeyActive(keyboard.KEY_MOVE_DOWN) ||
- (joystick && joystick->isDown()))
- {
- direction |= Being::DOWN;
- }
-
- if (keyboard.isKeyActive(keyboard.KEY_MOVE_LEFT) ||
- (joystick && joystick->isLeft()))
- {
- direction |= Being::LEFT;
- }
- else if (keyboard.isKeyActive(keyboard.KEY_MOVE_RIGHT) ||
- (joystick && joystick->isRight()))
- {
- direction |= Being::RIGHT;
- }
-
- player_node->setWalkingDir(direction);
-
- // Attacking monsters
- if (keyboard.isKeyActive(keyboard.KEY_ATTACK) ||
- (joystick && joystick->buttonPressed(0)))
- {
- Being *target = NULL;
- bool newTarget = keyboard.isKeyActive(keyboard.KEY_TARGET);
- // A set target has highest priority
- if (newTarget || !player_node->getTarget())
- {
- Uint16 targetX = x, targetY = y;
-
- if (player_node->getDirection() & Being::UP)
- targetY--;
- if (player_node->getDirection() & Being::DOWN)
- targetY++;
- if (player_node->getDirection() & Being::LEFT)
- targetX--;
- if (player_node->getDirection() & Being::RIGHT)
- targetX++;
-
- // Attack priorioty is: Monster, Player, auto target
- target = beingManager->findBeing(
- targetX, targetY, Being::MONSTER);
- if (!target)
- target = beingManager->findBeing(
- targetX, targetY, Being::PLAYER);
- }
-
- player_node->attack(target, newTarget);
- }
-
- // Target the nearest player if 'q' is pressed
- if ( keyboard.isKeyActive(keyboard.KEY_TARGET_PLAYER) )
- //if (keys[SDLK_q])
- {
- Being *target =
- beingManager->findNearestLivingBeing(player_node, 20, Being::PLAYER);
-
- if (target)
- {
- player_node->setTarget(target);
- }
- }
-
- // Target the nearest monster if 'a' pressed
- if ( keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) )
- //if (keys[SDLK_a])
- {
- Being *target =
- beingManager->findNearestLivingBeing(x, y, 20, Being::MONSTER);
-
- if (target)
- {
- player_node->setTarget(target);
- }
- }
-
- if (joystick)
- {
- if (joystick->buttonPressed(1))
- {
- FloorItem *item = floorItemManager->findByCoordinates(x, y);
-
- if (item)
- player_node->pickUp(item);
- }
- else if (joystick->buttonPressed(2))
- {
- player_node->toggleSit();
- }
- }
+ // Get the state of the keyboard keys
+ keyboard.refreshActiveKeys();
+
+ const Uint16 x = player_node->mX;
+ const Uint16 y = player_node->mY;
+ unsigned char direction = 0;
+
+ // Translate pressed keys to movement and direction
+ if (keyboard.isKeyActive(keyboard.KEY_MOVE_UP) ||
+ (joystick && joystick->isUp()))
+ {
+ direction |= Being::UP;
+ }
+ else if (keyboard.isKeyActive(keyboard.KEY_MOVE_DOWN) ||
+ (joystick && joystick->isDown()))
+ {
+ direction |= Being::DOWN;
+ }
+
+ if (keyboard.isKeyActive(keyboard.KEY_MOVE_LEFT) ||
+ (joystick && joystick->isLeft()))
+ {
+ direction |= Being::LEFT;
+ }
+ else if (keyboard.isKeyActive(keyboard.KEY_MOVE_RIGHT) ||
+ (joystick && joystick->isRight()))
+ {
+ direction |= Being::RIGHT;
+ }
+
+ player_node->setWalkingDir(direction);
+
+ // Attacking monsters
+ if (keyboard.isKeyActive(keyboard.KEY_ATTACK) ||
+ (joystick && joystick->buttonPressed(0)))
+ {
+ Being *target = NULL;
+ bool newTarget = keyboard.isKeyActive(keyboard.KEY_TARGET);
+ // A set target has highest priority
+ if (newTarget || !player_node->getTarget())
+ {
+ Uint16 targetX = x, targetY = y;
+
+ if (player_node->getDirection() & Being::UP)
+ targetY--;
+ if (player_node->getDirection() & Being::DOWN)
+ targetY++;
+ if (player_node->getDirection() & Being::LEFT)
+ targetX--;
+ if (player_node->getDirection() & Being::RIGHT)
+ targetX++;
+
+ // Attack priorioty is: Monster, Player, auto target
+ target = beingManager->findBeing(
+ targetX, targetY, Being::MONSTER);
+ if (!target)
+ target = beingManager->findBeing(
+ targetX, targetY, Being::PLAYER);
+ }
+
+ player_node->attack(target, newTarget);
+ }
+
+ // Target the nearest player if 'q' is pressed
+ if ( keyboard.isKeyActive(keyboard.KEY_TARGET_PLAYER) )
+ //if (keys[SDLK_q])
+ {
+ Being *target =
+ beingManager->
+ findNearestLivingBeing(player_node, 20, Being::PLAYER);
+
+ if (target)
+ {
+ player_node->setTarget(target);
+ }
+ }
+
+ // Target the nearest monster if 'a' pressed
+ if ( keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) )
+ //if (keys[SDLK_a])
+ {
+ Being *target =
+ beingManager->findNearestLivingBeing(x, y, 20, Being::MONSTER);
+
+ if (target)
+ {
+ player_node->setTarget(target);
+ }
+ }
+
+ if (joystick)
+ {
+ if (joystick->buttonPressed(1))
+ {
+ FloorItem *item = floorItemManager->findByCoordinates(x, y);
+
+ if (item)
+ player_node->pickUp(item);
+ }
+ else if (joystick->buttonPressed(2))
+ {
+ player_node->toggleSit();
+ }
+ }
}
}
diff --git a/src/game.h b/src/game.h
index 5b73832e..583aea70 100644
--- a/src/game.h
+++ b/src/game.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: game.h 3859 2008-01-26 19:38:43Z b_lindeijer $
*/
#ifndef _TMW_GAME_
@@ -42,35 +42,35 @@ extern volatile int tick_time;
class Game : public ConfigListener
{
public:
- Game(Network *network);
- ~Game();
+ Game(Network *network);
+ ~Game();
- void logic();
+ void logic();
- void handleInput();
+ void handleInput();
- void optionChanged(const std::string &name);
+ void optionChanged(const std::string &name);
private:
- Network *mNetwork;
-
- /** Used to determine whether to draw the next frame. */
- int mDrawTime;
-
- /** The minimum frame time (used for frame limiting). */
- int mMinFrameTime;
-
- typedef const std::auto_ptr<MessageHandler> MessageHandlerPtr;
- MessageHandlerPtr mBeingHandler;
- MessageHandlerPtr mBuySellHandler;
- MessageHandlerPtr mChatHandler;
- MessageHandlerPtr mEquipmentHandler;
- MessageHandlerPtr mInventoryHandler;
- MessageHandlerPtr mItemHandler;
- MessageHandlerPtr mNpcHandler;
- MessageHandlerPtr mPlayerHandler;
- MessageHandlerPtr mSkillHandler;
- MessageHandlerPtr mTradeHandler;
+ Network *mNetwork;
+
+ /** Used to determine whether to draw the next frame. */
+ int mDrawTime;
+
+ /** The minimum frame time (used for frame limiting). */
+ int mMinFrameTime;
+
+ typedef const std::auto_ptr<MessageHandler> MessageHandlerPtr;
+ MessageHandlerPtr mBeingHandler;
+ MessageHandlerPtr mBuySellHandler;
+ MessageHandlerPtr mChatHandler;
+ MessageHandlerPtr mEquipmentHandler;
+ MessageHandlerPtr mInventoryHandler;
+ MessageHandlerPtr mItemHandler;
+ MessageHandlerPtr mNpcHandler;
+ MessageHandlerPtr mPlayerHandler;
+ MessageHandlerPtr mSkillHandler;
+ MessageHandlerPtr mTradeHandler;
};
/**
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 586f9f49..0433678f 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: graphics.cpp 3628 2007-10-18 18:39:48Z b_lindeijer $
*/
#include <cassert>
diff --git a/src/graphics.h b/src/graphics.h
index 564826a2..0cf58141 100644
--- a/src/graphics.h
+++ b/src/graphics.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: graphics.h 3628 2007-10-18 18:39:48Z b_lindeijer $
*/
#ifndef _GRAPHICS_H
diff --git a/src/gui/box.cpp b/src/gui/box.cpp
index 6af3ae3e..f53bc18e 100644
--- a/src/gui/box.cpp
+++ b/src/gui/box.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: box.cpp 1456 2005-07-15 23:17:00Z b_lindeijer $
*/
#include "box.h"
diff --git a/src/gui/box.h b/src/gui/box.h
index ed1a7163..280fd3e2 100644
--- a/src/gui/box.h
+++ b/src/gui/box.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: box.h 2529 2006-08-13 10:20:19Z b_lindeijer $
*/
diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp
index bc76335f..4f771a7e 100644
--- a/src/gui/browserbox.cpp
+++ b/src/gui/browserbox.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: browserbox.cpp 4348 2008-06-14 12:42:49Z the_enemy $
*/
#include <algorithm>
diff --git a/src/gui/browserbox.h b/src/gui/browserbox.h
index 9c0e8ef1..636fe5a0 100644
--- a/src/gui/browserbox.h
+++ b/src/gui/browserbox.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: browserbox.h 3687 2007-10-26 00:22:12Z crush_tmw $
*/
#ifndef __TMW_BROWSERBOX_H__
diff --git a/src/gui/buddywindow.cpp b/src/gui/buddywindow.cpp
deleted file mode 100644
index 0ed383ce..00000000
--- a/src/gui/buddywindow.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * The Mana World
- * Copyright 2004 The Mana World Development Team
- *
- * This file is part of The Mana World.
- *
- * 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.
- *
- * 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.
- *
- * 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
- *
- * $Id$
- */
-
-#include "buddywindow.h"
-
-#include <guichan/widgets/listbox.hpp>
-
-#include "button.h"
-#include "chat.h"
-#include "scrollarea.h"
-
-#include "../resources/buddylist.h"
-
-extern ChatWindow *chatWindow;
-
-BuddyWindow::BuddyWindow():
- Window("Buddy")
-{
- setContentSize(124, 202);
-
- mBuddyList = new BuddyList();
-
- mListbox = new gcn::ListBox();
- mListbox->setListModel(mBuddyList);
-
- ScrollArea *scrollArea = new ScrollArea(mListbox);
- scrollArea->setDimension(gcn::Rectangle(
- 7, 5, 110, 170));
- add(scrollArea);
-
- Button *talk = new Button("Talk", "Talk", this);
- Button *remove = new Button("Remove", "Remove", this);
- Button *cancel = new Button("Cancel", "Cancel", this);
-
- talk->setPosition(2,180);
- remove->setPosition(talk->getWidth()+2,180);
- cancel->setPosition(talk->getWidth()+remove->getWidth()+2,180);
-
- add(talk);
- add(remove);
- add(cancel);
-}
-
-void BuddyWindow::action(const gcn::ActionEvent &event)
-{
- if (event.getId() == "Talk") {
- int selected = mListbox->getSelected();
- if ( selected > -1 )
- {
- std::string who = mBuddyList->getElementAt(selected);
- chatWindow->setInputText(who +": ");
- }
- }
- else if (event.getId() == "Remove") {
- int selected = mListbox->getSelected();
- if ( selected > -1 )
- {
- std::string who = mBuddyList->getElementAt(selected);
- mBuddyList->removeBuddy(who);
- }
- }
- else if (event.getId() == "Cancel") {
- setVisible(false);
- }
-}
diff --git a/src/gui/button.cpp b/src/gui/button.cpp
index c6bc4ccb..1243d798 100644
--- a/src/gui/button.cpp
+++ b/src/gui/button.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: button.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/gui/button.h b/src/gui/button.h
index d12173b2..8e045a74 100644
--- a/src/gui/button.h
+++ b/src/gui/button.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: button.h 3606 2007-09-27 14:54:09Z b_lindeijer $
*/
#ifndef _TMW_BUTTON_H
diff --git a/src/gui/buttonbox.cpp b/src/gui/buttonbox.cpp
new file mode 100644
index 00000000..592cb92a
--- /dev/null
+++ b/src/gui/buttonbox.cpp
@@ -0,0 +1,47 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ * $Id: buttonbox.cpp
+ */
+
+#include "buttonbox.h"
+
+#include "button.h"
+
+ButtonBox::ButtonBox(const std::string &title, const std::string &buttonTxt,
+ ButtonBoxListener *listener) :
+ Window(title),
+ mListener(listener)
+{
+ Button *button = new Button(buttonTxt, "activate", this);
+ setContentSize(button->getWidth() + 10,
+ button->getHeight() + 10);
+ button->setPosition(5, 5);
+ add(button);
+}
+
+void
+ButtonBox::action(const gcn::ActionEvent &event)
+{
+ if (event.getId() == "activate")
+ {
+ mListener->buttonBoxRespond();
+ }
+}
diff --git a/src/gui/buttonbox.h b/src/gui/buttonbox.h
new file mode 100644
index 00000000..1b76e619
--- /dev/null
+++ b/src/gui/buttonbox.h
@@ -0,0 +1,70 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ * $Id: buttonbox.h
+ */
+
+#ifndef _TMW_BUTTONBOX_H
+#define _TMW_BUTTONBOX_H
+
+#include <string>
+
+#include <guichan/actionlistener.hpp>
+
+#include "window.h"
+
+class ButtonBoxListener
+{
+ public:
+
+ /*
+ * function that ButtonBox calls when the button has been pressed
+ */
+ virtual void buttonBoxRespond() = 0;
+};
+
+class ButtonBox : public Window, public gcn::ActionListener
+{
+ public:
+
+ /*
+ * Constructor
+ *
+ * @param title is the text that appears at the top of the box
+ * @param buttonTxt is the text that appears on the button
+ * @param listener points to the class that should respond to the
+ * button press
+ */
+ ButtonBox(const std::string &title, const std::string &buttonTxt,
+ ButtonBoxListener *listener);
+
+ /*
+ * called when the button is pressed
+ *
+ * @param event is the event that is generated
+ */
+ void
+ action(const gcn::ActionEvent &event);
+
+ private:
+
+ ButtonBoxListener *mListener;
+};
+#endif
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp
index 259fcfd9..24acf2d1 100644
--- a/src/gui/buy.cpp
+++ b/src/gui/buy.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: buy.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "buy.h"
diff --git a/src/gui/buy.h b/src/gui/buy.h
index 3a9ea3c5..6f75cab5 100644
--- a/src/gui/buy.h
+++ b/src/gui/buy.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: buy.h 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#ifndef _TMW_BUY_H
diff --git a/src/gui/buysell.cpp b/src/gui/buysell.cpp
index ae5c7358..9cc3b297 100644
--- a/src/gui/buysell.cpp
+++ b/src/gui/buysell.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: buysell.cpp 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#include "buysell.h"
diff --git a/src/gui/buysell.h b/src/gui/buysell.h
index 97caf34b..64c37e39 100644
--- a/src/gui/buysell.h
+++ b/src/gui/buysell.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: buysell.h 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#ifndef _TMW_BUYSELL_H
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index 8ab3b879..c4b1d89e 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: char_select.cpp 3760 2007-11-21 19:43:11Z b_lindeijer $
*/
#include "char_select.h"
diff --git a/src/gui/char_select.h b/src/gui/char_select.h
index 283ecf42..182600d1 100644
--- a/src/gui/char_select.h
+++ b/src/gui/char_select.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: char_select.h 3752 2007-11-20 10:50:00Z b_lindeijer $
*/
#ifndef _CHAR_SELECT_H
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index 638c05a6..3465fb69 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: char_server.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include "char_server.h"
@@ -105,10 +105,11 @@ ServerSelectDialog::action(const gcn::ActionEvent &event)
const SERVER_INFO *si = server_info[mServerList->getSelected()];
mLoginData->hostname = iptostring(si->address);
mLoginData->port = si->port;
- state = CHAR_CONNECT_STATE;
+ mLoginData->updateHost = si->updateHost;
+ state = UPDATE_STATE;
}
else if (event.getId() == "cancel") {
- state = LOADDATA_STATE;
+ state = LOGIN_STATE;
}
}
diff --git a/src/gui/char_server.h b/src/gui/char_server.h
index 26e723f9..32a0645f 100644
--- a/src/gui/char_server.h
+++ b/src/gui/char_server.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: char_server.h 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#ifndef _CHAR_SEL_SERVER_H
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 5e3aaf60..7b69ec1c 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -18,12 +18,11 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: chat.cpp 4227 2008-05-08 00:39:29Z peaveydk $
*/
#include <algorithm>
-#include <sstream>
-
+#include <fstream>
#include <guichan/focushandler.hpp>
#include <guichan/key.hpp>
@@ -37,6 +36,9 @@
#include "../configuration.h"
#include "../game.h"
#include "../localplayer.h"
+#include "../beingmanager.h"
+#include "../recorder.h"
+#include "../party.h"
#include "../net/messageout.h"
#include "../net/protocol.h"
@@ -64,9 +66,9 @@ ChatWindow::ChatWindow(Network *network):
mTextOutput->setMaxRow((int) config.getValue("ChatLogLength", 0));
mScrollArea = new ScrollArea(mTextOutput);
mScrollArea->setPosition(
- mScrollArea->getFrameSize(), mScrollArea->getFrameSize());
+ mScrollArea->getFrameSize(), mScrollArea->getFrameSize());
mScrollArea->setScrollPolicy(
- gcn::ScrollArea::SHOW_NEVER, gcn::ScrollArea::SHOW_ALWAYS);
+ gcn::ScrollArea::SHOW_NEVER, gcn::ScrollArea::SHOW_ALWAYS);
mScrollArea->setOpaque(false);
add(mScrollArea);
@@ -75,6 +77,22 @@ ChatWindow::ChatWindow(Network *network):
// Add key listener to chat input to be able to respond to up/down
mChatInput->addKeyListener(this);
mCurHist = mHistory.end();
+
+ // Read the party prefix
+ std::string partyPrefix = config.getValue("PartyPrefix", "$");
+ mPartyPrefix = (partyPrefix == "" ? '$' : partyPrefix.at(0));
+ mReturnToggles = config.getValue("ReturnToggles", "0") == "1";
+ mRecorder = new Recorder(this);
+ mParty = new Party(this, mNetwork);
+}
+
+ChatWindow::~ChatWindow()
+{
+ char partyPrefix[2] = ".";
+ *partyPrefix = mPartyPrefix;
+ config.setValue("PartyPrefix", partyPrefix);
+ config.setValue("ReturnToggles", mReturnToggles ? "1" : "0");
+ delete mRecorder;
}
void
@@ -85,17 +103,17 @@ ChatWindow::logic()
const gcn::Rectangle area = getChildrenArea();
mChatInput->setPosition(mChatInput->getFrameSize(),
- area.height - mChatInput->getHeight() -
- mChatInput->getFrameSize());
+ area.height - mChatInput->getHeight() -
+ mChatInput->getFrameSize());
mChatInput->setWidth(area.width - 2 * mChatInput->getFrameSize());
mScrollArea->setWidth(area.width - 2 * mScrollArea->getFrameSize());
mScrollArea->setHeight(area.height - 2 * mScrollArea->getFrameSize() -
- mChatInput->getHeight() - 5);
+ mChatInput->getHeight() - 5);
mScrollArea->logic();
}
void
-ChatWindow::chatLog(std::string line, int own)
+ChatWindow::chatLog(std::string line, int own, bool ignoreRecord)
{
// Trim whitespace
trim(line);
@@ -108,47 +126,51 @@ ChatWindow::chatLog(std::string line, int own)
// Fix the owner of welcome message.
if (line.substr(0, 7) == "Welcome")
{
- own = BY_SERVER;
+ own = BY_SERVER;
}
std::string::size_type pos = line.find(" : ");
if (pos != std::string::npos) {
- tmp.nick = line.substr(0, pos);
- tmp.text = line.substr(pos + 3);
+ tmp.nick = line.substr(0, pos);
+ tmp.text = line.substr(pos + 3);
}
std::string lineColor = "##0"; // Equiv. to BrowserBox::BLACK
switch (own) {
- case BY_GM:
- tmp.nick += std::string("Global announcement: ");
- lineColor = "##1"; // Equiv. to BrowserBox::RED
- break;
- case BY_PLAYER:
- tmp.nick += CAT_NORMAL;
- lineColor = "##2"; // Equiv. to BrowserBox::GREEN
- break;
- case BY_OTHER:
- tmp.nick += CAT_NORMAL;
- lineColor = "##0"; // Equiv. to BrowserBox::BLACK
- break;
- case BY_SERVER:
- tmp.nick = "Server: ";
- tmp.text = line;
- lineColor = "##7"; // Equiv. to BrowserBox::PINK
- break;
- case ACT_WHISPER:
- tmp.nick += CAT_WHISPER;
- lineColor = "##3"; // Equiv. to BrowserBox::BLUE
- break;
- case ACT_IS:
- tmp.nick += CAT_IS;
- lineColor = "##5"; // Equiv. to BrowserBox::YELLOW
- break;
- case BY_LOGGER:
- tmp.nick = "";
- tmp.text = line;
- lineColor = "##8"; // Equiv. to BrowserBox::GREY
- break;
+ case BY_GM:
+ tmp.nick += std::string("Global announcement: ");
+ lineColor = "##1"; // Equiv. to BrowserBox::RED
+ break;
+ case BY_PLAYER:
+ tmp.nick += CAT_NORMAL;
+ lineColor = "##2"; // Equiv. to BrowserBox::GREEN
+ break;
+ case BY_OTHER:
+ tmp.nick += CAT_NORMAL;
+ lineColor = "##0"; // Equiv. to BrowserBox::BLACK
+ break;
+ case BY_SERVER:
+ tmp.nick = "Server: ";
+ tmp.text = line;
+ lineColor = "##7"; // Equiv. to BrowserBox::PURPLE
+ break;
+ case BY_PARTY:
+ tmp.nick += CAT_NORMAL;
+ lineColor = "##6"; // Equiv. to BrowserBox::PINK
+ break;
+ case ACT_WHISPER:
+ tmp.nick += CAT_WHISPER;
+ lineColor = "##3"; // Equiv. to BrowserBox::BLUE
+ break;
+ case ACT_IS:
+ tmp.nick += CAT_IS;
+ lineColor = "##5"; // Equiv. to BrowserBox::YELLOW
+ break;
+ case BY_LOGGER:
+ tmp.nick = "";
+ tmp.text = line;
+ lineColor = "##8"; // Equiv. to BrowserBox::GRAY
+ break;
}
// Get the current system time
@@ -158,12 +180,12 @@ ChatWindow::chatLog(std::string line, int own)
// Format the time string properly
std::stringstream timeStr;
timeStr << "["
- << ((((t / 60) / 60) % 24 < 10) ? "0" : "")
- << (int)(((t / 60) / 60) % 24)
- << ":"
- << (((t / 60) % 60 < 10) ? "0" : "")
- << (int)((t / 60) % 60)
- << "] ";
+ << ((((t / 60) / 60) % 24 < 10) ? "0" : "")
+ << (int)(((t / 60) / 60) % 24)
+ << ":"
+ << (((t / 60) % 60 < 10) ? "0" : "")
+ << (int)((t / 60) % 60)
+ << "] ";
line = lineColor + timeStr.str() + tmp.nick + tmp.text;
@@ -172,13 +194,15 @@ ChatWindow::chatLog(std::string line, int own)
// at comparison.
if (mScrollArea->getVerticalScrollAmount() == mScrollArea->getVerticalMaxScroll())
{
- mTextOutput->addRow(line);
- mScrollArea->setVerticalScrollAmount(mScrollArea->getVerticalMaxScroll());
+ mTextOutput->addRow(line);
+ mScrollArea->setVerticalScrollAmount(mScrollArea->getVerticalMaxScroll());
}
else
{
- mTextOutput->addRow(line);
+ mTextOutput->addRow(line);
}
+
+ mRecorder->record(line.substr(3));
}
void
@@ -192,32 +216,35 @@ ChatWindow::action(const gcn::ActionEvent &event)
{
if (event.getId() == "chatinput")
{
- std::string message = mChatInput->getText();
-
- if (!message.empty()) {
- // If message different from previous, put it in the history
- if (mHistory.empty() || message != mHistory.back()) {
- mHistory.push_back(message);
- }
-
- // Reset history iterator
- mCurHist = mHistory.end();
-
- // Send the message to the server
- chatSend(player_node->getName(), message);
-
- // Clear the text from the chat input
- mChatInput->setText("");
- }
-
- // Remove focus and hide input
- mFocusHandler->focusNone();
-
- // If the chatWindow is shown up because you want to send a message
- // It should hide now
- if (mTmpVisible) {
- setVisible(false);
- }
+ std::string message = mChatInput->getText();
+
+ if (!message.empty()) {
+ // If message different from previous, put it in the history
+ if (mHistory.empty() || message != mHistory.back()) {
+ mHistory.push_back(message);
+ }
+
+ // Reset history iterator
+ mCurHist = mHistory.end();
+
+ // Send the message to the server
+ chatSend(player_node->getName(), message);
+
+ // Clear the text from the chat input
+ mChatInput->setText("");
+ }
+ if (message.empty() || !mReturnToggles)
+ {
+ // Remove focus and hide input
+ mFocusHandler->focusNone();
+
+ // If the chatWindow is shown up because you want to send a message
+ // It should hide now
+ if (mTmpVisible)
+ {
+ setVisible(false);
+ }
+ }
}
}
@@ -227,14 +254,14 @@ ChatWindow::requestChatFocus()
// Make sure chatWindow is visible
if (!isVisible())
{
- setVisible(true);
-
- /*
- * This is used to hide chatWindow after sending the message. There is
- * a trick here, because setVisible will set mTmpVisible to false, you
- * have to put this sentence *after* setVisible, not before it
- */
- mTmpVisible = true;
+ setVisible(true);
+
+ /*
+ * This is used to hide chatWindow after sending the message. There is
+ * a trick here, because setVisible will set mTmpVisible to false, you
+ * have to put this sentence *after* setVisible, not before it
+ */
+ mTmpVisible = true;
}
// Give focus to the chat input
@@ -255,81 +282,224 @@ ChatWindow::chatSend(const std::string &nick, std::string msg)
* require server handling by proper packet. Probably
* those if elses should be replaced by protocol calls */
+ // Send party message
+ if (msg.at(0) == mPartyPrefix)
+ {
+ msg.erase(0, 1);
+ std::size_t length = msg.length() + 1;
+
+ if (length == 0)
+ {
+ chatLog("Trying to send a blank party message.", BY_SERVER);
+ return;
+ }
+ MessageOut outMsg(mNetwork);
+
+ outMsg.writeInt16(CMSG_PARTY_MESSAGE);
+ outMsg.writeInt16(length + 4);
+ outMsg.writeString(msg, length);
+ return;
+ }
// Prepare ordinary message
if (msg.substr(0, 1) != "/") {
- msg = nick + " : " + msg;
+ msg = nick + " : " + msg;
+
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(CMSG_CHAT_MESSAGE);
+ // Added + 1 in order to let eAthena parse admin commands correctly
+ outMsg.writeInt16(msg.length() + 4 + 1);
+ outMsg.writeString(msg, msg.length() + 1);
+ return;
+ }
+ msg.erase(0, 1);
+ trim(msg);
- MessageOut outMsg(mNetwork);
- outMsg.writeInt16(CMSG_CHAT_MESSAGE);
- // Added + 1 in order to let eAthena parse admin commands correctly
- outMsg.writeInt16(msg.length() + 4 + 1);
- outMsg.writeString(msg, msg.length() + 1);
+ std::size_t space = msg.find(" ");
+ std::string command = msg.substr(0, space);
+ if (space == std::string::npos)
+ {
+ msg = "";
}
- else if (msg.substr(0, IS_ANNOUNCE_LENGTH) == IS_ANNOUNCE)
+ else
{
- msg.erase(0, IS_ANNOUNCE_LENGTH);
- MessageOut outMsg(mNetwork);
- outMsg.writeInt16(0x0099);
- outMsg.writeInt16(msg.length() + 4);
- outMsg.writeString(msg, msg.length());
+ msg = msg.substr(space);
+ trim(msg);
}
- else if (msg.substr(0, IS_HELP_LENGTH) == IS_HELP)
+
+ if (command == "announce")
{
- chatLog("-- Help --", BY_SERVER);
- chatLog("/help: Display this help.", BY_SERVER);
- chatLog("/announce: Global announcement (GM only)", BY_SERVER);
- chatLog("/where: Display map name", BY_SERVER);
- chatLog("/who: Display number of online users", BY_SERVER);
- chatLog("/clear: Clears this window", BY_SERVER);
- chatLog("/whisper <nick> <message>: Sends a private <message> to <nick>", BY_SERVER);
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(0x0099);
+ outMsg.writeInt16(msg.length() + 4);
+ outMsg.writeString(msg, msg.length());
+ return;
}
- else if (msg.substr(0, IS_WHERE_LENGTH) == IS_WHERE)
+ if (command == "help")
{
- chatLog(map_path, BY_SERVER);
+ std::size_t space = msg.find(" ");
+ std::string msg1;
+ if (space == std::string::npos)
+ {
+ msg1 = "";
+ }
+ else
+ {
+ msg1 = msg.substr(space + 1, msg.length());
+ msg = msg.substr(0, space);
+ }
+ if (msg != "" && msg.at(0) == '/')
+ {
+ msg.erase(0, 1);
+ }
+ while (msg1 != "" && msg1.at(0) == ' ')
+ {
+ msg1.erase(0, 1);
+ }
+ help(msg, msg1);
+ return;
}
- else if (msg.substr(0, IS_WHO_LENGTH) == IS_WHO)
+ if (command == "where")
{
- MessageOut outMsg(mNetwork);
- outMsg.writeInt16(0x00c1);
+ chatLog(map_path, BY_SERVER);
+ return;
}
- else if (msg.substr(0, IS_CLEAR_LENGTH) == IS_CLEAR)
+ if (command == "who")
{
- mTextOutput->clearRows();
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(0x00c1);
+ return;
}
- else if (msg.substr(0, IS_WHISPER_LENGTH) == IS_WHISPER)
+ if (command == "clear")
{
- std::string recvnick = "";
- msg.erase(0, IS_WHISPER_LENGTH + 1);
-
- if (msg.substr(0,1) == "\"")
- {
- const std::string::size_type pos = msg.find('"', 1);
- if (pos != std::string::npos) {
- recvnick = msg.substr(1, pos - 1);
- msg.erase(0, pos + 2);
- }
- }
- else
- {
- const std::string::size_type pos = msg.find(" ");
- if (pos != std::string::npos) {
- recvnick = msg.substr(0, pos);
- msg.erase(0, pos + 1);
- }
- }
-
- MessageOut outMsg(mNetwork);
- outMsg.writeInt16(CMSG_CHAT_WHISPER);
- outMsg.writeInt16(msg.length() + 28);
- outMsg.writeString(recvnick, 24);
- outMsg.writeString(msg, msg.length());
-
- chatLog("Whispering to " + recvnick + " : " + msg, BY_PLAYER);
+ mTextOutput->clearRows();
+ return;
}
- else
+ if (command == "whisper")
+ {
+ std::string recvnick = "";
+
+ if (msg.substr(0,1) == "\"")
+ {
+ const std::string::size_type pos = msg.find('"', 1);
+ if (pos != std::string::npos) {
+ recvnick = msg.substr(1, pos - 1);
+ msg.erase(0, pos + 2);
+ }
+ }
+ else
+ {
+ const std::string::size_type pos = msg.find(" ");
+ if (pos != std::string::npos) {
+ recvnick = msg.substr(0, pos);
+ msg.erase(0, pos + 1);
+ }
+ }
+
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(CMSG_CHAT_WHISPER);
+ outMsg.writeInt16(msg.length() + 28);
+ outMsg.writeString(recvnick, 24);
+ outMsg.writeString(msg, msg.length());
+
+ chatLog("Whispering to " + recvnick + " : " + msg, BY_PLAYER);
+ return;
+ }
+ if (command == "record")
{
- chatLog("Unknown command", BY_SERVER);
+ mRecorder->respond(msg);
+ return;
}
+ if (command == "toggle")
+ {
+ if (msg == "")
+ {
+ chatLog(mReturnToggles ? "Return toggles chat."
+ : "Message closes chat.", BY_SERVER);
+ return;
+ }
+ msg = msg.substr(0, 1);
+ if (msg == "1" || msg == "y" || msg == "t" || msg == "Y" || msg == "T")
+ {
+ chatLog("Return now toggles chat.", BY_SERVER);
+ mReturnToggles = true;
+ return;
+ }
+ if (msg == "0" || msg == "n" || msg == "f" || msg == "N" || msg == "F")
+ {
+ chatLog("Message now closes chat.", BY_SERVER);
+ mReturnToggles = false;
+ return;
+ }
+ chatLog("Options to /toggle are \"yes\", \"no\", \"true\", \"false\", "
+ "\"1\", \"0\".", BY_SERVER);
+ return;
+ }
+ if (command == "party")
+ {
+ if (msg == "")
+ {
+ chatLog("Unknown party command... Type \"/help\" party for more "
+ "information.", BY_SERVER);
+ return;
+ }
+ const std::string::size_type space = msg.find(" ");
+ std::string rest = (space == std::string::npos ? ""
+ : msg.substr(space + 1, msg.length()));
+ if (rest != "")
+ {
+ msg = msg.substr(0, space);
+ while (msg != "" && msg[0] == ' ')
+ {
+ msg = msg.substr(1, msg.length());
+ }
+ }
+ party(msg, rest);
+ return;
+ }
+ if (command == "present")
+ {
+ Beings &beings = beingManager->getAll();
+ std::string response = "";
+ for (BeingIterator bi = beings.begin(), be = beings.end();
+ bi != be;
+ ++bi)
+ {
+ if ((*bi)->getType() == Being::PLAYER)
+ {
+ if (response != "")
+ {
+ response += ", ";
+ }
+ response += (*bi)->getName();
+ }
+ }
+ if (mRecorder->isRecording())
+ {
+ // Get the current system time
+ time_t t;
+ time(&t);
+
+ // Format the time string properly
+ std::stringstream timeStr;
+ timeStr << "["
+ << ((((t / 60) / 60) % 24 < 10) ? "0" : "")
+ << (int)(((t / 60) / 60) % 24)
+ << ":"
+ << (((t / 60) % 60 < 10) ? "0" : "")
+ << (int)((t / 60) % 60)
+ << "] ";
+
+
+ mRecorder->record(timeStr.str() + "Present: " + response + ".");
+ chatLog("Attendance written to record log.", BY_SERVER, true);
+ }
+ else
+ {
+ chatLog("Present: " + response, BY_SERVER);
+ }
+ return;
+ }
+ chatLog("Unknown command", BY_SERVER);
}
std::string
@@ -337,76 +507,75 @@ ChatWindow::const_msg(CHATSKILL act)
{
std::string msg;
if (act.success == SKILL_FAILED && act.skill == SKILL_BASIC) {
- switch (act.bskill) {
- case BSKILL_TRADE :
- msg = "Trade failed!";
- break;
- case BSKILL_EMOTE :
- msg = "Emote failed!";
- break;
- case BSKILL_SIT :
- msg = "Sit failed!";
- break;
- case BSKILL_CREATECHAT :
- msg = "Chat creating failed!";
- break;
- case BSKILL_JOINPARTY :
- msg = "Could not join party!";
- break;
- case BSKILL_SHOUT :
- msg = "Cannot shout!";
- break;
- }
-
- switch (act.reason) {
- case RFAIL_SKILLDEP :
- msg += " You have not yet reached a high enough lvl!";
- break;
- case RFAIL_INSUFHP :
- msg += " Insufficient HP!";
- break;
- case RFAIL_INSUFSP :
- msg += " Insufficient SP!";
- break;
- case RFAIL_NOMEMO :
- msg += " You have no memos!";
- break;
- case RFAIL_SKILLDELAY :
- msg += " You cannot do that right now!";
- break;
- case RFAIL_ZENY :
- msg += " Seems you need more Zeny... ;-)";
- break;
- case RFAIL_WEAPON :
- msg += " You cannot use this skill with that kind of weapon!";
- break;
- case RFAIL_REDGEM :
- msg += " You need another red gem!";
- break;
- case RFAIL_BLUEGEM :
- msg += " You need another blue gem!";
- break;
- case RFAIL_OVERWEIGHT :
- msg += " You're carrying to much to do this!";
- break;
- default :
- msg += " Huh? What's that?";
- break;
- }
+ switch (act.bskill) {
+ case BSKILL_TRADE :
+ msg = "Trade failed!";
+ break;
+ case BSKILL_EMOTE :
+ msg = "Emote failed!";
+ break;
+ case BSKILL_SIT :
+ msg = "Sit failed!";
+ break;
+ case BSKILL_CREATECHAT :
+ msg = "Chat creating failed!";
+ break;
+ case BSKILL_JOINPARTY :
+ msg = "Could not join party!";
+ break;
+ case BSKILL_SHOUT :
+ msg = "Cannot shout!";
+ break;
+ }
+
+ switch (act.reason) {
+ case RFAIL_SKILLDEP :
+ msg += " You have not yet reached a high enough level!";
+ break;
+ case RFAIL_INSUFHP :
+ msg += " Insufficient HP!";
+ break;
+ case RFAIL_INSUFSP :
+ msg += " Insufficient SP!";
+ break;
+ case RFAIL_NOMEMO :
+ msg += " You have no memos!";
+ break;
+ case RFAIL_SKILLDELAY :
+ msg += " You cannot do that right now!";
+ break;
+ case RFAIL_ZENY :
+ msg += " Seems you need more Zeny... ;-)";
+ break;
+ case RFAIL_WEAPON :
+ msg += " You cannot use this skill with that kind of weapon!";
+ break;
+ case RFAIL_REDGEM :
+ msg += " You need another red gem!";
+ break;
+ case RFAIL_BLUEGEM :
+ msg += " You need another blue gem!";
+ break;
+ case RFAIL_OVERWEIGHT :
+ msg += " You're carrying to much to do this!";
+ break;
+ default :
+ msg += " Huh? What's that?";
+ break;
+ }
} else {
- switch(act.skill) {
- case SKILL_WARP :
- msg = "Warp failed...";
- break;
- case SKILL_STEAL :
- msg = "Could not steal anything...";
- break;
- case SKILL_ENVENOM :
- msg = "Poison had no effect...";
- break;
- }
+ switch(act.skill) {
+ case SKILL_WARP :
+ msg = "Warp failed...";
+ break;
+ case SKILL_STEAL :
+ msg = "Could not steal anything...";
+ break;
+ case SKILL_ENVENOM :
+ msg = "Poison had no effect...";
+ break;
+ }
}
-
return msg;
}
@@ -414,7 +583,7 @@ void
ChatWindow::scroll(int amount)
{
if (!isVisible())
- return;
+ return;
int range = mScrollArea->getHeight() / 8 * amount;
gcn::Rectangle scr;
@@ -427,25 +596,25 @@ void
ChatWindow::keyPressed(gcn::KeyEvent &event)
{
if (event.getKey().getValue() == gcn::Key::DOWN &&
- mCurHist != mHistory.end())
- {
- // Move forward through the history
- HistoryIterator prevHist = mCurHist++;
- if (mCurHist != mHistory.end()) {
- mChatInput->setText(*mCurHist);
- mChatInput->setCaretPosition(mChatInput->getText().length());
- }
- else {
- mCurHist = prevHist;
- }
+ mCurHist != mHistory.end())
+ {
+ // Move forward through the history
+ HistoryIterator prevHist = mCurHist++;
+ if (mCurHist != mHistory.end()) {
+ mChatInput->setText(*mCurHist);
+ mChatInput->setCaretPosition(mChatInput->getText().length());
+ }
+ else {
+ mCurHist = prevHist;
+ }
}
else if (event.getKey().getValue() == gcn::Key::UP &&
- mCurHist != mHistory.begin() && mHistory.size() > 0)
+ mCurHist != mHistory.begin() && mHistory.size() > 0)
{
- // Move backward through the history
- mCurHist--;
- mChatInput->setText(*mCurHist);
- mChatInput->setCaretPosition(mChatInput->getText().length());
+ // Move backward through the history
+ mCurHist--;
+ mChatInput->setText(*mCurHist);
+ mChatInput->setCaretPosition(mChatInput->getText().length());
}
}
@@ -469,3 +638,138 @@ ChatWindow::setVisible(bool isVisible)
mTmpVisible = false;
}
+void
+ChatWindow::party(const std::string &command, const std::string &rest)
+{
+ if (command == "prefix")
+ {
+ if (rest == "")
+ {
+ char temp[2] = ".";
+ *temp = mPartyPrefix;
+ chatLog("The current party prefix is " + std::string(temp),
+ BY_SERVER);
+ return;
+ }
+ if (rest.length() != 1)
+ {
+ chatLog("Party prefix must be one character long.", BY_SERVER);
+ }
+ else
+ {
+ if (rest == "/")
+ {
+ chatLog("Cannot use a '/' as the prefix.", BY_SERVER);
+ }
+ else
+ {
+ mPartyPrefix = rest.at(0);
+ chatLog("Changing prefix to " + rest, BY_SERVER);
+ }
+ }
+ return;
+ }
+ mParty->respond(command, rest);
+}
+
+void
+ChatWindow::help(const std::string &msg1, const std::string &msg2)
+{
+ chatLog("-- Help --", BY_SERVER);
+ if (msg1 == "")
+ {
+ chatLog("/announce: Global announcement (GM only)", BY_SERVER);
+ chatLog("/clear: Clears this window", BY_SERVER);
+ chatLog("/help: Display this help.", BY_SERVER);
+ mParty->help();
+ chatLog("/present: Get list of players present", BY_SERVER);
+ mRecorder->help();
+ chatLog("/toggle: Determine whether <return> toggles the chat log.",
+ BY_SERVER);
+ chatLog("/where: Display map name", BY_SERVER);
+ chatLog("/whisper <nick> <message>: Sends a private <message>"
+ " to <nick>", BY_SERVER);
+ chatLog("/who: Display number of online users", BY_SERVER);
+ chatLog("For more information, type /help <command>", BY_SERVER);
+ return;
+ }
+ if (msg1 == "announce")
+ {
+ chatLog("Command: /announce <msg>", BY_SERVER);
+ chatLog("*** only available to a GM ***", BY_SERVER);
+ chatLog("This command sends the message <msg> to "
+ "all players currently online.", BY_SERVER);
+ return;
+ }
+ if (msg1 == "clear")
+ {
+ chatLog("Command: /clear", BY_SERVER);
+ chatLog("This command clears the chat log of previous chat.",
+ BY_SERVER);
+ return;
+ }
+ if (msg1 == "help")
+ {
+ chatLog("Command: /help", BY_SERVER);
+ chatLog("This command displays a list of all commands available.",
+ BY_SERVER);
+ chatLog("Command: /help <command>", BY_SERVER);
+ chatLog("This command displays help on <command>.", BY_SERVER);
+ return;
+ }
+ if (msg1 == "party")
+ {
+ mParty->help(msg2);
+ return;
+ }
+ if (msg1 == "present")
+ {
+ chatLog("Command: /present", BY_SERVER);
+ chatLog("This command gets a list of players within hearing "
+ "and sends it to either the record log if recording, or the "
+ "chat log otherwise.", BY_SERVER);
+ return;
+ }
+ if (msg1 == "record")
+ {
+ mRecorder->help(msg2);
+ return;
+ }
+ if (msg1 == "toggle")
+ {
+ chatLog("Command: /toggle <state>", BY_SERVER);
+ chatLog("This command sets whether the return key should toggle the "
+ "chat log, or whether the chat log turns off automatically.",
+ BY_SERVER);
+ chatLog("<state> can be one of \"1\", \"yes\", \"true\" to turn "
+ "the toggle on, or \"0\", \"no\", \"false\" to turn the "
+ "toggle off.", BY_SERVER);
+ chatLog("Command: /toggle", BY_SERVER);
+ chatLog("This command displays the return toggle status.", BY_SERVER);
+ return;
+ }
+ if (msg1 == "where")
+ {
+ chatLog("Command: /where", BY_SERVER);
+ chatLog("This command displays the name of the current map.",
+ BY_SERVER);
+ return;
+ }
+ if (msg1 == "whisper")
+ {
+ chatLog("Command: /whisper <nick> <msg>", BY_SERVER);
+ chatLog("This command sends the message <msg> to <nick.", BY_SERVER);
+ chatLog("If the <nick> has spaces in it, enclose it in "
+ "double quotes (\").", BY_SERVER);
+ return;
+ }
+ if (msg1 == "who")
+ {
+ chatLog("Command: /who", BY_SERVER);
+ chatLog("This command displays the number of players currently "
+ "online.", BY_SERVER);
+ return;
+ }
+ chatLog("Unknown command.", BY_SERVER);
+ chatLog("Type /help for a list of commands.", BY_SERVER);
+}
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 0bdc76f1..5e5ca110 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: chat.h 4227 2008-05-08 00:39:29Z peaveydk $
*/
#ifndef _TMW_CHAT_H
@@ -26,6 +26,7 @@
#include <list>
#include <string>
+#include <fstream>
#include <guichan/actionlistener.hpp>
#include <guichan/keylistener.hpp>
@@ -37,29 +38,19 @@
class BrowserBox;
class Network;
class ScrollArea;
+class Recorder;
+class Party;
#define BY_GM 0 // those should be self-explanatory =)
#define BY_PLAYER 1
#define BY_OTHER 2
#define BY_SERVER 3
+#define BY_PARTY 4
-#define ACT_WHISPER 4 // getting whispered at
-#define ACT_IS 5 // equivalent to "/me" on IRC
+#define ACT_WHISPER 5 // getting whispered at
+#define ACT_IS 6 // equivalent to "/me" on IRC
-#define BY_LOGGER 6
-
-#define IS_ANNOUNCE "/announce "
-#define IS_ANNOUNCE_LENGTH 10
-#define IS_HELP "/help"
-#define IS_HELP_LENGTH 5
-#define IS_WHERE "/where"
-#define IS_WHERE_LENGTH 6
-#define IS_WHO "/who"
-#define IS_WHO_LENGTH 4
-#define IS_CLEAR "/clear"
-#define IS_CLEAR_LENGTH 6
-#define IS_WHISPER "/whisper"
-#define IS_WHISPER_LENGTH 8
+#define BY_LOGGER 7
/**
* gets in between usernick and message text depending on
@@ -118,121 +109,150 @@ struct CHATSKILL
* \ingroup Interface
*/
class ChatWindow : public Window, public gcn::ActionListener,
- public gcn::KeyListener
+ public gcn::KeyListener
{
public:
- /**
- * Constructor.
- */
- ChatWindow(Network *network);
-
- /**
- * Logic (updates components' size)
- */
- void logic();
-
- /*
- * Adds a line of text to our message list. Parameters:
- *
- * @param line Text message.
- * @parem own Type of message (usually the owner-type).
- */
- void chatLog(std::string line, int own);
-
- /*
- * Calls original chat_log() after processing the packet.
- */
- void chatLog(CHATSKILL);
-
- /**
- * Performs action.
- */
- void action(const gcn::ActionEvent &event);
-
- /**
- * Request focus for typing chat message.
- */
- void requestChatFocus();
-
- /**
- * Checks whether ChatWindow is Focused or not.
- */
- bool isInputFocused();
-
- /**
- * Determines whether to send a command or an ordinary message, then
- * contructs packets & sends them.
- *
- * @param nick The character's name to display in front.
- * @param msg The message text which is to be send.
- *
- * NOTE:
- * The nickname is required by the server, if not specified
- * the message may not be sent unless a command was intended
- * which requires another packet to be constructed! you can
- * achieve this by putting a slash ("/") infront of the
- * message followed by the command name and the message.
- * of course all slash-commands need implemented handler-
- * routines. ;-)
- * remember, a line starting with "@" is not a command that needs
- * to be parsed rather is sent using the normal chat-packet.
- *
- * EXAMPLE:
- * // for an global announcement /- command
- * chatlog.chat_send("", "/announce Hello to all logged in users!");
- * // for simple message by a user /- message
- * chatlog.chat_send("Zaeiru", "Hello to all users on the screen!");
- */
- void
- chatSend(const std::string &nick, std::string msg);
-
- /** Called when key is pressed */
- void
- keyPressed(gcn::KeyEvent &event);
-
- /** Called to set current text */
- void
- setInputText(std::string input_str);
-
- /** Override to reset mTmpVisible */
- void
- setVisible(bool visible);
+ /**
+ * Constructor.
+ */
+ ChatWindow(Network *network);
+
+ /**
+ * Destructor: used to write back values to the config file
+ */
+ ~ChatWindow();
+
+ /**
+ * Logic (updates components' size)
+ */
+ void logic();
+
+ /**
+ * Adds a line of text to our message list. Parameters:
+ *
+ * @param line Text message.
+ * @parem own Type of message (usually the owner-type).
+ */
+ void chatLog(std::string line, int own, bool ignoreRecord = false);
+
+ /**
+ * Calls original chat_log() after processing the packet.
+ */
+ void chatLog(CHATSKILL);
+
+ /**
+ * Performs action.
+ */
+ void action(const gcn::ActionEvent &event);
+
+ /**
+ * Request focus for typing chat message.
+ */
+ void requestChatFocus();
+
+ /**
+ * Checks whether ChatWindow is Focused or not.
+ */
+ bool isInputFocused();
+
+ /**
+ * Determines whether to send a command or an ordinary message, then
+ * contructs packets & sends them.
+ *
+ * @param nick The character's name to display in front.
+ * @param msg The message text which is to be send.
+ *
+ * NOTE:
+ * The nickname is required by the server, if not specified
+ * the message may not be sent unless a command was intended
+ * which requires another packet to be constructed! you can
+ * achieve this by putting a slash ("/") infront of the
+ * message followed by the command name and the message.
+ * of course all slash-commands need implemented handler-
+ * routines. ;-)
+ * remember, a line starting with "@" is not a command that needs
+ * to be parsed rather is sent using the normal chat-packet.
+ *
+ * EXAMPLE:
+ * // for an global announcement /- command
+ * chatlog.chat_send("", "/announce Hello to all logged in users!");
+ * // for simple message by a user /- message
+ * chatlog.chat_send("Zaeiru", "Hello to all users on the screen!");
+ */
+ void
+ chatSend(const std::string &nick, std::string msg);
+
+ /** Called when key is pressed */
+ void
+ keyPressed(gcn::KeyEvent &event);
+
+ /** Called to set current text */
+ void
+ setInputText(std::string input_str);
+
+ /** Override to reset mTmpVisible */
+ void
+ setVisible(bool visible);
/**
- * Scrolls the chat window
- *
- * @param amount direction and amount to scroll. Negative numbers scroll
- * up, positive numbers scroll down. The absolute amount indicates the
- * amount of 1/8ths of chat window real estate that should be scrolled.
- */
- void
- scroll(int amount);
+ * Scrolls the chat window
+ *
+ * @param amount direction and amount to scroll. Negative numbers scroll
+ * up, positive numbers scroll down. The absolute amount indicates the
+ * amount of 1/8ths of chat window real estate that should be scrolled.
+ */
+ void
+ scroll(int amount);
+
+ /**
+ * party implements the partying chat commands
+ *
+ * @param command is the party command to perform
+ * @param msg is the remainder of the message
+ */
+ void
+ party(const std::string &command, const std::string &msg);
+
+ /**
+ * help implements the /help command
+ *
+ * @param msg1 is the command that the player needs help on
+ * @param msg2 is the sub-command relating to the command
+ */
+ void
+ help(const std::string &msg1, const std::string &msg2);
private:
- Network *mNetwork;
- bool mTmpVisible;
-
- /** One item in the chat log */
- struct CHATLOG
- {
- std::string nick;
- std::string text;
- int own;
- };
-
- /** Constructs failed messages for actions */
- std::string const_msg(CHATSKILL);
-
- gcn::TextField *mChatInput; /**< Input box for typing chat messages */
- BrowserBox *mTextOutput; /**< Text box for displaying chat history */
- ScrollArea *mScrollArea; /**< Scroll area around text output */
-
- typedef std::list<std::string> History;
- typedef History::iterator HistoryIterator;
- History mHistory; /**< Command history */
- HistoryIterator mCurHist; /**< History iterator */
-};
+ Network *mNetwork;
+ bool mTmpVisible;
+
+ /** One item in the chat log */
+ struct CHATLOG
+ {
+ std::string nick;
+ std::string text;
+ int own;
+ };
+
+ /** Constructs failed messages for actions */
+ std::string const_msg(CHATSKILL);
+
+ gcn::TextField *mChatInput; /**< Input box for typing chat messages */
+ BrowserBox *mTextOutput; /**< Text box for displaying chat history */
+ ScrollArea *mScrollArea; /**< Scroll area around text output */
+
+ typedef std::list<std::string> History;
+ typedef History::iterator HistoryIterator;
+ History mHistory; /**< Command history */
+ HistoryIterator mCurHist; /**< History iterator */
+ Recorder *mRecorder; /**< Recording class */
+ char mPartyPrefix; /**< Messages beginning with the prefix are sent to
+ the party */
+ bool mReturnToggles; /**< Marks whether <Return> toggles the chat log
+ or not */
+ Party *mParty;
+};
extern ChatWindow *chatWindow;
#endif
diff --git a/src/gui/chatinput.cpp b/src/gui/chatinput.cpp
index fc5d6aab..b403a03e 100644
--- a/src/gui/chatinput.cpp
+++ b/src/gui/chatinput.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: chatinput.cpp 3361 2007-07-07 20:12:58Z b_lindeijer $
*/
#include "chatinput.h"
diff --git a/src/gui/chatinput.h b/src/gui/chatinput.h
index da2342ae..6ac8c1a5 100644
--- a/src/gui/chatinput.h
+++ b/src/gui/chatinput.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: chatinput.h 3361 2007-07-07 20:12:58Z b_lindeijer $
*/
#ifndef _TMW_CHATINPUT_H
diff --git a/src/gui/checkbox.cpp b/src/gui/checkbox.cpp
index 5b300d33..b530bbea 100644
--- a/src/gui/checkbox.cpp
+++ b/src/gui/checkbox.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: checkbox.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include "checkbox.h"
diff --git a/src/gui/checkbox.h b/src/gui/checkbox.h
index 262e63ae..36083390 100644
--- a/src/gui/checkbox.h
+++ b/src/gui/checkbox.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: checkbox.h 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#ifndef _TMW_CHECKBOX_H
diff --git a/src/gui/confirm_dialog.cpp b/src/gui/confirm_dialog.cpp
index 0ff8be17..5b700831 100644
--- a/src/gui/confirm_dialog.cpp
+++ b/src/gui/confirm_dialog.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: confirm_dialog.cpp 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#include "confirm_dialog.h"
diff --git a/src/gui/confirm_dialog.h b/src/gui/confirm_dialog.h
index 8728f83f..3115485d 100644
--- a/src/gui/confirm_dialog.h
+++ b/src/gui/confirm_dialog.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: confirm_dialog.h 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#ifndef _TMW_OPTION_DIALOG_H
diff --git a/src/gui/connection.cpp b/src/gui/connection.cpp
index baa1ea34..0b62ca3c 100644
--- a/src/gui/connection.cpp
+++ b/src/gui/connection.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: connection.cpp 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#include "connection.h"
diff --git a/src/gui/connection.h b/src/gui/connection.h
index 7a072d2e..86b688a3 100644
--- a/src/gui/connection.h
+++ b/src/gui/connection.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: connection.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_CONNECTION_H
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp
index d6d99307..1e7d5b35 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: debugwindow.cpp 3509 2007-08-23 13:43:17Z b_lindeijer $
*/
#include "debugwindow.h"
diff --git a/src/gui/debugwindow.h b/src/gui/debugwindow.h
index 9b6f2017..59ae765c 100644
--- a/src/gui/debugwindow.h
+++ b/src/gui/debugwindow.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: debugwindow.h 3509 2007-08-23 13:43:17Z b_lindeijer $
*/
#ifndef _TMW_DEBUGWINDOW_H
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp
index 93b9ea37..564486aa 100644
--- a/src/gui/equipmentwindow.cpp
+++ b/src/gui/equipmentwindow.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: equipmentwindow.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "equipmentwindow.h"
diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h
index 99a3cc60..0cb5cb24 100644
--- a/src/gui/equipmentwindow.h
+++ b/src/gui/equipmentwindow.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: equipmentwindow.h 2545 2006-08-17 19:11:28Z crush_tmw $
*/
#ifndef _TMW_EQUIPMENT_H
diff --git a/src/gui/focushandler.cpp b/src/gui/focushandler.cpp
index ffdb7896..966d2013 100644
--- a/src/gui/focushandler.cpp
+++ b/src/gui/focushandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: focushandler.cpp 2239 2006-03-09 05:16:27Z der_doener $
*/
#include "focushandler.h"
diff --git a/src/gui/focushandler.h b/src/gui/focushandler.h
index 252fdd9d..5fde09f1 100644
--- a/src/gui/focushandler.h
+++ b/src/gui/focushandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: focushandler.h 2239 2006-03-09 05:16:27Z der_doener $
*/
#ifndef _TMW_FOCUSHANDLER_H
diff --git a/src/gui/gccontainer.cpp b/src/gui/gccontainer.cpp
index 1edb4daf..8095be61 100644
--- a/src/gui/gccontainer.cpp
+++ b/src/gui/gccontainer.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: gccontainer.cpp 4208 2008-04-29 11:25:26Z b_lindeijer $
*/
#include "gccontainer.h"
diff --git a/src/gui/gccontainer.h b/src/gui/gccontainer.h
index 8b8a7ffe..6c6bee80 100644
--- a/src/gui/gccontainer.h
+++ b/src/gui/gccontainer.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: gccontainer.h 4208 2008-04-29 11:25:26Z b_lindeijer $
*/
#ifndef _TMW_GUI_GCCONTAINER_H
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index db0b9f80..e56afc76 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: gui.cpp 3628 2007-10-18 18:39:48Z b_lindeijer $
*/
#include "gui.h"
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 1e4b9348..d2a832c7 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: gui.h 3628 2007-10-18 18:39:48Z b_lindeijer $
*/
#ifndef _TMW_GUI
diff --git a/src/gui/hbox.cpp b/src/gui/hbox.cpp
index 69564fbb..dc909195 100644
--- a/src/gui/hbox.cpp
+++ b/src/gui/hbox.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: hbox.cpp 1881 2005-10-18 21:40:25Z der_doener $
*/
#include "hbox.h"
diff --git a/src/gui/hbox.h b/src/gui/hbox.h
index 560b1a29..99364866 100644
--- a/src/gui/hbox.h
+++ b/src/gui/hbox.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: hbox.h 1881 2005-10-18 21:40:25Z der_doener $
*/
#ifndef HBOX_H
diff --git a/src/gui/help.cpp b/src/gui/help.cpp
index 0b010253..56a5e70e 100644
--- a/src/gui/help.cpp
+++ b/src/gui/help.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: help.cpp 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#include "help.h"
diff --git a/src/gui/help.h b/src/gui/help.h
index 3c3715a0..3b45283c 100644
--- a/src/gui/help.h
+++ b/src/gui/help.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: help.h 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#ifndef _TMW_HELP_H
diff --git a/src/gui/inttextbox.cpp b/src/gui/inttextbox.cpp
index 2a09f255..7a39c2df 100644
--- a/src/gui/inttextbox.cpp
+++ b/src/gui/inttextbox.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: inttextbox.cpp 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#include "inttextbox.h"
diff --git a/src/gui/inttextbox.h b/src/gui/inttextbox.h
index b5d339ac..64351f48 100644
--- a/src/gui/inttextbox.h
+++ b/src/gui/inttextbox.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: inttextbox.h 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#ifndef INTTEXTBOX_H
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index fcc602f9..b53fa43b 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: inventorywindow.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "inventorywindow.h"
diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h
index d45602d2..4793069c 100644
--- a/src/gui/inventorywindow.h
+++ b/src/gui/inventorywindow.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: inventorywindow.h 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#ifndef _TMW_INVENTORYWINDOW_H
diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp
index f72462f9..40e2e121 100644
--- a/src/gui/item_amount.cpp
+++ b/src/gui/item_amount.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: item_amount.cpp 3718 2007-11-11 14:46:33Z b_lindeijer $
*/
#include "item_amount.h"
diff --git a/src/gui/item_amount.h b/src/gui/item_amount.h
index 67002703..668dfe3b 100644
--- a/src/gui/item_amount.h
+++ b/src/gui/item_amount.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: item_amount.h 3718 2007-11-11 14:46:33Z b_lindeijer $
*/
#ifndef _TMW_ITEM_AMOUNT_WINDOW_H
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index cf5dcb92..ce7337d2 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemcontainer.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "itemcontainer.h"
diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h
index db8c6f3d..353ac51d 100644
--- a/src/gui/itemcontainer.h
+++ b/src/gui/itemcontainer.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemcontainer.h 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#ifndef _TMW_ITEMCONTAINER_H__
diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp
index 0ce4f6b7..5899abd1 100644
--- a/src/gui/itemshortcutcontainer.cpp
+++ b/src/gui/itemshortcutcontainer.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemshortcutcontainer.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "itemshortcutcontainer.h"
diff --git a/src/gui/itemshortcutcontainer.h b/src/gui/itemshortcutcontainer.h
index 58f0aea7..7698755b 100644
--- a/src/gui/itemshortcutcontainer.h
+++ b/src/gui/itemshortcutcontainer.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemshortcutcontainer.h 4076 2008-04-12 18:36:15Z b_lindeijer $
*/
#ifndef _TMW_ITEMSHORTCUTCONTAINER_H__
diff --git a/src/gui/itemshortcutwindow.cpp b/src/gui/itemshortcutwindow.cpp
index 3724516a..31f3bf4e 100644
--- a/src/gui/itemshortcutwindow.cpp
+++ b/src/gui/itemshortcutwindow.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemshortcutwindow.cpp 4076 2008-04-12 18:36:15Z b_lindeijer $
*/
#include "itemshortcutwindow.h"
diff --git a/src/gui/itemshortcutwindow.h b/src/gui/itemshortcutwindow.h
index 9742abdc..5f7ba3d7 100644
--- a/src/gui/itemshortcutwindow.h
+++ b/src/gui/itemshortcutwindow.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemshortcutwindow.h 4076 2008-04-12 18:36:15Z b_lindeijer $
*/
#ifndef _TMW_ITEMSHORTCUTWINDOW_H
diff --git a/src/gui/linkhandler.h b/src/gui/linkhandler.h
index 3a32f825..93a8c000 100644
--- a/src/gui/linkhandler.h
+++ b/src/gui/linkhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: linkhandler.h 3606 2007-09-27 14:54:09Z b_lindeijer $
*/
#ifndef _TMW_LINK_HANDLER_H_
diff --git a/src/gui/listbox.cpp b/src/gui/listbox.cpp
index 634afa07..cf941be1 100644
--- a/src/gui/listbox.cpp
+++ b/src/gui/listbox.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: listbox.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include "listbox.h"
diff --git a/src/gui/listbox.h b/src/gui/listbox.h
index b226a11e..ec95734d 100644
--- a/src/gui/listbox.h
+++ b/src/gui/listbox.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: listbox.h 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#ifndef _TMW_LISTBOX_H
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index d85f4e83..526a8e8f 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: login.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include "login.h"
@@ -29,12 +29,19 @@
#include "../main.h"
#include "../logindata.h"
+#include "../configuration.h"
#include "button.h"
#include "checkbox.h"
#include "ok_dialog.h"
#include "passwordfield.h"
#include "textfield.h"
+#include "../utils/tostring.h"
+
+static const int MAX_SERVER_LIST_SIZE = 5;
+static const int LOGIN_DIALOG_WIDTH = 220;
+static const int LOGIN_DIALOG_HEIGHT = 140;
+static const int FIELD_WIDTH = LOGIN_DIALOG_WIDTH - 70;
LoginDialog::LoginDialog(LoginData *loginData):
Window("Login"), mLoginData(loginData)
@@ -42,59 +49,89 @@ LoginDialog::LoginDialog(LoginData *loginData):
gcn::Label *userLabel = new gcn::Label("Name:");
gcn::Label *passLabel = new gcn::Label("Password:");
gcn::Label *serverLabel = new gcn::Label("Server:");
+ gcn::Label *portLabel = new gcn::Label("Port:");
+ mServerList = new DropDownList("MostRecent00",
+ "216.139.126.36",
+ "6901",
+ MAX_SERVER_LIST_SIZE);
+ mServerListBox = new gcn::ListBox(mServerList);
+ mServerScrollArea = new ScrollArea();
+
mUserField = new TextField(mLoginData->username);
mPassField = new PasswordField(mLoginData->password);
- mServerField = new TextField(mLoginData->hostname);
+ mServerField = new TextField(mServerList->getServerAt(0));
+ mPortField = new TextField(mServerList->getPortAt(0));
+ mServerDropDown = new DropDown(mServerList,
+ mServerScrollArea,
+ mServerListBox);
+
mKeepCheck = new CheckBox("Keep", mLoginData->remember);
mOkButton = new Button("OK", "ok", this);
mCancelButton = new Button("Cancel", "cancel", this);
mRegisterButton = new Button("Register", "register", this);
- const int width = 220;
- const int height = 100;
-
- setContentSize(width, height);
-
- userLabel->setPosition(5, 5);
- passLabel->setPosition(5, 14 + userLabel->getHeight());
- serverLabel->setPosition(
- 5, 23 + userLabel->getHeight() + passLabel->getHeight());
- mUserField->setPosition(65, 5);
- mPassField->setPosition(65, 14 + userLabel->getHeight());
- mServerField->setPosition(
- 65, 23 + userLabel->getHeight() + passLabel->getHeight());
- mUserField->setWidth(width - 70);
- mPassField->setWidth(width - 70);
- mServerField->setWidth(width - 70);
- mKeepCheck->setPosition(4, 77);
+ setContentSize(LOGIN_DIALOG_WIDTH, LOGIN_DIALOG_HEIGHT);
+
+ const int USER_TOP = 5;
+ userLabel->setPosition(5, USER_TOP);
+ mUserField->setPosition(65, USER_TOP);
+ mUserField->setWidth(FIELD_WIDTH);
+
+ const int PASS_TOP = 9 + USER_TOP + userLabel->getHeight();
+ passLabel->setPosition(5, PASS_TOP);
+ mPassField->setPosition(65, PASS_TOP);
+ mPassField->setWidth(FIELD_WIDTH);
+
+ const int SERVER_TOP = 9 + PASS_TOP + passLabel->getHeight();
+ serverLabel->setPosition(5, SERVER_TOP);
+ mServerField->setPosition(65, SERVER_TOP);
+ mServerField->setWidth(FIELD_WIDTH);
+
+ const int PORT_TOP = 9 + SERVER_TOP + serverLabel->getHeight();
+ portLabel->setPosition(5, PORT_TOP);
+ mPortField->setPosition(65, PORT_TOP);
+ mPortField->setWidth(FIELD_WIDTH);
+
+ const int DROP_DOWN_TOP = 9 + PORT_TOP + serverLabel->getHeight();
+ mServerDropDown->setPosition(5, DROP_DOWN_TOP);
+ mServerDropDown->setWidth(FIELD_WIDTH);
+
+ const int REST_TOP = LOGIN_DIALOG_HEIGHT - mCancelButton->getHeight() - 5;
+
+ mKeepCheck->setPosition(4, REST_TOP);
mCancelButton->setPosition(
- width - mCancelButton->getWidth() - 5,
- height - mCancelButton->getHeight() - 5);
+ LOGIN_DIALOG_WIDTH - mCancelButton->getWidth() - 5, REST_TOP);
mOkButton->setPosition(
- mCancelButton->getX() - mOkButton->getWidth() - 5,
- height - mOkButton->getHeight() - 5);
+ mCancelButton->getX() - mOkButton->getWidth() - 5, REST_TOP);
mRegisterButton->setPosition(
- mKeepCheck->getX() + mKeepCheck->getWidth() + 10,
- height - mRegisterButton->getHeight() - 5);
+ mKeepCheck->getX() + mKeepCheck->getWidth() + 10, REST_TOP);
mUserField->setActionEventId("ok");
mPassField->setActionEventId("ok");
mServerField->setActionEventId("ok");
+ mServerDropDown->setActionEventId("changeSelection");
mUserField->addKeyListener(this);
mPassField->addKeyListener(this);
mServerField->addKeyListener(this);
+ mPortField->addKeyListener(this);
+ mServerDropDown->addKeyListener(this);
mUserField->addActionListener(this);
mPassField->addActionListener(this);
mServerField->addActionListener(this);
+ mPortField->addActionListener(this);
+ mServerDropDown->addActionListener(this);
mKeepCheck->addActionListener(this);
add(userLabel);
add(passLabel);
add(serverLabel);
+ add(portLabel);
add(mUserField);
add(mPassField);
add(mServerField);
+ add(mPortField);
+ add(mServerDropDown);
add(mKeepCheck);
add(mOkButton);
add(mCancelButton);
@@ -114,6 +151,9 @@ LoginDialog::LoginDialog(LoginData *loginData):
LoginDialog::~LoginDialog()
{
+ delete mServerList;
+ delete mServerListBox;
+ delete mServerScrollArea;
}
void
@@ -122,6 +162,7 @@ LoginDialog::action(const gcn::ActionEvent &event)
if (event.getId() == "ok" && canSubmit())
{
mLoginData->hostname = mServerField->getText();
+ mLoginData->port = getUShort(mPortField->getText());
mLoginData->username = mUserField->getText();
mLoginData->password = mPassField->getText();
mLoginData->remember = mKeepCheck->isSelected();
@@ -129,9 +170,15 @@ LoginDialog::action(const gcn::ActionEvent &event)
mOkButton->setEnabled(false);
mRegisterButton->setEnabled(false);
-
+ mServerList->save(mServerField->getText(), mPortField->getText());
state = ACCOUNT_STATE;
}
+ else if (event.getId() == "changeSelection")
+ {
+ int selected = mServerListBox->getSelected();
+ mServerField->setText(mServerList->getServerAt(selected));
+ mPortField->setText(mServerList->getPortAt(selected));
+ }
else if (event.getId() == "cancel")
{
state = EXIT_STATE;
@@ -140,6 +187,14 @@ LoginDialog::action(const gcn::ActionEvent &event)
{
// Transfer these fields on to the register dialog
mLoginData->hostname = mServerField->getText();
+ if (isUShort(mPortField->getText()))
+ {
+ mLoginData->port = getUShort(mPortField->getText());
+ }
+ else
+ {
+ mLoginData->port = 6901;
+ }
mLoginData->username = mUserField->getText();
mLoginData->password = mPassField->getText();
@@ -159,5 +214,148 @@ LoginDialog::canSubmit()
return !mUserField->getText().empty() &&
!mPassField->getText().empty() &&
!mServerField->getText().empty() &&
+ isUShort(mPortField->getText()) &&
state == LOGIN_STATE;
}
+
+bool
+LoginDialog::isUShort(const std::string &str)
+{
+ if (str == "")
+ {
+ return false;
+ }
+ unsigned long l = 0;
+ for (std::string::const_iterator strPtr = str.begin(), strEnd = str.end();
+ strPtr != strEnd; ++strPtr)
+ {
+ if (*strPtr < '0' || *strPtr > '9')
+ {
+ return false;
+ }
+ l = l * 10 + (*strPtr - '0'); // *strPtr - '0' will never be negative
+ if (l > 65535)
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+unsigned short
+LoginDialog::getUShort(const std::string &str)
+{
+ unsigned long l = 0;
+ for (std::string::const_iterator strPtr = str.begin(), strEnd = str.end();
+ strPtr != strEnd; ++strPtr)
+ {
+ l = l * 10 + (*strPtr - '0');
+ }
+ return static_cast<unsigned short>(l);
+}
+
+/**
+ * LoginDialog::DropDownList
+ */
+
+void
+LoginDialog::DropDownList::saveEntry(const std::string &server,
+ const std::string &port, int &saved)
+{
+ if (saved < MAX_SERVER_LIST_SIZE && server != "")
+ {
+ config.setValue(mConfigPrefix + "Server" + toString(saved), server);
+ config.setValue(mConfigPrefix + "Port" + toString(saved), port);
+ ++saved;
+ }
+}
+
+LoginDialog::DropDownList::DropDownList(std::string prefix,
+ std::string dflt,
+ std::string dfltPort,
+ int maxEntries) :
+ mConfigPrefix(prefix),
+ mMaxEntries(maxEntries)
+{
+ for (int i = 0; i < maxEntries; ++i)
+ {
+ std::string server = config.getValue(mConfigPrefix + "Server" +
+ toString(i), "");
+ if (server == "") // Just in case had original config entries
+ {
+ server = config.getValue(mConfigPrefix + "ServerList" +
+ toString(i), "");
+ }
+ std::string port = config.getValue(mConfigPrefix + "Port" +
+ toString(i), dfltPort);
+
+ if (server != "")
+ {
+ mServers.push_back(server);
+ mPorts.push_back(port);
+ }
+ }
+ if (mServers.size() == 0)
+ {
+ mServers.push_back(dflt);
+ mPorts.push_back(dfltPort);
+ }
+
+}
+
+void
+LoginDialog::DropDownList::save(const std::string &server,
+ const std::string &port)
+{
+ int position = 0;
+ saveEntry(server, port, position);
+ for (std::vector<std::string>::const_iterator sPtr = mServers.begin(),
+ sEnd = mServers.end(),
+ pPtr = mPorts.begin(),
+ pEnd = mPorts.end();
+ sPtr != sEnd && pPtr != pEnd;
+ ++sPtr, ++pPtr)
+ {
+ if (*sPtr != server || *pPtr != port)
+ {
+ saveEntry(*sPtr, *pPtr, position);
+ }
+ }
+}
+
+int
+LoginDialog::DropDownList::getNumberOfElements()
+{
+ return mServers.size();
+}
+
+std::string
+LoginDialog::DropDownList::getElementAt(int i)
+{
+ if (i < 0 || i >= getNumberOfElements())
+ {
+ return "";
+ }
+ return getServerAt(i) + ":" + getPortAt(i);
+}
+
+std::string
+LoginDialog::DropDownList::getServerAt(int i)
+{
+ if (i < 0 || i >= getNumberOfElements())
+ {
+ return "";
+ }
+ return mServers.at(i);
+}
+
+
+std::string
+LoginDialog::DropDownList::getPortAt(int i)
+{
+ if (i < 0 || i >= getNumberOfElements())
+ {
+ return "";
+ }
+ return mPorts.at(i);
+}
diff --git a/src/gui/login.h b/src/gui/login.h
index e08120cb..8a228b5f 100644
--- a/src/gui/login.h
+++ b/src/gui/login.h
@@ -18,18 +18,23 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: login.h 3234 2007-03-24 13:05:27Z b_lindeijer $
*/
#ifndef _TMW_LOGIN_H
#define _TMW_LOGIN_H
#include <iosfwd>
+#include <vector>
+#include <string>
+
#include <guichan/actionlistener.hpp>
#include <guichan/keylistener.hpp>
#include "window.h"
#include "../guichanfwd.h"
+#include "widgets/dropdown.h"
+#include "scrollarea.h"
class LoginData;
@@ -72,15 +77,66 @@ class LoginDialog : public Window, public gcn::ActionListener,
bool
canSubmit();
+ /**
+ * Function to decide whether string is an unsigned short or not
+ *
+ * @param str the string to parse
+ *
+ * @return true is str is an unsigned short, false otherwise
+ */
+ static bool
+ isUShort(const std::string &str);
+
+ /**
+ * Converts string to an unsigned short (undefined if invalid)
+ *
+ * @param str the string to parse
+ *
+ * @return the value str represents
+ */
+ static unsigned short
+ getUShort(const std::string &str);
+
+ DropDown *mServerDropDown;
gcn::TextField *mUserField;
gcn::TextField *mPassField;
gcn::TextField *mServerField;
+ gcn::TextField *mPortField;
gcn::CheckBox *mKeepCheck;
gcn::Button *mOkButton;
gcn::Button *mCancelButton;
gcn::Button *mRegisterButton;
LoginData *mLoginData;
+
+ /**
+ * Helper class to keep a list of all the recent entries for the
+ * dropdown
+ */
+ class DropDownList : public gcn::ListModel
+ {
+ private:
+ std::vector<std::string> mServers;
+ std::vector<std::string> mPorts;
+ std::string mConfigPrefix;
+ int mMaxEntries;
+ void saveEntry(const std::string &server,
+ const std::string &port, int &saved);
+ public:
+ DropDownList(std::string prefix,
+ std::string dfltServer,
+ std::string dfltPort,
+ int maxEntries);
+ void save(const std::string &server, const std::string &port);
+ int getNumberOfElements();
+ std::string getElementAt(int i);
+ std::string getServerAt(int i);
+ std::string getPortAt(int i);
+ };
+ DropDownList *mServerList;
+ gcn::ListBox *mServerListBox;
+ ScrollArea *mServerScrollArea;
+
};
#endif
diff --git a/src/gui/menuwindow.cpp b/src/gui/menuwindow.cpp
index 2043b7d1..c3af6896 100644
--- a/src/gui/menuwindow.cpp
+++ b/src/gui/menuwindow.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: menuwindow.cpp 4060 2008-04-09 14:49:07Z b_lindeijer $
*/
#include "menuwindow.h"
diff --git a/src/gui/menuwindow.h b/src/gui/menuwindow.h
index f43b9921..add04095 100644
--- a/src/gui/menuwindow.h
+++ b/src/gui/menuwindow.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: menuwindow.h 2417 2006-07-19 15:12:06Z umperio $
*/
#ifndef _TMW_MENU_H
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index c17fa06b..dc7df9b9 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: minimap.cpp 4116 2008-04-17 12:48:43Z peaveydk $
*/
#include "minimap.h"
diff --git a/src/gui/minimap.h b/src/gui/minimap.h
index 5e9458bf..d2640caa 100644
--- a/src/gui/minimap.h
+++ b/src/gui/minimap.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: minimap.h 2417 2006-07-19 15:12:06Z umperio $
*/
#ifndef _TMW_MINIMAP_H
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp
index 8f121368..3a7e7bf0 100644
--- a/src/gui/ministatus.cpp
+++ b/src/gui/ministatus.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: ministatus.cpp 3753 2007-11-20 12:27:56Z b_lindeijer $
*/
#include "ministatus.h"
diff --git a/src/gui/ministatus.h b/src/gui/ministatus.h
index 718fe140..d4002d93 100644
--- a/src/gui/ministatus.h
+++ b/src/gui/ministatus.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: ministatus.h 2581 2006-08-25 22:04:17Z b_lindeijer $
*/
#ifndef _TMW_MINISTATUS_H
diff --git a/src/gui/newskill.cpp b/src/gui/newskill.cpp
index 6783a546..c2088e75 100644
--- a/src/gui/newskill.cpp
+++ b/src/gui/newskill.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: newskill.cpp 3587 2007-09-20 13:24:20Z b_lindeijer $
*/
/* This file implements the new skill dialog for use under the latest
diff --git a/src/gui/newskill.h b/src/gui/newskill.h
index 6e12169f..c553ab1d 100644
--- a/src/gui/newskill.h
+++ b/src/gui/newskill.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: newskill.h 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#ifndef _TMW_NSKILL_H
diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp
index 7b4fc634..52f35a88 100644
--- a/src/gui/npc_text.cpp
+++ b/src/gui/npc_text.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npc_text.cpp 4096 2008-04-16 08:39:59Z b_lindeijer $
*/
#include "npc_text.h"
diff --git a/src/gui/npc_text.h b/src/gui/npc_text.h
index 0ef1b938..9e2b4ecd 100644
--- a/src/gui/npc_text.h
+++ b/src/gui/npc_text.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npc_text.h 4096 2008-04-16 08:39:59Z b_lindeijer $
*/
#ifndef _TMW_NPC_TEXT_H
diff --git a/src/gui/npclistdialog.cpp b/src/gui/npclistdialog.cpp
index 1bcdc8ff..e6523583 100644
--- a/src/gui/npclistdialog.cpp
+++ b/src/gui/npclistdialog.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npclistdialog.cpp 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#include "npclistdialog.h"
diff --git a/src/gui/npclistdialog.h b/src/gui/npclistdialog.h
index c09b0a8c..a96fd766 100644
--- a/src/gui/npclistdialog.h
+++ b/src/gui/npclistdialog.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npclistdialog.h 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#ifndef _TMW_GUI_NPCLISTDIALOG_H
diff --git a/src/gui/ok_dialog.cpp b/src/gui/ok_dialog.cpp
index ca9d2a7b..c49bb6bb 100644
--- a/src/gui/ok_dialog.cpp
+++ b/src/gui/ok_dialog.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: ok_dialog.cpp 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#include "ok_dialog.h"
diff --git a/src/gui/ok_dialog.h b/src/gui/ok_dialog.h
index a7b24a90..1c8e0c18 100644
--- a/src/gui/ok_dialog.h
+++ b/src/gui/ok_dialog.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: ok_dialog.h 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#ifndef _OK_DIALOG_H
diff --git a/src/gui/passwordfield.cpp b/src/gui/passwordfield.cpp
index 533f54fb..710eb767 100644
--- a/src/gui/passwordfield.cpp
+++ b/src/gui/passwordfield.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: passwordfield.cpp 2132 2006-02-01 14:53:10Z der_doener $
*/
#include "passwordfield.h"
diff --git a/src/gui/passwordfield.h b/src/gui/passwordfield.h
index cae1f92e..725bfbcf 100644
--- a/src/gui/passwordfield.h
+++ b/src/gui/passwordfield.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: passwordfield.h 2895 2006-12-09 01:44:18Z b_lindeijer $
*/
#ifndef _TMW_PASSWORDFIELD_H_
diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp
index 2c633b72..6d39ce05 100644
--- a/src/gui/playerbox.cpp
+++ b/src/gui/playerbox.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: playerbox.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/gui/playerbox.h b/src/gui/playerbox.h
index c226e750..0aa48a2c 100644
--- a/src/gui/playerbox.h
+++ b/src/gui/playerbox.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: playerbox.h 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#ifndef __TMW_PLAYERBOX_H__
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index cdc998e0..7e40abed 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: popupmenu.cpp 4243 2008-05-16 15:48:52Z the_enemy $
*/
#include "popupmenu.h"
@@ -40,6 +40,9 @@
#include "../npc.h"
#include "../player_relations.h"
+#include "../net/messageout.h"
+#include "../net/protocol.h"
+
#include "../resources/iteminfo.h"
#include "../resources/itemdb.h"
@@ -70,49 +73,53 @@ void PopupMenu::showPopup(int x, int y, Being *being)
switch (mBeing->getType())
{
- case Being::PLAYER:
- {
- // Players can be traded with. Later also attack, follow and
- // add as buddy will be options in this menu.
- const std::string &name = mBeing->getName();
- mBrowserBox->addRow("@@trade|Trade With " + name + "@@");
- mBrowserBox->addRow("@@attack|Attack " + name + "@@");
-
- mBrowserBox->addRow("##3---");
-
- switch (player_relations.getRelation(name)) {
- case PlayerRelation::NEUTRAL:
- mBrowserBox->addRow("@@friend|Befriend " + name + "@@");
-
- case PlayerRelation::FRIEND:
- mBrowserBox->addRow("@@disregard|Disregard " + name + "@@");
- mBrowserBox->addRow("@@ignore|Ignore " + name + "@@");
- break;
-
- case PlayerRelation::DISREGARDED:
- mBrowserBox->addRow("@@unignore|Un-Ignore " + name + "@@");
- mBrowserBox->addRow("@@ignore|Completely ignore " + name + "@@");
- break;
-
- case PlayerRelation::IGNORED:
- mBrowserBox->addRow("@@unignore|Un-Ignore " + name + "@@");
- break;
- }
-
- //mBrowserBox->addRow("@@follow|Follow " + name + "@@");
- //mBrowserBox->addRow("@@buddy|Add " + name + " to Buddy List@@");
- }
- break;
-
- case Being::NPC:
- // NPCs can be talked to (single option, candidate for removal
- // unless more options would be added)
- mBrowserBox->addRow("@@talk|Talk To NPC@@");
- break;
-
- default:
- /* Other beings aren't interesting... */
- break;
+ case Being::PLAYER:
+ {
+ // Players can be traded with. Later also attack, follow and
+ // add as buddy will be options in this menu.
+ const std::string &name = mBeing->getName();
+ mBrowserBox->addRow("@@trade|Trade With " + name + "@@");
+ mBrowserBox->addRow("@@attack|Attack " + name + "@@");
+
+ mBrowserBox->addRow("##3---");
+
+ switch (player_relations.getRelation(name)) {
+ case PlayerRelation::NEUTRAL:
+ mBrowserBox->addRow("@@friend|Befriend " + name + "@@");
+
+ case PlayerRelation::FRIEND:
+ mBrowserBox->addRow("@@disregard|Disregard " + name + "@@");
+ mBrowserBox->addRow("@@ignore|Ignore " + name + "@@");
+ break;
+
+ case PlayerRelation::DISREGARDED:
+ mBrowserBox->addRow("@@unignore|Un-Ignore " + name + "@@");
+ mBrowserBox->addRow("@@ignore|Completely ignore " + name + "@@");
+ break;
+
+ case PlayerRelation::IGNORED:
+ mBrowserBox->addRow("@@unignore|Un-Ignore " + name + "@@");
+ break;
+ }
+
+ //mBrowserBox->addRow("@@follow|Follow " + name + "@@");
+ //mBrowserBox->addRow("@@buddy|Add " + name + " to Buddy List@@");
+
+ mBrowserBox->addRow("##3---");
+ mBrowserBox->addRow("@@party-invite|Invite " + name +
+ " to party@@");
+ }
+ break;
+
+ case Being::NPC:
+ // NPCs can be talked to (single option, candidate for removal
+ // unless more options would be added)
+ mBrowserBox->addRow("@@talk|Talk To NPC@@");
+ break;
+
+ default:
+ /* Other beings aren't interesting... */
+ break;
}
//browserBox->addRow("@@look|Look To@@");
@@ -142,56 +149,56 @@ void PopupMenu::handleLink(const std::string& link)
{
// Talk To action
if (link == "talk" &&
- mBeing != NULL &&
- mBeing->getType() == Being::NPC &&
- current_npc == 0)
+ mBeing != NULL &&
+ mBeing->getType() == Being::NPC &&
+ current_npc == 0)
{
- dynamic_cast<NPC*>(mBeing)->talk();
+ dynamic_cast<NPC*>(mBeing)->talk();
}
// Trade action
else if (link == "trade" &&
- mBeing != NULL &&
- mBeing->getType() == Being::PLAYER)
+ mBeing != NULL &&
+ mBeing->getType() == Being::PLAYER)
{
- player_node->trade(mBeing);
- tradePartnerName = mBeing->getName();
+ player_node->trade(mBeing);
+ tradePartnerName = mBeing->getName();
}
// Attack action
else if (link == "attack" &&
- mBeing != NULL &&
- mBeing->getType() == Being::PLAYER)
+ mBeing != NULL &&
+ mBeing->getType() == Being::PLAYER)
{
- player_node->attack(mBeing, true);
+ player_node->attack(mBeing, true);
}
else if (link == "unignore" &&
- mBeing != NULL &&
- mBeing->getType() == Being::PLAYER)
+ mBeing != NULL &&
+ mBeing->getType() == Being::PLAYER)
{
- player_relations.setRelation(mBeing->getName(), PlayerRelation::NEUTRAL);
+ player_relations.setRelation(mBeing->getName(), PlayerRelation::NEUTRAL);
}
else if (link == "ignore" &&
- mBeing != NULL &&
- mBeing->getType() == Being::PLAYER)
+ mBeing != NULL &&
+ mBeing->getType() == Being::PLAYER)
{
- player_relations.setRelation(mBeing->getName(), PlayerRelation::IGNORED);
+ player_relations.setRelation(mBeing->getName(), PlayerRelation::IGNORED);
}
else if (link == "disregard" &&
- mBeing != NULL &&
- mBeing->getType() == Being::PLAYER)
+ mBeing != NULL &&
+ mBeing->getType() == Being::PLAYER)
{
- player_relations.setRelation(mBeing->getName(), PlayerRelation::DISREGARDED);
+ player_relations.setRelation(mBeing->getName(), PlayerRelation::DISREGARDED);
}
else if (link == "friend" &&
- mBeing != NULL &&
- mBeing->getType() == Being::PLAYER)
+ mBeing != NULL &&
+ mBeing->getType() == Being::PLAYER)
{
- player_relations.setRelation(mBeing->getName(), PlayerRelation::FRIEND);
+ player_relations.setRelation(mBeing->getName(), PlayerRelation::FRIEND);
}
/*
@@ -204,16 +211,16 @@ void PopupMenu::handleLink(const std::string& link)
// Add Buddy action
else if ((link == "buddy") && mBeing != NULL && mBeing->isPlayer())
{
- if (!buddyWindow->isVisible())
- buddyWindow->setVisible(true);
+ if (!buddyWindow->isVisible())
+ buddyWindow->setVisible(true);
- buddyWindow->addBuddy(mBeing->getName());
+ buddyWindow->addBuddy(mBeing->getName());
}*/
// Pick Up Floor Item action
else if ((link == "pickup") && mFloorItem != NULL)
{
- player_node->pickUp(mFloorItem);
+ player_node->pickUp(mFloorItem);
}
// Look To action
@@ -223,39 +230,47 @@ void PopupMenu::handleLink(const std::string& link)
else if (link == "use")
{
- assert(mItem);
- if (mItem->isEquipment())
- {
- if (mItem->isEquipped())
- {
- player_node->unequipItem(mItem);
- }
- else
- {
- player_node->equipItem(mItem);
- }
- }
- else
- {
- player_node->useItem(mItem);
- }
+ assert(mItem);
+ if (mItem->isEquipment())
+ {
+ if (mItem->isEquipped())
+ {
+ player_node->unequipItem(mItem);
+ }
+ else
+ {
+ player_node->equipItem(mItem);
+ }
+ }
+ else
+ {
+ player_node->useItem(mItem);
+ }
}
else if (link == "drop")
{
- new ItemAmountWindow(AMOUNT_ITEM_DROP, inventoryWindow, mItem);
+ new ItemAmountWindow(AMOUNT_ITEM_DROP, inventoryWindow, mItem);
}
else if (link == "description")
{
- // do nothing for now, I need to write
- // a window for the description first
+ // do nothing for now, I need to write
+ // a window for the description first
+ }
+ else if (link == "party-invite" &&
+ mBeing != NULL &&
+ mBeing->getType() == Being::PLAYER)
+ {
+ MessageOut outMsg(player_node->getNetwork());
+ outMsg.writeInt16(CMSG_PARTY_INVITE);
+ outMsg.writeInt32(mBeing->getId());
}
// Unknown actions
else
{
- std::cout << link << std::endl;
+ std::cout << link << std::endl;
}
setVisible(false);
@@ -273,13 +288,13 @@ void PopupMenu::showPopup(int x, int y, Item *item)
if (item->isEquipment())
{
- if (item->isEquipped())
- mBrowserBox->addRow("@@use|Unequip@@");
- else
- mBrowserBox->addRow("@@use|Equip@@");
+ if (item->isEquipped())
+ mBrowserBox->addRow("@@use|Unequip@@");
+ else
+ mBrowserBox->addRow("@@use|Equip@@");
}
else
- mBrowserBox->addRow("@@use|Use@@");
+ mBrowserBox->addRow("@@use|Use@@");
mBrowserBox->addRow("@@drop|Drop@@");
mBrowserBox->addRow("@@description|Description@@");
@@ -293,9 +308,9 @@ void PopupMenu::showPopup(int x, int y)
{
setContentSize(mBrowserBox->getWidth() + 8, mBrowserBox->getHeight() + 8);
if (windowContainer->getWidth() < (x + getWidth() + 5))
- x = windowContainer->getWidth() - getWidth();
+ x = windowContainer->getWidth() - getWidth();
if (windowContainer->getHeight() < (y + getHeight() + 5))
- y = windowContainer->getHeight() - getHeight();
+ y = windowContainer->getHeight() - getHeight();
setPosition(x, y);
setVisible(true);
requestMoveToTop();
diff --git a/src/gui/popupmenu.h b/src/gui/popupmenu.h
index 9fe9f866..601fa2ae 100644
--- a/src/gui/popupmenu.h
+++ b/src/gui/popupmenu.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: popupmenu.h 2239 2006-03-09 05:16:27Z der_doener $
*/
#ifndef _TMW_POPUP_MENU_H
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp
index 6d18b2f7..6dbc3b85 100644
--- a/src/gui/progressbar.cpp
+++ b/src/gui/progressbar.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: progressbar.cpp 4008 2008-03-27 14:51:10Z b_lindeijer $
*/
#include "progressbar.h"
diff --git a/src/gui/progressbar.h b/src/gui/progressbar.h
index 3e58f14e..ed8eace4 100644
--- a/src/gui/progressbar.h
+++ b/src/gui/progressbar.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: progressbar.h 2240 2006-03-09 12:24:36Z der_doener $
*/
#ifndef _TMW_PROGRESSBAR_H
diff --git a/src/gui/radiobutton.cpp b/src/gui/radiobutton.cpp
index 0ac4dea8..cbab4d2d 100644
--- a/src/gui/radiobutton.cpp
+++ b/src/gui/radiobutton.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: radiobutton.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include "radiobutton.h"
diff --git a/src/gui/radiobutton.h b/src/gui/radiobutton.h
index 4f868fdb..bab4a9dc 100644
--- a/src/gui/radiobutton.h
+++ b/src/gui/radiobutton.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: radiobutton.h 1584 2005-08-13 12:49:52Z der_doener $
*/
#ifndef _TMW_RADIOBUTTON_H
diff --git a/src/gui/register.cpp b/src/gui/register.cpp
index 9496da93..e0b663b8 100644
--- a/src/gui/register.cpp
+++ b/src/gui/register.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: register.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include "register.h"
@@ -41,6 +41,8 @@
#include "textfield.h"
#include "ok_dialog.h"
+#include "../utils/tostring.h"
+
void
WrongDataNoticeListener::setTarget(gcn::TextField *textField)
{
@@ -65,53 +67,65 @@ RegisterDialog::RegisterDialog(LoginData *loginData):
gcn::Label *passwordLabel = new gcn::Label("Password:");
gcn::Label *confirmLabel = new gcn::Label("Confirm:");
gcn::Label *serverLabel = new gcn::Label("Server:");
+ gcn::Label *portLabel = new gcn::Label("Port:");
+
mUserField = new TextField(loginData->username);
mPasswordField = new PasswordField(loginData->password);
mConfirmField = new PasswordField();
mServerField = new TextField(loginData->hostname);
+ mPortField = new TextField(toString(loginData->port));
mMaleButton = new RadioButton("Male", "sex", true);
mFemaleButton = new RadioButton("Female", "sex", false);
mRegisterButton = new Button("Register", "register", this);
mCancelButton = new Button("Cancel", "cancel", this);
- const int width = 220;
- const int height = 150;
- setContentSize(width, height);
-
- mUserField->setPosition(65, 5);
- mUserField->setWidth(width - 70);
- mPasswordField->setPosition(
- 65, mUserField->getY() + mUserField->getHeight() + 7);
- mPasswordField->setWidth(mUserField->getWidth());
- mConfirmField->setPosition(
- 65, mPasswordField->getY() + mPasswordField->getHeight() + 7);
- mConfirmField->setWidth(mUserField->getWidth());
- mServerField->setPosition(
- 65, 23 + mConfirmField->getY() + mConfirmField->getHeight() + 7);
- mServerField->setWidth(mUserField->getWidth());
-
- userLabel->setPosition(5, mUserField->getY() + 1);
- passwordLabel->setPosition(5, mPasswordField->getY() + 1);
- confirmLabel->setPosition(5, mConfirmField->getY() + 1);
- serverLabel->setPosition(5, mServerField->getY() + 1);
-
- mMaleButton->setPosition(
- 70, mConfirmField->getY() + mConfirmField->getHeight() + 7);
- mFemaleButton->setPosition(
- 70 + 10 + mMaleButton->getWidth(),
- mMaleButton->getY());
+ const int WIDTH = 220;
+ const int HEIGHT = 170;
+ const int FIELD_WIDTH = WIDTH - 70;
+
+ setContentSize(WIDTH, HEIGHT);
+
+ const int USER_TOP = 5;
+ userLabel->setPosition(5, USER_TOP);
+ mUserField->setPosition(65, USER_TOP);
+ mUserField->setWidth(FIELD_WIDTH);
+
+ const int PASS_TOP = 9 + USER_TOP + userLabel->getHeight();
+ passwordLabel->setPosition(5, PASS_TOP);
+ mPasswordField->setPosition(65, PASS_TOP);
+ mPasswordField->setWidth(FIELD_WIDTH);
+
+ const int CONFIRM_TOP = 9 + PASS_TOP + passwordLabel->getHeight();
+ confirmLabel->setPosition(5, CONFIRM_TOP);
+ mConfirmField->setPosition(65, CONFIRM_TOP);
+ mConfirmField->setWidth(FIELD_WIDTH);
+
+ const int SEX_TOP = 9 + CONFIRM_TOP + confirmLabel->getHeight();
+ mMaleButton->setPosition(70, SEX_TOP);
+ mFemaleButton->setPosition(80 + mMaleButton->getWidth(), SEX_TOP);
+
+ const int SERVER_TOP = 9 + SEX_TOP + mMaleButton->getHeight() + 5;
+ serverLabel->setPosition(5, SERVER_TOP);
+ mServerField->setPosition(65, SERVER_TOP);
+ mServerField->setWidth(FIELD_WIDTH);
+
+ const int PORT_TOP = 9 + SERVER_TOP + serverLabel->getHeight();
+ portLabel->setPosition(5, PORT_TOP);
+ mPortField->setPosition(65, PORT_TOP);
+ mPortField->setWidth(FIELD_WIDTH);
mCancelButton->setPosition(
- width - mCancelButton->getWidth() - 5,
- height - mCancelButton->getHeight() - 5);
+ WIDTH - mCancelButton->getWidth() - 5,
+ HEIGHT - mCancelButton->getHeight() - 5);
mRegisterButton->setPosition(
mCancelButton->getX() - mRegisterButton->getWidth() - 5,
- height - mRegisterButton->getHeight() - 5);
+ HEIGHT - mRegisterButton->getHeight() - 5);
mUserField->addKeyListener(this);
mPasswordField->addKeyListener(this);
mConfirmField->addKeyListener(this);
mServerField->addKeyListener(this);
+ mPortField->addKeyListener(this);
/* TODO:
* This is a quick and dirty way to respond to the ENTER key, regardless of
@@ -122,19 +136,26 @@ RegisterDialog::RegisterDialog(LoginData *loginData):
mPasswordField->setActionEventId("register");
mConfirmField->setActionEventId("register");
mServerField->setActionEventId("register");
+ mPortField->setActionEventId("register");
+
mUserField->addActionListener(this);
mPasswordField->addActionListener(this);
mConfirmField->addActionListener(this);
mServerField->addActionListener(this);
+ mPortField->addActionListener(this);
add(userLabel);
add(passwordLabel);
- add(serverLabel);
add(confirmLabel);
+ add(serverLabel);
+ add(portLabel);
+
add(mUserField);
add(mPasswordField);
add(mConfirmField);
add(mServerField);
+ add(mPortField);
+
add(mMaleButton);
add(mFemaleButton);
add(mRegisterButton);
@@ -232,7 +253,7 @@ RegisterDialog::action(const gcn::ActionEvent &event)
mRegisterButton->setEnabled(false);
mLoginData->hostname = mServerField->getText();
- mLoginData->port = (short) config.getValue("port", 0);
+ mLoginData->port = getUShort(mPortField->getText());
mLoginData->username = mUserField->getText();
mLoginData->password = mPasswordField->getText();
mLoginData->username += mFemaleButton->isSelected() ? "_F" : "_M";
@@ -256,5 +277,42 @@ RegisterDialog::canSubmit()
!mPasswordField->getText().empty() &&
!mConfirmField->getText().empty() &&
!mServerField->getText().empty() &&
+ isUShort(mPortField->getText()) &&
state == REGISTER_STATE;
}
+
+bool
+RegisterDialog::isUShort(const std::string &str)
+{
+ if (str == "")
+ {
+ return false;
+ }
+ unsigned long l = 0;
+ for (std::string::const_iterator strPtr = str.begin(), strEnd = str.end();
+ strPtr != strEnd; ++strPtr)
+ {
+ if (*strPtr < '0' || *strPtr > '9')
+ {
+ return false;
+ }
+ l = l * 10 + (*strPtr - '0'); // *strPtr - '0' will never be negative
+ if (l > 65535)
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+unsigned short
+RegisterDialog::getUShort(const std::string &str)
+{
+ unsigned long l = 0;
+ for (std::string::const_iterator strPtr = str.begin(), strEnd = str.end();
+ strPtr != strEnd; ++strPtr)
+ {
+ l = l * 10 + (*strPtr - '0');
+ }
+ return static_cast<unsigned short>(l);
+}
diff --git a/src/gui/register.h b/src/gui/register.h
index a80594af..6f997b75 100644
--- a/src/gui/register.h
+++ b/src/gui/register.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: register.h 3234 2007-03-24 13:05:27Z b_lindeijer $
*/
#ifndef _TMW_REGISTER_H
@@ -87,10 +87,31 @@ class RegisterDialog : public Window, public gcn::ActionListener,
bool
canSubmit();
+ /**
+ * Function to decide whether string is an unsigned short or not
+ *
+ * @param str the string to parse
+ *
+ * @return true if str is an unsigned short, false otherwise
+ */
+ static bool
+ isUShort(const std::string &str);
+
+ /**
+ * Converts string to an unsigned short (undefined if invalid)
+ *
+ * @param str the string to parse
+ *
+ * @return the value str represents
+ */
+ static unsigned short
+ getUShort(const std::string &str);
+
gcn::TextField *mUserField;
gcn::TextField *mPasswordField;
gcn::TextField *mConfirmField;
gcn::TextField *mServerField;
+ gcn::TextField *mPortField;
gcn::Button *mRegisterButton;
gcn::Button *mCancelButton;
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp
index 255aa2d8..a3aef702 100644
--- a/src/gui/scrollarea.cpp
+++ b/src/gui/scrollarea.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: scrollarea.cpp 4204 2008-04-28 18:29:04Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/gui/scrollarea.h b/src/gui/scrollarea.h
index be361f68..b3fa17f3 100644
--- a/src/gui/scrollarea.h
+++ b/src/gui/scrollarea.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: scrollarea.h 4204 2008-04-28 18:29:04Z b_lindeijer $
*/
#ifndef __TMW_SCROLLAREA_H__
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp
index 82d340fb..5f64fcea 100644
--- a/src/gui/sell.cpp
+++ b/src/gui/sell.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: sell.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "sell.h"
diff --git a/src/gui/sell.h b/src/gui/sell.h
index 0c1a2007..11528f89 100644
--- a/src/gui/sell.h
+++ b/src/gui/sell.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: sell.h 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#ifndef _TMW_SELL_H
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index c895d166..ce843452 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setup.cpp 4306 2008-05-28 20:22:37Z crush_tmw $
*/
#include <algorithm>
diff --git a/src/gui/setup.h b/src/gui/setup.h
index 543cab2c..d4f0857b 100644
--- a/src/gui/setup.h
+++ b/src/gui/setup.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setup.h 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
#ifndef _TMW_SETUP_H
diff --git a/src/gui/setup_audio.cpp b/src/gui/setup_audio.cpp
index 4227b5ca..09357cce 100644
--- a/src/gui/setup_audio.cpp
+++ b/src/gui/setup_audio.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setup_audio.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include "setup_audio.h"
diff --git a/src/gui/setup_audio.h b/src/gui/setup_audio.h
index 6e722f74..76420101 100644
--- a/src/gui/setup_audio.h
+++ b/src/gui/setup_audio.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setup_audio.h 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#ifndef _TMW_GUI_SETUP_AUDIO_H
diff --git a/src/gui/setup_joystick.cpp b/src/gui/setup_joystick.cpp
index a501298e..41e91595 100644
--- a/src/gui/setup_joystick.cpp
+++ b/src/gui/setup_joystick.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setup_joystick.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include "setup_joystick.h"
diff --git a/src/gui/setup_joystick.h b/src/gui/setup_joystick.h
index 6d3ad129..399156d8 100644
--- a/src/gui/setup_joystick.h
+++ b/src/gui/setup_joystick.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setup_joystick.h 3035 2007-01-14 14:54:39Z b_lindeijer $
*/
#ifndef _TMW_GUI_SETUP_JOYSTICK_H
diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp
index e88080b5..704fc691 100644
--- a/src/gui/setup_keyboard.cpp
+++ b/src/gui/setup_keyboard.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setup_keyboard.cpp 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#include "setup_keyboard.h"
diff --git a/src/gui/setup_keyboard.h b/src/gui/setup_keyboard.h
index b72e8746..7f945181 100644
--- a/src/gui/setup_keyboard.h
+++ b/src/gui/setup_keyboard.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setup_keyboard.h 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#ifndef _TMW_GUI_SETUP_KEYBOARD_H
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp
index 24b559da..809364ea 100644
--- a/src/gui/setup_players.cpp
+++ b/src/gui/setup_players.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setup_players.cpp 4353 2008-06-16 07:04:46Z b_lindeijer $
*/
#include "setup_players.h"
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 97e4cdd6..bc38f1f9 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setup_video.cpp 4338 2008-06-05 18:41:39Z crush_tmw $
*/
#include "setup_video.h"
diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h
index a0701a3c..0d7ea700 100644
--- a/src/gui/setup_video.h
+++ b/src/gui/setup_video.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setup_video.h 4306 2008-05-28 20:22:37Z crush_tmw $
*/
#ifndef _TMW_GUI_SETUP_VIDEO_H
diff --git a/src/gui/setuptab.h b/src/gui/setuptab.h
index a7d45b9a..bbfe4fac 100644
--- a/src/gui/setuptab.h
+++ b/src/gui/setuptab.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: setuptab.h 2273 2006-03-19 00:48:10Z der_doener $
*/
#ifndef _TMW_GUI_SETUPTAB_H
diff --git a/src/gui/shop.cpp b/src/gui/shop.cpp
index 62d18769..015e70d5 100644
--- a/src/gui/shop.cpp
+++ b/src/gui/shop.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: shop.cpp 4348 2008-06-14 12:42:49Z the_enemy $
*/
#include "shop.h"
diff --git a/src/gui/shop.h b/src/gui/shop.h
index 22e715c9..78276610 100644
--- a/src/gui/shop.h
+++ b/src/gui/shop.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: shop.h 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#ifndef _SHOP_H
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp
index 3ab40c9a..e70fb3ef 100644
--- a/src/gui/skill.cpp
+++ b/src/gui/skill.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: skill.cpp 3754 2007-11-20 15:19:50Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/gui/skill.h b/src/gui/skill.h
index 6879640c..6bd6c51b 100644
--- a/src/gui/skill.h
+++ b/src/gui/skill.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: skill.h 3494 2007-08-20 05:29:12Z joshlangley $
*/
#ifndef _TMW_SKILL_H
diff --git a/src/gui/slider.cpp b/src/gui/slider.cpp
index c94c7bfb..a1ae6acc 100644
--- a/src/gui/slider.cpp
+++ b/src/gui/slider.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: slider.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include "slider.h"
diff --git a/src/gui/slider.h b/src/gui/slider.h
index dc38b738..524d8799 100644
--- a/src/gui/slider.h
+++ b/src/gui/slider.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: slider.h 1584 2005-08-13 12:49:52Z der_doener $
*/
#ifndef _TMW_SLIDER_H
diff --git a/src/gui/status.cpp b/src/gui/status.cpp
index 927b3554..cba815b5 100644
--- a/src/gui/status.cpp
+++ b/src/gui/status.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: status.cpp 3510 2007-08-23 14:14:51Z b_lindeijer $
*/
#include "status.h"
diff --git a/src/gui/status.h b/src/gui/status.h
index 10773e10..4d082148 100644
--- a/src/gui/status.h
+++ b/src/gui/status.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: status.h 3538 2007-08-28 00:01:38Z b_lindeijer $
*/
#ifndef _TMW_STATUS_H
diff --git a/src/gui/tabbedcontainer.cpp b/src/gui/tabbedcontainer.cpp
index d6267e65..71e0f3c4 100644
--- a/src/gui/tabbedcontainer.cpp
+++ b/src/gui/tabbedcontainer.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: tabbedcontainer.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/gui/tabbedcontainer.h b/src/gui/tabbedcontainer.h
index 7f8deef9..14f27aba 100644
--- a/src/gui/tabbedcontainer.h
+++ b/src/gui/tabbedcontainer.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: tabbedcontainer.h 3152 2007-02-27 16:31:34Z crush_tmw $
*/
#ifndef _TMW_TABPANE_H
diff --git a/src/gui/textbox.cpp b/src/gui/textbox.cpp
index 8d16dc46..743d88b6 100644
--- a/src/gui/textbox.cpp
+++ b/src/gui/textbox.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: textbox.cpp 4096 2008-04-16 08:39:59Z b_lindeijer $
*/
#include "textbox.h"
diff --git a/src/gui/textbox.h b/src/gui/textbox.h
index f06f98ec..7df30fd9 100644
--- a/src/gui/textbox.h
+++ b/src/gui/textbox.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: textbox.h 4096 2008-04-16 08:39:59Z b_lindeijer $
*/
#ifndef __TMW_TEXTBOX_H__
diff --git a/src/gui/textfield.cpp b/src/gui/textfield.cpp
index 8db720cf..95291267 100644
--- a/src/gui/textfield.cpp
+++ b/src/gui/textfield.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: textfield.cpp 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/gui/textfield.h b/src/gui/textfield.h
index bc47d501..39bcbf85 100644
--- a/src/gui/textfield.h
+++ b/src/gui/textfield.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: textfield.h 4045 2008-04-07 15:23:07Z b_lindeijer $
*/
#ifndef __TMW_TEXTFIELD_H__
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp
index 42b6e9bc..d8f23171 100644
--- a/src/gui/updatewindow.cpp
+++ b/src/gui/updatewindow.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: updatewindow.cpp 4332 2008-06-05 07:33:12Z b_lindeijer $
*/
#include "updatewindow.h"
diff --git a/src/gui/updatewindow.h b/src/gui/updatewindow.h
index 61ea4a27..b669f829 100644
--- a/src/gui/updatewindow.h
+++ b/src/gui/updatewindow.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: updatewindow.h 4332 2008-06-05 07:33:12Z b_lindeijer $
*/
#ifndef _UPDATERWINDOW_H
diff --git a/src/gui/vbox.cpp b/src/gui/vbox.cpp
index b503508e..6f36dc9c 100644
--- a/src/gui/vbox.cpp
+++ b/src/gui/vbox.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: vbox.cpp 3587 2007-09-20 13:24:20Z b_lindeijer $
*/
#include "vbox.h"
diff --git a/src/gui/vbox.h b/src/gui/vbox.h
index 06a270ef..ff52717b 100644
--- a/src/gui/vbox.h
+++ b/src/gui/vbox.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: vbox.h 1881 2005-10-18 21:40:25Z der_doener $
*/
#ifndef VBOX_H
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 01324a47..e7fdb522 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: viewport.cpp 4098 2008-04-16 11:36:41Z b_lindeijer $
*/
#include "viewport.h"
@@ -37,6 +37,7 @@
#include "../map.h"
#include "../monster.h"
#include "../npc.h"
+#include "../textmanager.h"
#include "../resources/animation.h"
#include "../resources/monsterinfo.h"
@@ -228,7 +229,6 @@ Viewport::draw(gcn::Graphics *gcnGraphics)
mMap->draw(graphics, (int) mPixelViewX, (int) mPixelViewY, 2);
mMap->drawOverlay(graphics, mPixelViewX, mPixelViewY,
(int) config.getValue("OverlayDetail", 2));
- drawTargetName(graphics);
}
// Find a path from the player to the mouse, and draw it. This is for debug
@@ -259,12 +259,16 @@ Viewport::draw(gcn::Graphics *gcnGraphics)
}
}
+ // Draw text
+ if (textManager)
+ {
+ textManager->draw(graphics, mPixelViewX, mPixelViewY);
+ }
+
// Draw player nickname, speech, and emotion sprite as needed
Beings &beings = beingManager->getAll();
for (BeingIterator i = beings.begin(); i != beings.end(); i++)
{
- (*i)->drawSpeech(graphics, -(int) mPixelViewX, -(int) mPixelViewY);
- (*i)->drawName(graphics, -(int) mPixelViewX, -(int) mPixelViewY);
(*i)->drawEmotion(graphics, -(int) mPixelViewX, -(int) mPixelViewY);
}
@@ -332,24 +336,6 @@ Viewport::drawTargetCursor(Graphics *graphics)
}
void
-Viewport::drawTargetName(Graphics *graphics)
-{
- // Draw target marker if needed
- Being *target = player_node->getTarget();
- if (target && target->getType() == Being::MONSTER)
- {
- graphics->setFont(speechFont);
- graphics->setColor(gcn::Color(255, 32, 32));
-
- const MonsterInfo &mi = static_cast<Monster*>(target)->getInfo();
- int posX = target->getPixelX() + 16 - (int)mPixelViewX;
- int posY = target->getPixelY() + 16 - target->getHeight() - (int)mPixelViewY;
-
- graphics->drawText(mi.getName(), posX, posY, gcn::Graphics::CENTER);
- }
-}
-
-void
Viewport::mousePressed(gcn::MouseEvent &event)
{
// Check if we are alive and kickin'
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index 8d3fbd3c..44a877a6 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: viewport.h 4247 2008-05-19 10:48:18Z b_lindeijer $
*/
#ifndef _TMW_VIEWPORT_H_
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
new file mode 100644
index 00000000..b33a55cf
--- /dev/null
+++ b/src/gui/widgets/dropdown.cpp
@@ -0,0 +1,169 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ * $Id$
+ */
+
+#include <algorithm>
+
+#include "dropdown.h"
+
+#include "../../graphics.h"
+
+#include "../../resources/image.h"
+#include "../../resources/resourcemanager.h"
+
+#include "../../utils/dtor.h"
+
+int DropDown::instances = 0;
+Image *DropDown::buttons[2][2];
+ImageRect DropDown::skin;
+
+DropDown::DropDown(gcn::ListModel *listModel,
+ gcn::ScrollArea *scrollArea,
+ gcn::ListBox *listBox):
+ gcn::DropDown::DropDown(listModel,
+ scrollArea, listBox)
+{
+ setFrameSize(2);
+
+ // Initialize graphics
+ if (instances == 0)
+ {
+ // Load the background skin
+ ResourceManager *resman = ResourceManager::getInstance();
+
+ // Get the button skin
+ buttons[1][0] =
+ resman->getImage("graphics/gui/vscroll_up_default.png");
+ buttons[0][0] =
+ resman->getImage("graphics/gui/vscroll_down_default.png");
+ buttons[1][1] =
+ resman->getImage("graphics/gui/vscroll_up_pressed.png");
+ buttons[0][1] =
+ resman->getImage("graphics/gui/vscroll_down_pressed.png");
+
+ // get the border skin
+ Image *boxBorder = resman->getImage("graphics/gui/deepbox.png");
+ int gridx[4] = {0, 3, 28, 31};
+ int gridy[4] = {0, 3, 28, 31};
+ int a = 0, x, y;
+
+ for (y = 0; y < 3; y++) {
+ for (x = 0; x < 3; x++) {
+ skin.grid[a] = boxBorder->getSubImage(
+ gridx[x], gridy[y],
+ gridx[x + 1] - gridx[x] + 1,
+ gridy[y + 1] - gridy[y] + 1);
+ a++;
+ }
+ }
+
+ boxBorder->decRef();
+ }
+
+ instances++;
+}
+
+DropDown::~DropDown()
+{
+ instances--;
+ // Free images memory
+ if (instances == 0)
+ {
+ buttons[0][0]->decRef();
+ buttons[0][1]->decRef();
+ buttons[1][0]->decRef();
+ buttons[1][1]->decRef();
+
+ for_each(skin.grid, skin.grid + 9, dtor<Image*>());
+ }
+}
+
+void DropDown::draw(gcn::Graphics* graphics)
+{
+ int h;
+
+ if (mDroppedDown)
+ {
+ h = mFoldedUpHeight;
+ }
+ else
+ {
+ h = getHeight();
+ }
+
+ int alpha = getBaseColor().a;
+ gcn::Color faceColor = getBaseColor();
+ faceColor.a = alpha;
+ gcn::Color highlightColor = faceColor + 0x303030;
+ highlightColor.a = alpha;
+ gcn::Color shadowColor = faceColor - 0x303030;
+ shadowColor.a = alpha;
+
+
+ graphics->setColor(getBackgroundColor());
+ graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), h));
+
+ graphics->setColor(getForegroundColor());
+ graphics->setFont(getFont());
+
+ if (mListBox->getListModel() && mListBox->getSelected() >= 0)
+ {
+ graphics->drawText(mListBox->getListModel()->getElementAt(mListBox->getSelected()), 1, 0);
+ }
+
+ if (isFocused())
+ {
+ graphics->setColor(highlightColor);
+ graphics->drawRectangle(gcn::Rectangle(0, 0, getWidth() - h, h));
+ }
+
+ drawButton(graphics);
+
+ if (mDroppedDown)
+ {
+ drawChildren(graphics);
+
+ // Draw two lines separating the ListBox with se selected
+ // element view.
+ graphics->setColor(highlightColor);
+ graphics->drawLine(0, h, getWidth(), h);
+ graphics->setColor(shadowColor);
+ graphics->drawLine(0, h + 1, getWidth(), h + 1);
+ }
+}
+
+void DropDown::drawFrame(gcn::Graphics *graphics)
+{
+ const int bs = getFrameSize();
+ const int w = getWidth() + bs * 2;
+ const int h = getHeight() + bs * 2;
+
+ static_cast<Graphics*>(graphics)->drawImageRect(0, 0, w, h, skin);
+}
+
+void DropDown::drawButton(gcn::Graphics *graphics)
+{
+ int height = mDroppedDown ? mFoldedUpHeight : getHeight();
+
+ static_cast<Graphics*>(graphics)->
+ drawImage(buttons[mDroppedDown][mPushed], getWidth() - height, 1);
+}
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
new file mode 100644
index 00000000..d0dab7d2
--- /dev/null
+++ b/src/gui/widgets/dropdown.h
@@ -0,0 +1,85 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ * $Id$
+ */
+
+#ifndef DROPDOWN_H
+#define DROPDOWN_H
+
+#include <iosfwd>
+
+#include <guichan/widgets/dropdown.hpp>
+#include "../scrollarea.h"
+#include "../listbox.h"
+
+class Image;
+class ImageRect;
+
+ /**
+ * A drop down box from which you can select different values. It is one of
+ * the most complicated Widgets you will find in Guichan. For drawing the
+ * DroppedDown box it uses one ScrollArea and one ListBox. It also uses an
+ * internal FocusHandler to handle the focus of the internal ScollArea and
+ * ListBox. DropDown uses a ListModel to handle the list. To be able to use
+ * DropDown you must give DropDown an implemented ListModel which represents
+ * your list.
+ */
+class DropDown : public gcn::DropDown
+{
+ public:
+ /**
+ * Contructor.
+ *
+ * @param listModel the ListModel to use.
+ * @param scrollArea the ScrollArea to use.
+ * @param listBox the listBox to use.
+ * @see ListModel, ScrollArea, ListBox.
+ */
+ DropDown(gcn::ListModel *listModel = NULL,
+ gcn::ScrollArea *scrollArea = NULL,
+ gcn::ListBox *listBox = NULL);
+
+ /**
+ * Destructor.
+ */
+ ~DropDown();
+
+ void draw(gcn::Graphics* graphics);
+
+ void drawFrame(gcn::Graphics* graphics);
+
+
+ protected:
+ /**
+ * Draws the button with the little down arrow.
+ *
+ * @param graphics a Graphics object to draw with.
+ */
+ void drawButton(gcn::Graphics *graphics);
+
+ // Add own Images.
+ static int instances;
+ static Image *buttons[2][2];
+ static ImageRect skin;
+};
+
+#endif // end DROPDOWN_H
+
diff --git a/src/gui/widgets/resizegrip.cpp b/src/gui/widgets/resizegrip.cpp
index 6be50f2c..e13493bb 100644
--- a/src/gui/widgets/resizegrip.cpp
+++ b/src/gui/widgets/resizegrip.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: resizegrip.cpp 3587 2007-09-20 13:24:20Z b_lindeijer $
*/
#include "resizegrip.h"
diff --git a/src/gui/widgets/resizegrip.h b/src/gui/widgets/resizegrip.h
index 04be3db3..dab720dd 100644
--- a/src/gui/widgets/resizegrip.h
+++ b/src/gui/widgets/resizegrip.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: resizegrip.h 3270 2007-04-15 01:22:17Z b_lindeijer $
*/
#ifndef _TMW_RESIZEGRIP_H
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 4ce167cd..4f94b3fb 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: window.cpp 4207 2008-04-29 09:10:43Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/gui/window.h b/src/gui/window.h
index f88e5c01..8f288991 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: window.h 4207 2008-04-29 09:10:43Z b_lindeijer $
*/
#ifndef _TMW_WINDOW_H__
diff --git a/src/gui/windowcontainer.cpp b/src/gui/windowcontainer.cpp
index d10c519c..0a0a0a55 100644
--- a/src/gui/windowcontainer.cpp
+++ b/src/gui/windowcontainer.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: windowcontainer.cpp 3754 2007-11-20 15:19:50Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/gui/windowcontainer.h b/src/gui/windowcontainer.h
index df255f84..294c855b 100644
--- a/src/gui/windowcontainer.h
+++ b/src/gui/windowcontainer.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: windowcontainer.h 2884 2006-12-04 11:20:54Z b_lindeijer $
*/
#ifndef _TMW_WINDOWCONTAINER_H_
diff --git a/src/guichanfwd.h b/src/guichanfwd.h
index 812f3f7a..0a2560bf 100644
--- a/src/guichanfwd.h
+++ b/src/guichanfwd.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: guichanfwd.h 2907 2006-12-12 15:33:46Z b_lindeijer $
*/
#ifndef _TMW_GUICHANFWD_H
diff --git a/src/imageparticle.cpp b/src/imageparticle.cpp
index 965434b0..d4ff8f02 100644
--- a/src/imageparticle.cpp
+++ b/src/imageparticle.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: imageparticle.cpp 4360 2008-06-23 14:44:20Z crush_tmw $
*/
#include "imageparticle.h"
diff --git a/src/imageparticle.h b/src/imageparticle.h
index 0ad515cc..ef663473 100644
--- a/src/imageparticle.h
+++ b/src/imageparticle.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: imageparticle.h 3567 2007-09-07 09:13:17Z b_lindeijer $
*/
#ifndef _IMAGEPARTICLE_H
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 470b6c85..e6f006de 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: inventory.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "inventory.h"
diff --git a/src/inventory.h b/src/inventory.h
index 0d2bbc5a..2e0dd792 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: inventory.h 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#ifndef _INVENTORY_H
diff --git a/src/item.cpp b/src/item.cpp
index e84a06df..2e33a9de 100644
--- a/src/item.cpp
+++ b/src/item.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: item.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "item.h"
diff --git a/src/item.h b/src/item.h
index 9e1c5ec8..449b388c 100644
--- a/src/item.h
+++ b/src/item.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: item.h 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#ifndef _ITEM_H_
diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp
index a32e50e0..5379f0eb 100644
--- a/src/itemshortcut.cpp
+++ b/src/itemshortcut.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemshortcut.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "itemshortcut.h"
diff --git a/src/itemshortcut.h b/src/itemshortcut.h
index d75db2e8..bbf21332 100644
--- a/src/itemshortcut.h
+++ b/src/itemshortcut.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemshortcut.h 4180 2008-04-24 20:49:30Z peaveydk $
*/
#ifndef _TMW_ITEMSHORTCUT_H__
diff --git a/src/joystick.cpp b/src/joystick.cpp
index a5dab4f4..ebae5c3a 100644
--- a/src/joystick.cpp
+++ b/src/joystick.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: joystick.cpp 2595 2006-08-26 20:19:39Z b_lindeijer $
*/
#include "joystick.h"
diff --git a/src/joystick.h b/src/joystick.h
index 321e3e7d..5c6f7c86 100644
--- a/src/joystick.h
+++ b/src/joystick.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: joystick.h 3587 2007-09-20 13:24:20Z b_lindeijer $
*/
#ifndef _TMW_JOYSTICK_H
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp
index a959e244..5534b96e 100644
--- a/src/keyboardconfig.cpp
+++ b/src/keyboardconfig.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: keyboardconfig.cpp 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#include "keyboardconfig.h"
diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h
index 53a5c96d..b98fcb7a 100644
--- a/src/keyboardconfig.h
+++ b/src/keyboardconfig.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: keyboardconfig.h 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#ifndef _TMW_KEYBOARDCONFIG_H
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 3929da8b..5f392a52 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: localplayer.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "localplayer.h"
@@ -31,6 +31,7 @@
#include "main.h"
#include "particle.h"
#include "sound.h"
+#include "monster.h"
#include "gui/gui.h"
@@ -226,6 +227,23 @@ void LocalPlayer::walk(unsigned char dir)
}
}
+void LocalPlayer::setTarget(Being *target)
+{
+ if (target == mTarget)
+ {
+ return;
+ }
+ if (mTarget && mTarget->getType() == Being::MONSTER)
+ {
+ static_cast<Monster *>(mTarget)->showName(false);
+ }
+ mTarget = target;
+ if (target && target->getType() == Being::MONSTER)
+ {
+ static_cast<Monster *>(target)->showName(true);
+ }
+}
+
void LocalPlayer::setDestination(Uint16 x, Uint16 y)
{
// Only send a new message to the server when destination changes
@@ -363,9 +381,13 @@ void LocalPlayer::attack(Being *target, bool keep)
return;
if (keep && target)
- mTarget = target;
+ {
+ setTarget(target);
+ }
else if (mTarget)
+ {
target = mTarget;
+ }
if (!target)
return;
@@ -411,7 +433,7 @@ void LocalPlayer::attack(Being *target, bool keep)
void LocalPlayer::stopAttack()
{
- mTarget = NULL;
+ setTarget(NULL);
}
Being* LocalPlayer::getTarget() const
@@ -454,7 +476,7 @@ bool LocalPlayer::withinAttackRange(Being *target)
void LocalPlayer::setGotoTarget(Being *target)
{
- mTarget = target;
+ setTarget(target);
mGoingToTarget = true;
setDestination(target->mX, target->mY);
}
diff --git a/src/localplayer.h b/src/localplayer.h
index 5ce94081..64e6c5ad 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: localplayer.h 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#ifndef _TMW_LOCALPLAYER_H
@@ -54,8 +54,9 @@ class LocalPlayer : public Player
*/
~LocalPlayer();
+ void setName(const std::string &name) {Being::setName(name); }
void setNetwork(Network *network) { mNetwork = network; }
-
+ Network *getNetwork() {return mNetwork; }
virtual void logic();
/**
@@ -65,12 +66,6 @@ class LocalPlayer : public Player
virtual void nextStep();
/**
- * Draws the name text below the being.
- */
- virtual void
- drawName(Graphics *graphics, Sint32 offsetX, Sint32 offsetY) {};
-
- /**
* Returns the player's inventory.
*/
Inventory* getInventory() const { return mInventory; }
@@ -140,7 +135,7 @@ class LocalPlayer : public Player
/**
* Sets the target being of the player.
*/
- void setTarget(Being* target) { mTarget = target; }
+ void setTarget(Being* target);
/**
* Sets a new destination for this being to walk to.
diff --git a/src/lockedarray.h b/src/lockedarray.h
index 7ec2f9da..bbb72520 100644
--- a/src/lockedarray.h
+++ b/src/lockedarray.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: lockedarray.h 2277 2006-03-19 21:40:21Z der_doener $
*/
#ifndef _TMW_LOCKEDARRAY_H
diff --git a/src/logindata.h b/src/logindata.h
index 8513428f..d2fe3043 100644
--- a/src/logindata.h
+++ b/src/logindata.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: logindata.h 3606 2007-09-27 14:54:09Z b_lindeijer $
*/
#ifndef _TMW_LOGINDATA_H
@@ -31,6 +31,7 @@ struct LoginData
std::string username;
std::string password;
std::string hostname;
+ std::string updateHost;
short port;
int account_ID;
diff --git a/src/main.cpp b/src/main.cpp
index 7a854123..2b8a3882 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: main.cpp 4332 2008-06-05 07:33:12Z b_lindeijer $
*/
#include "main.h"
@@ -57,6 +57,7 @@
#ifdef USE_OPENGL
#include "openglgraphics.h"
#endif
+#include "serverinfo.h"
#include "sound.h"
#include "gui/char_server.h"
@@ -151,22 +152,64 @@ struct Options
};
/**
+ * Parse the update host and determine the updates directory
+ * Then verify that the directory exists (creating if needed).
+ */
+void setUpdatesDir()
+{
+ // If updatesHost is currently empty, fill it from config file
+ if (updateHost.empty()) {
+ updateHost =
+ config.getValue("updatehost", "http://updates.thanaworld.org");
+ }
+
+ // Parse out any "http://" or "ftp://", and set the updates directory
+ size_t pos;
+ pos = updateHost.find("://");
+ if (pos != updateHost.npos) {
+ if (pos + 3 < updateHost.length()) {
+ updatesDir =
+ "updates/" + updateHost.substr(pos + 3);
+ } else {
+ logger->log("Error: Invalid update host: %s", updateHost.c_str());
+ errorMessage = "Invalid update host: " + updateHost;
+ state = ERROR_STATE;
+ }
+ } else {
+ logger->log("Warning: no protocol was specified for the update host");
+ updatesDir = "updates/" + updateHost;
+ }
+
+ ResourceManager *resman = ResourceManager::getInstance();
+
+ // Verify that the updates directory exists. Create if necessary.
+ if (!resman->isDirectory("/" + updatesDir)) {
+ if (resman->mkdir("/" + updatesDir)) {
+ logger->log("Error: %s/%s can't be made, but doesn't exist!",
+ homeDir.c_str(), updatesDir.c_str());
+ errorMessage = "Error creating updates directory!";
+ state = ERROR_STATE;
+ }
+ }
+}
+
+/**
* Do all initialization stuff
*/
void init_engine(const Options &options)
{
- homeDir = std::string(PHYSFS_getUserDir()) + "/.tmw";
+ homeDir = std::string(PHYSFS_getUserDir()) + "/.tme";
#if defined WIN32
if (!CreateDirectory(homeDir.c_str(), 0) &&
GetLastError() != ERROR_ALREADY_EXISTS)
#elif defined __APPLE__
- // Use Application Directory instead of .tmw
- homeDir = std::string(PHYSFS_getUserDir()) +
+ // Use Application Directory instead of .tme
+ homeDir = std::string(PHYSFS_getUserDir()) +
"/Library/Application Support/The Mana World";
if ((mkdir(homeDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) &&
(errno != EEXIST))
#else
- // Checking if /home/user/.tmw folder exists.
+ // Checking if /home/user/.tme folder exists.
if ((mkdir(homeDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) &&
(errno != EEXIST))
#endif
@@ -230,7 +273,7 @@ void init_engine(const Options &options)
// Fill configuration with defaults
logger->log("Initializing configuration...");
- config.setValue("host", "server.themanaworld.org");
+ config.setValue("host", "216.139.126.36");
config.setValue("port", 6901);
config.setValue("hwaccel", 0);
#if (defined __APPLE__ || defined WIN32) && defined USE_OPENGL
@@ -245,7 +288,7 @@ void init_engine(const Options &options)
config.setValue("sfxVolume", 100);
config.setValue("musicVolume", 60);
config.setValue("fpslimit", 60);
- config.setValue("updatehost", "http://updates.themanaworld.org");
+ config.setValue("updatehost", "http://216.139.126.36/updates");
config.setValue("customcursor", 1);
config.setValue("ChatLogLength", 128);
@@ -272,45 +315,7 @@ void init_engine(const Options &options)
config.init(configPath);
}
-
- // Take host for updates from config if it wasn't set on the command line
- if (options.updateHost.empty()) {
- updateHost =
- config.getValue("updatehost", "http://updates.thanaworld.org");
- } else {
- updateHost = options.updateHost;
- }
-
- // Parse out any "http://" or "ftp://", and set the updates directory
- size_t pos;
- pos = updateHost.find("//");
- if (pos != updateHost.npos) {
- if (pos + 2 < updateHost.length()) {
- updatesDir =
- "updates/" + updateHost.substr(pos + 2);
- } else {
- std::cout << "The updates host - " << updateHost
- << " does not appear to be valid!" << std::endl
- << "Please fix the \"updatehost\" in your configuration"
- << " file. Exiting." << std::endl;
- exit(1);
- }
- } else {
- logger->log("Warning: no protocol was specified for the update host");
- updatesDir = "updates/" + updateHost;
- }
-
- // Verify that the updates directory exists. Create if necessary.
- if (!resman->isDirectory("/" + updatesDir)) {
- if (!resman->mkdir("/" + updatesDir)) {
- std::cout << homeDir << "/" << updatesDir
- << " can't be made, but it doesn't exist! Exiting."
- << std::endl;
- exit(1);
- }
- }
-
- SDL_WM_SetCaption("The Mana World", NULL);
+ SDL_WM_SetCaption("The Mana Experiment", NULL);
#ifdef WIN32
static SDL_SysWMinfo pInfo;
SDL_GetWMInfo(&pInfo);
@@ -363,7 +368,7 @@ void init_engine(const Options &options)
itemShortcut = new ItemShortcut();
gui = new Gui(graphics);
- state = UPDATE_STATE; /**< Initial game state */
+ state = LOGIN_STATE; /**< Initial game state */
// Initialize sound engine
try {
@@ -424,7 +429,8 @@ void printHelp()
<< " -u --skipupdate : Skip the update process" << std::endl
<< " -U --username : Login with this username" << std::endl
<< " -P --password : Login with this password" << std::endl
- << " -D --default : Bypass the login process with default settings" << std::endl
+ << " -D --default : Bypass the login process with default "
+ "settings" << std::endl
<< " -p --playername : Login with this player" << std::endl
<< " -C --configfile : Configuration file to use" << std::endl
<< " -H --updatehost : Use this update host" << std::endl;
@@ -541,7 +547,13 @@ void accountLogin(Network *network, LoginData *loginData)
outMsg.writeInt32(0); // client version
outMsg.writeString(loginData->username, 24);
outMsg.writeString(loginData->password, 24);
- outMsg.writeInt8(0); // unknown
+
+ /*
+ * eAthena calls the last byte "client version 2", but it isn't
+ * used at all. We're retasking it, with bit 0 to indicate whether
+ * the client can handle the 0x63 "update host" packet
+ */
+ outMsg.writeInt8(0x01);
// Clear the password, avoids auto login when returning to login
loginData->password = "";
@@ -648,13 +660,6 @@ int main(int argc, char *argv[])
SDL_Event event;
- if (options.skipUpdate && state != ERROR_STATE) {
- state = LOADDATA_STATE;
- }
- else {
- state = UPDATE_STATE;
- }
-
unsigned int oldstate = !state; // We start with a status change.
Game *game = NULL;
@@ -684,7 +689,7 @@ int main(int argc, char *argv[])
if (!options.password.empty()) {
loginData.password = options.password;
}
- loginData.hostname = config.getValue("host", "server.themanaworld.org");
+ loginData.hostname = config.getValue("host", "216.139.126.36");
loginData.port = (short)config.getValue("port", 0);
loginData.remember = config.getValue("remember", 0);
loginData.registerLogin = false;
@@ -751,11 +756,15 @@ int main(int argc, char *argv[])
switch (oldstate)
{
case UPDATE_STATE:
- loadUpdates();
- // Reload the wallpaper in case that it was updated
- login_wallpaper->decRef();
- login_wallpaper = ResourceManager::getInstance()->
- getImage("graphics/images/login_wallpaper.png");
+ if (options.skipUpdate) {
+ state = LOADDATA_STATE;
+ } else {
+ loadUpdates();
+ // Reload the wallpaper in case that it was updated
+ login_wallpaper->decRef();
+ login_wallpaper = ResourceManager::getInstance()->
+ getImage("graphics/images/login_wallpaper.png");
+ }
break;
// Those states don't cause a network disconnect
@@ -797,7 +806,7 @@ int main(int argc, char *argv[])
ItemDB::load();
MonsterDB::load();
NPCDB::load();
- state = LOGIN_STATE;
+ state = CHAR_CONNECT_STATE;
break;
case LOGIN_STATE:
@@ -818,13 +827,20 @@ int main(int argc, char *argv[])
case CHAR_SERVER_STATE:
logger->log("State: CHAR_SERVER");
- currentDialog = new ServerSelectDialog(&loginData);
- if (options.chooseDefault || options.playername != "") {
- ((ServerSelectDialog*) currentDialog)->action(
- gcn::ActionEvent(NULL, "ok"));
+ if (n_server == 1) {
+ SERVER_INFO *si = *server_info;
+ loginData.hostname = iptostring(si->address);
+ loginData.port = si->port;
+ loginData.updateHost = si->updateHost;
+ state = UPDATE_STATE;
+ } else {
+ currentDialog = new ServerSelectDialog(&loginData);
+ if (options.chooseDefault || options.playername != "") {
+ ((ServerSelectDialog*) currentDialog)->action(
+ gcn::ActionEvent(NULL, "ok"));
+ }
}
break;
-
case CHAR_SELECT_STATE:
logger->log("State: CHAR_SELECT");
currentDialog = new CharSelectDialog(network, &charInfo,
@@ -865,6 +881,13 @@ int main(int argc, char *argv[])
break;
case UPDATE_STATE:
+ // Determine which source to use for the update host
+ if(!options.updateHost.empty())
+ updateHost = options.updateHost;
+ else
+ updateHost = loginData.updateHost;
+
+ setUpdatesDir();
logger->log("State: UPDATE");
currentDialog = new UpdaterWindow(updateHost,
homeDir + "/" + updatesDir);
diff --git a/src/main.h b/src/main.h
index c18a2ddd..af59ea26 100644
--- a/src/main.h
+++ b/src/main.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: main.h 3628 2007-10-18 18:39:48Z b_lindeijer $
*/
#ifndef _TMW_MAIN_H
diff --git a/src/map.cpp b/src/map.cpp
index c65b0cd6..d9d3a319 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: map.cpp 4171 2008-04-22 18:42:21Z b_lindeijer $
*/
#include "map.h"
diff --git a/src/map.h b/src/map.h
index fab7bfb7..7695ba31 100644
--- a/src/map.h
+++ b/src/map.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: map.h 3887 2008-02-12 19:49:37Z umperio $
*/
#ifndef _TMW_MAP_H_
diff --git a/src/monster.cpp b/src/monster.cpp
index e2a07e86..1a7f6c4e 100644
--- a/src/monster.cpp
+++ b/src/monster.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: monster.cpp 3823 2007-12-28 18:36:58Z crush_tmw $
*/
#include "monster.h"
@@ -27,14 +27,21 @@
#include "game.h"
#include "sound.h"
#include "particle.h"
+#include "text.h"
+#include "localplayer.h"
+
+#include "gui/gui.h"
#include "resources/monsterdb.h"
#include "utils/tostring.h"
+static const int NAME_X_OFFSET = 16;
+static const int NAME_Y_OFFSET = 16;
Monster::Monster(Uint32 id, Uint16 job, Map *map):
- Being(id, job, map)
+ Being(id, job, map),
+ mText(0)
{
const MonsterInfo& info = MonsterDB::get(job - 1002);
@@ -59,6 +66,14 @@ Monster::Monster(Uint32 id, Uint16 job, Map *map):
}
}
+Monster::~Monster()
+{
+ if (mText)
+ {
+ player_node->setTarget(0);
+ }
+}
+
void
Monster::logic()
{
@@ -141,3 +156,31 @@ Monster::getInfo() const
{
return MonsterDB::get(mJob - 1002);
}
+
+void Monster::showName(bool show)
+{
+ if (mText)
+ {
+ delete mText;
+ }
+ if (show)
+ {
+ mText = new Text(getInfo().getName(), mPx + NAME_X_OFFSET,
+ mPy + NAME_Y_OFFSET - getHeight(),
+ gcn::Graphics::CENTER,
+ speechFont, gcn::Color(255, 32, 32));
+ }
+ else
+ {
+ mText = 0;
+ }
+}
+
+void Monster::updateCoords()
+{
+ if (mText)
+ {
+ mText->adviseXY(mPx + NAME_X_OFFSET,
+ mPy + NAME_Y_OFFSET - getHeight());
+ }
+}
diff --git a/src/monster.h b/src/monster.h
index 39556b44..b613e96d 100644
--- a/src/monster.h
+++ b/src/monster.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: monster.h 3690 2007-10-26 12:50:49Z crush_tmw $
*/
#ifndef _TMW_MONSTER_H
@@ -27,12 +27,15 @@
#include "being.h"
class MonsterInfo;
+class Text;
class Monster : public Being
{
public:
Monster(Uint32 id, Uint16 job, Map *map);
+ ~Monster();
+
virtual void logic();
virtual void setAction(Uint8 action);
@@ -63,6 +66,19 @@ class Monster : public Being
*/
const MonsterInfo&
getInfo() const;
+
+ /**
+ * Determine whether the mob should show it's name
+ */
+ void showName(bool show);
+
+ protected:
+ /**
+ * Update the text when the monster moves
+ */
+ void updateCoords();
+ private:
+ Text *mText; /**< holds a text object when the mod displays it's name, 0 otherwise */
};
#endif
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index be8412d9..e077ab14 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: beinghandler.cpp 4321 2008-06-02 11:42:26Z b_lindeijer $
*/
#include "beinghandler.h"
@@ -55,6 +55,8 @@ BeingHandler::BeingHandler()
SMSG_PLAYER_UPDATE_1,
SMSG_PLAYER_UPDATE_2,
SMSG_PLAYER_MOVE,
+ SMSG_PLAYER_STOP,
+ SMSG_PLAYER_MOVE_TO_ATTACK,
0x0119,
0
};
@@ -122,7 +124,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
headTop = msg->readInt16();
headMid = msg->readInt16();
hairColor = msg->readInt16();
- msg->readInt16(); // clothes color -not used
+ msg->readInt16(); // clothes color -not used
msg->readInt16(); // head dir
msg->readInt16(); // guild
msg->readInt16(); // unknown
@@ -133,9 +135,9 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->setGender(1 - msg->readInt8()); // gender
// Set these after the gender, as the sprites may be gender-specific
- dstBeing->setSprite(Being::BOTTOMCLOTHES_SPRITE, headBottom);
- dstBeing->setSprite(Being::TOPCLOTHES_SPRITE, headMid);
- dstBeing->setSprite(Being::HAT_SPRITE, headTop);
+ dstBeing->setSprite(Being::BOTTOMCLOTHES_SPRITE, headBottom);
+ dstBeing->setSprite(Being::TOPCLOTHES_SPRITE, headMid);
+ dstBeing->setSprite(Being::HAT_SPRITE, headTop);
dstBeing->setHairStyle(hairStyle, hairColor);
if (msg->getId() == SMSG_BEING_MOVE)
@@ -257,7 +259,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
case SMSG_BEING_CHANGE_LOOKS2:
{
/*
- * SMSG_BEING_CHANGE_LOOKS (0x00c3) and
+ * SMSG_BEING_CHANGE_LOOKS (0x00c3) and
* SMSG_BEING_CHANGE_LOOKS2 (0x01d7) do basically the same
* thing. The difference is that ...LOOKS carries a single
* 8 bit value, where ...LOOKS2 carries two 16 bit values.
@@ -288,7 +290,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
case 1: // eAthena LOOK_HAIR
dstBeing->setHairStyle(id, -1);
break;
- case 2: // Weapon ID in id, Shield ID in id2
+ case 2: // Weapon ID in id, Shield ID in id2
dstBeing->setSprite(Being::WEAPON_SPRITE, id);
dstBeing->setSprite(Being::SHIELD_SPRITE, id2);
break;
@@ -304,6 +306,9 @@ void BeingHandler::handleMessage(MessageIn *msg)
case 6: // eAthena LOOK_HAIR_COLOR
dstBeing->setHairStyle(-1, id);
break;
+ case 8: // eAthena LOOK_SHIELD
+ dstBeing->setSprite(Being::SHIELD_SPRITE, id);
+ break;
case 9: // eAthena LOOK_SHOES
dstBeing->setSprite(Being::SHOE_SPRITE, id);
break;
@@ -345,7 +350,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
hairStyle = msg->readInt16();
dstBeing->setSprite(Being::WEAPON_SPRITE, msg->readInt16());
dstBeing->setSprite(Being::SHIELD_SPRITE, msg->readInt16());
- headBottom = msg->readInt16();
+ headBottom = msg->readInt16();
if (msg->getId() == SMSG_PLAYER_MOVE)
{
@@ -355,7 +360,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
headTop = msg->readInt16();
headMid = msg->readInt16();
hairColor = msg->readInt16();
- msg->readInt16(); // clothes color - not used
+ msg->readInt16(); // clothes color - not used
msg->readInt16(); // head dir
msg->readInt32(); // guild
msg->readInt32(); // emblem
@@ -364,7 +369,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->setGender(1 - msg->readInt8()); // gender
// Set these after the gender, as the sprites may be gender-specific
- dstBeing->setSprite(Being::BOTTOMCLOTHES_SPRITE, headBottom);
+ dstBeing->setSprite(Being::BOTTOMCLOTHES_SPRITE, headBottom);
dstBeing->setSprite(Being::TOPCLOTHES_SPRITE, headMid);
dstBeing->setSprite(Being::HAT_SPRITE, headTop);
dstBeing->setHairStyle(hairStyle, hairColor);
@@ -406,6 +411,32 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->mFrame = 0;
break;
+ case SMSG_PLAYER_STOP:
+ // Instruction from server to stop walking at x, y.
+ id = msg->readInt32();
+ dstBeing = beingManager->findBeing(id);
+
+ if (dstBeing) {
+ dstBeing->mX = msg->readInt16();
+ dstBeing->mY = msg->readInt16();
+ if (dstBeing->mAction == Being::WALK) {
+ dstBeing->mFrame = 0;
+ dstBeing->setAction(Being::STAND);
+ }
+ } else {
+ logger->log("0x0088: Non-existent being %d", id);
+ }
+ break;
+
+ case SMSG_PLAYER_MOVE_TO_ATTACK:
+ /*
+ * This is an *advisory* message, telling the client that
+ * it needs to move the character before attacking
+ * a target (out of range, obstruction in line of fire).
+ * We can safely ignore this...
+ */
+ break;
+
case 0x0119:
// Change in players look
logger->log("0x0119 %i %i %i %x %i", msg->readInt32(),
diff --git a/src/net/beinghandler.h b/src/net/beinghandler.h
index 03012f39..5429d962 100644
--- a/src/net/beinghandler.h
+++ b/src/net/beinghandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: beinghandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_BEINGHANDLER_H
diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp
index 26261664..b4e2cf30 100644
--- a/src/net/buysellhandler.cpp
+++ b/src/net/buysellhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: buysellhandler.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "buysellhandler.h"
diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h
index 673aaac1..4da52c95 100644
--- a/src/net/buysellhandler.h
+++ b/src/net/buysellhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: buysellhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_BUYSELLHANDLER_H
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp
index 5cc53f7d..91f098ba 100644
--- a/src/net/charserverhandler.cpp
+++ b/src/net/charserverhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: charserverhandler.cpp 4330 2008-06-04 08:53:01Z b_lindeijer $
*/
#include "charserverhandler.h"
diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h
index ab4ca1c7..663de94d 100644
--- a/src/net/charserverhandler.h
+++ b/src/net/charserverhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: charserverhandler.h 3228 2007-03-22 23:53:13Z b_lindeijer $
*/
#ifndef _TMW_NET_CHARSERVERHANDLER_H
diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp
index 524911d3..bee19112 100644
--- a/src/net/chathandler.cpp
+++ b/src/net/chathandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: chathandler.cpp 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
#include "chathandler.h"
diff --git a/src/net/chathandler.h b/src/net/chathandler.h
index eed19206..08a560f3 100644
--- a/src/net/chathandler.h
+++ b/src/net/chathandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: chathandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_CHATHANDLER_H
diff --git a/src/net/equipmenthandler.cpp b/src/net/equipmenthandler.cpp
index 85790b42..7b15ee8b 100644
--- a/src/net/equipmenthandler.cpp
+++ b/src/net/equipmenthandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: equipmenthandler.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "equipmenthandler.h"
diff --git a/src/net/equipmenthandler.h b/src/net/equipmenthandler.h
index 656f7a73..0121e6ad 100644
--- a/src/net/equipmenthandler.h
+++ b/src/net/equipmenthandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: equipmenthandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_EQUIPMENTHANDLER_H
diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp
index 48cf18ff..c0661710 100644
--- a/src/net/inventoryhandler.cpp
+++ b/src/net/inventoryhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: inventoryhandler.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "inventoryhandler.h"
diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h
index aedbc3a1..64ef8464 100644
--- a/src/net/inventoryhandler.h
+++ b/src/net/inventoryhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: inventoryhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_INVENTORYHANDLER_H
diff --git a/src/net/itemhandler.cpp b/src/net/itemhandler.cpp
index 567a5382..9af2be10 100644
--- a/src/net/itemhandler.cpp
+++ b/src/net/itemhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemhandler.cpp 2150 2006-02-06 02:56:48Z der_doener $
*/
#include "itemhandler.h"
diff --git a/src/net/itemhandler.h b/src/net/itemhandler.h
index b2104722..702e193a 100644
--- a/src/net/itemhandler.h
+++ b/src/net/itemhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_ITEMHANDLER_H
diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp
index ab788e41..6505e39f 100644
--- a/src/net/loginhandler.cpp
+++ b/src/net/loginhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: loginhandler.cpp 3233 2007-03-24 01:57:39Z b_lindeijer $
*/
#include "loginhandler.h"
@@ -37,6 +37,7 @@ extern SERVER_INFO **server_info;
LoginHandler::LoginHandler()
{
static const Uint16 _messages[] = {
+ 0x0063,
0x0069,
0x006a,
0
@@ -48,6 +49,16 @@ void LoginHandler::handleMessage(MessageIn *msg)
{
switch (msg->getId())
{
+ case 0x0063:
+ int len;
+
+ len = msg->readInt16() - 4;
+ mUpdateHost = msg->readString(len);
+
+ logger->log("Received update host \"%s\" from login server",
+ mUpdateHost.c_str());
+ break;
+
case 0x0069:
// Skip the length word
msg->skip(2);
@@ -70,6 +81,7 @@ void LoginHandler::handleMessage(MessageIn *msg)
server_info[i]->port = msg->readInt16();
server_info[i]->name = msg->readString(20);
server_info[i]->online_users = msg->readInt32();
+ server_info[i]->updateHost = mUpdateHost;
msg->skip(2); // unknown
logger->log("Network: Server: %s (%s:%d)",
@@ -77,7 +89,7 @@ void LoginHandler::handleMessage(MessageIn *msg)
iptostring(server_info[i]->address),
server_info[i]->port);
}
- state = CHAR_SERVER_STATE;
+ state = CHAR_SERVER_STATE;
break;
case 0x006a:
diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h
index 52014559..797655c3 100644
--- a/src/net/loginhandler.h
+++ b/src/net/loginhandler.h
@@ -18,13 +18,14 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: loginhandler.h 2137 2006-02-04 16:54:35Z der_doener $
*/
#ifndef _TMW_NET_LOGINHANDLER_H
#define _TMW_NET_LOGINHANDLER_H
#include "messagehandler.h"
+#include <string>
struct LoginData;
@@ -39,6 +40,9 @@ class LoginHandler : public MessageHandler
protected:
LoginData *mLoginData;
+
+ private:
+ std::string mUpdateHost;
};
#endif
diff --git a/src/net/maploginhandler.cpp b/src/net/maploginhandler.cpp
index 0afc8357..15f70baf 100644
--- a/src/net/maploginhandler.cpp
+++ b/src/net/maploginhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: maploginhandler.cpp 2239 2006-03-09 05:16:27Z der_doener $
*/
#include "maploginhandler.h"
diff --git a/src/net/maploginhandler.h b/src/net/maploginhandler.h
index fe597549..6ff6bc00 100644
--- a/src/net/maploginhandler.h
+++ b/src/net/maploginhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: maploginhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_MAPLOGINHANDLER_H
diff --git a/src/net/messagehandler.cpp b/src/net/messagehandler.cpp
index 849b6716..370a01ab 100644
--- a/src/net/messagehandler.cpp
+++ b/src/net/messagehandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messagehandler.cpp 2112 2006-01-22 13:31:13Z der_doener $
*/
#include "messagehandler.h"
diff --git a/src/net/messagehandler.h b/src/net/messagehandler.h
index c09037f6..90ffa489 100644
--- a/src/net/messagehandler.h
+++ b/src/net/messagehandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messagehandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_MESSAGEHANDLER_H
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index bbc0a44c..bec47a5a 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messagein.cpp 2369 2006-06-26 21:32:52Z b_lindeijer $
*/
#include "messagein.h"
diff --git a/src/net/messagein.h b/src/net/messagein.h
index d97cd8b6..0a6b8b8b 100644
--- a/src/net/messagein.h
+++ b/src/net/messagein.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messagein.h 1879 2005-10-16 21:18:11Z der_doener $
*/
#ifndef _TMW_MESSAGEIN_
diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp
index 9c87e69e..f5f3dad9 100644
--- a/src/net/messageout.cpp
+++ b/src/net/messageout.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messageout.cpp 3754 2007-11-20 15:19:50Z b_lindeijer $
*/
#include <cstring>
diff --git a/src/net/messageout.h b/src/net/messageout.h
index f6468adb..33deb1bb 100644
--- a/src/net/messageout.h
+++ b/src/net/messageout.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: messageout.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_MESSAGEOUT_
diff --git a/src/net/network.cpp b/src/net/network.cpp
index fa5964d6..4db0df54 100644
--- a/src/net/network.cpp
+++ b/src/net/network.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: network.cpp 3550 2007-08-30 16:46:21Z b_lindeijer $
*/
#include "network.h"
@@ -41,7 +41,7 @@ short packet_lengths[] = {
// #0x0040
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 55, 17, 3, 37, 46, -1, 23, -1, 3,108, 3, 2,
+ 0, 0, 0, -1, 55, 17, 3, 37, 46, -1, 23, -1, 3,108, 3, 2,
3, 28, 19, 11, 3, -1, 9, 5, 54, 53, 58, 60, 41, 2, 6, 6,
// #0x0080
7, 3, 2, 2, 2, 5, 16, 12, 10, 7, 29, 23, -1, -1, -1, 0,
diff --git a/src/net/network.h b/src/net/network.h
index d6fec761..53800b1e 100644
--- a/src/net/network.h
+++ b/src/net/network.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: network.h 3234 2007-03-24 13:05:27Z b_lindeijer $
*/
#ifndef _TMW_NETWORK_
diff --git a/src/net/npchandler.cpp b/src/net/npchandler.cpp
index da21b2a5..29855fc0 100644
--- a/src/net/npchandler.cpp
+++ b/src/net/npchandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npchandler.cpp 2883 2006-12-03 17:00:07Z b_lindeijer $
*/
#include "npchandler.h"
diff --git a/src/net/npchandler.h b/src/net/npchandler.h
index 903ecd10..7abd7495 100644
--- a/src/net/npchandler.h
+++ b/src/net/npchandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npchandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_NPCHANDLER_H
diff --git a/src/net/partyhandler.cpp b/src/net/partyhandler.cpp
new file mode 100644
index 00000000..c1f2ba2e
--- /dev/null
+++ b/src/net/partyhandler.cpp
@@ -0,0 +1,127 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ * $Id: partyhandler.cpp
+ */
+
+#include "partyhandler.h"
+
+#include "protocol.h"
+#include "messagein.h"
+
+#include "../gui/chat.h"
+#include "../gui/confirm_dialog.h"
+
+#include "../game.h"
+#include "../party.h"
+#include "../beingmanager.h"
+
+#include <guichan/actionlistener.hpp>
+
+PartyHandler::PartyHandler(Party *party) : mParty(party)
+{
+ static const Uint16 _messages[] = {
+ SMSG_PARTY_CREATE,
+ SMSG_PARTY_INFO,
+ SMSG_PARTY_INVITE,
+ SMSG_PARTY_INVITED,
+ SMSG_PARTY_SETTINGS,
+ SMSG_PARTY_MEMBER_INFO,
+ SMSG_PARTY_LEAVE,
+ SMSG_PARTY_UPDATE_HP,
+ SMSG_PARTY_UPDATE_COORDS,
+ SMSG_PARTY_MESSAGE,
+ 0
+ };
+ handledMessages = _messages;
+}
+
+void
+PartyHandler::handleMessage(MessageIn *msg)
+{
+ switch (msg->getId())
+ {
+ case SMSG_PARTY_CREATE:
+ mParty->createResponse(msg->readInt8());
+ break;
+ case SMSG_PARTY_INFO:
+ break;
+ case SMSG_PARTY_INVITE:
+ {
+ std::string nick = msg->readString(24);
+ int status = msg->readInt8();
+ mParty->inviteResponse(nick, status);
+ break;
+ }
+ case SMSG_PARTY_INVITED:
+ {
+ int id = msg->readInt32();
+ Being *being = beingManager->findBeing(id);
+ if (being == NULL)
+ {
+ break;
+ }
+ std::string nick;
+ int gender = 0;
+ std::string partyName = "";
+ if (being->getType() != Being::PLAYER)
+ {
+ nick = "";
+ }
+ else
+ {
+ nick = being->getName();
+ gender = being->getGender();
+ partyName = msg->readString(24);
+ }
+ mParty->invitedAsk(nick, gender, partyName);
+ break;
+ }
+ case SMSG_PARTY_SETTINGS:
+ break;
+ case SMSG_PARTY_MEMBER_INFO:
+ break;
+ case SMSG_PARTY_LEAVE:
+ {
+ /*int id = */msg->readInt32();
+ std::string nick = msg->readString(24);
+ /*int fail = */msg->readInt8();
+ mParty->leftResponse(nick);
+ break;
+ }
+ case SMSG_PARTY_UPDATE_HP:
+ break;
+ case SMSG_PARTY_UPDATE_COORDS:
+ break;
+ case SMSG_PARTY_MESSAGE:
+ { // new block to enable local variables
+ int msgLength = msg->readInt16() - 8;
+ if (msgLength <= 0)
+ {
+ return;
+ }
+ int id = msg->readInt32();
+ Being *being = beingManager->findBeing(id);
+ std::string chatMsg = msg->readString(msgLength);
+ mParty->receiveChat(being, chatMsg);
+ }
+ break;
+ }
+}
diff --git a/src/gui/buddywindow.h b/src/net/partyhandler.h
index a3ca4de2..de97d084 100644
--- a/src/gui/buddywindow.h
+++ b/src/net/partyhandler.h
@@ -18,41 +18,24 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: partyhandler.h
*/
-#ifndef _TMW_BUDDYWINDOW_H
-#define _TMW_BUDDYWINDOW_H
+#ifndef _TMW_NET_PARTYHANDLER_H
+#define _TMW_NET_PARTYHANDLER_H
-#include <guichan/actionlistener.hpp>
+#include "messagehandler.h"
-#include "window.h"
+class Party;
-#include "../guichanfwd.h"
-
-class BuddyList;
-
-/**
- * Window showing buddy list.
- *
- * \ingroup Interface
- */
-class BuddyWindow : public Window, public gcn::ActionListener
+class PartyHandler : public MessageHandler
{
public:
- /**
- * Constructor.
- */
- BuddyWindow();
-
- /**
- * Performs action.
- */
- void action(const gcn::ActionEvent &event);
+ PartyHandler(Party *party);
+ void handleMessage(MessageIn *msg);
private:
- BuddyList *mBuddyList;
- gcn::ListBox *mListbox;
+ Party *mParty;
};
-#endif /* _TMW_BUDDYWINDOW_H */
+#endif
diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp
index 2502c144..7f9e455a 100644
--- a/src/net/playerhandler.cpp
+++ b/src/net/playerhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: playerhandler.cpp 4190 2008-04-26 17:37:03Z peaveydk $
*/
#include "playerhandler.h"
@@ -109,10 +109,16 @@ void PlayerHandler::handleMessage(MessageIn *msg)
switch (msg->getId())
{
case SMSG_WALK_RESPONSE:
- // It is assumed by the client any request to walk actually
- // succeeds on the server. The plan is to have a correction
- // message when the server senses the client has the wrong
- // idea.
+ /*
+ * This client assumes that all walk messages succeed,
+ * and that the server will send a correction notice
+ * otherwise.
+ *
+ * Note that this packet is also used by eAthena to notify
+ * the client of a server-generated auto-move. A patch has
+ * been submitted to Mantis to eliminate these auto moves,
+ * since they're inconsistent with the client design.
+ */
break;
case SMSG_PLAYER_WARP:
@@ -345,18 +351,5 @@ void PlayerHandler::handleMessage(MessageIn *msg)
}
}
break;
-
- //Stop walking
- //case 0x0088: // Disabled because giving some problems
- //if (being = beingManager->findBeing(readInt32(2))) {
- // if (being->getId() != player_node->getId()) {
- // being->action = STAND;
- // being->mFrame = 0;
- // set_coordinates(being->coordinates,
- // readWord(6), readWord(8),
- // get_direction(being->coordinates));
- // }
- //}
- //break;
}
}
diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h
index b28a23f5..f7c0672d 100644
--- a/src/net/playerhandler.h
+++ b/src/net/playerhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: playerhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_PLAYERHANDLER_H
diff --git a/src/net/protocol.cpp b/src/net/protocol.cpp
index d3db50bf..791b7fe5 100644
--- a/src/net/protocol.cpp
+++ b/src/net/protocol.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: protocol.cpp 2158 2006-02-07 10:37:54Z der_doener $
*/
#include "protocol.h"
diff --git a/src/net/protocol.h b/src/net/protocol.h
index 811d5481..f90fcba3 100644
--- a/src/net/protocol.h
+++ b/src/net/protocol.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: protocol.h 4321 2008-06-02 11:42:26Z b_lindeijer $
*/
#ifndef _TMW_PROTOCOL_
@@ -29,6 +29,8 @@
#define SMSG_PLAYER_UPDATE_1 0x01d8
#define SMSG_PLAYER_UPDATE_2 0x01d9
#define SMSG_PLAYER_MOVE 0x01da /**< A nearby player moves */
+#define SMSG_PLAYER_STOP 0x0088 /**< Stop walking, set position */
+#define SMSG_PLAYER_MOVE_TO_ATTACK 0x0139 /**< Move to within attack range */
#define SMSG_PLAYER_STAT_UPDATE_1 0x00b0
#define SMSG_PLAYER_STAT_UPDATE_2 0x00b1
#define SMSG_PLAYER_STAT_UPDATE_3 0x0141
@@ -63,6 +65,7 @@
#define SMSG_BEING_ACTION 0x008a /**< Attack, sit, stand up, ... */
#define SMSG_BEING_CHAT 0x008d /**< A being talks */
#define SMSG_BEING_NAME_RESPONSE 0x0095 /**< Has to be requested */
+
#define SMSG_NPC_MESSAGE 0x00b4
#define SMSG_NPC_NEXT 0x00b5
#define SMSG_NPC_CLOSE 0x00b6
@@ -72,11 +75,13 @@
#define SMSG_NPC_SELL 0x00c7
#define SMSG_NPC_BUY_RESPONSE 0x00ca
#define SMSG_NPC_SELL_RESPONSE 0x00cb
+
#define SMSG_PLAYER_CHAT 0x008e /**< Player talks */
#define SMSG_WHISPER 0x0097 /**< Whisper Recieved */
#define SMSG_WHISPER_RESPONSE 0x0098
#define SMSG_GM_CHAT 0x009a /**< GM announce */
#define SMSG_WALK_RESPONSE 0x0087
+
#define SMSG_TRADE_REQUEST 0x00e5 /**< Receiving a request to trade */
#define SMSG_TRADE_RESPONSE 0x00e7
#define SMSG_TRADE_ITEM_ADD 0x00e9
@@ -85,6 +90,17 @@
#define SMSG_TRADE_CANCEL 0x00ee
#define SMSG_TRADE_COMPLETE 0x00f0
+#define SMSG_PARTY_CREATE 0x00fa
+#define SMSG_PARTY_INFO 0x00fb
+#define SMSG_PARTY_INVITE 0x00fd
+#define SMSG_PARTY_INVITED 0x00fe
+#define SMSG_PARTY_SETTINGS 0x0102
+#define SMSG_PARTY_MEMBER_INFO 0x0104
+#define SMSG_PARTY_LEAVE 0x0105
+#define SMSG_PARTY_UPDATE_HP 0x0106
+#define SMSG_PARTY_UPDATE_COORDS 0x0107
+#define SMSG_PARTY_MESSAGE 0x0109
+
// Packets from client to server
#define CMSG_TRADE_RESPONSE 0x00e6
#define CMSG_ITEM_PICKUP 0x009f
@@ -93,6 +109,8 @@
#define CMSG_NPC_BUY_SELL_REQUEST 0x00c5
#define CMSG_CHAT_MESSAGE 0x008c
#define CMSG_CHAT_WHISPER 0x0096
+#define CMSG_CHAT_ANNOUNCE 0x0099
+#define CMSG_CHAT_WHO 0x00c1
#define CMSG_NPC_LIST_CHOICE 0x00b8
#define CMSG_NPC_NEXT_REQUEST 0x00b9
#define CMSG_NPC_SELL_REQUEST 0x00c9
@@ -109,6 +127,13 @@
#define CMSG_PLAYER_EQUIP 0x00a9
#define CMSG_PLAYER_UNEQUIP 0x00ab
+#define CMSG_PARTY_CREATE 0x00f9
+#define CMSG_PARTY_INVITE 0x00fc
+#define CMSG_PARTY_INVITED 0x00ff
+#define CMSG_PARTY_LEAVE 0x0100 /** Undocumented */
+#define CMSG_PARTY_SETTINGS 0x0101
+#define CMSG_PARTY_MESSAGE 0x0108
+
/** Encodes coords and direction in 3 bytes data */
void set_coordinates(char *data, unsigned short x, unsigned short y, unsigned char direction);
diff --git a/src/net/skillhandler.cpp b/src/net/skillhandler.cpp
index 828c2378..1f9403f4 100644
--- a/src/net/skillhandler.cpp
+++ b/src/net/skillhandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: skillhandler.cpp 2832 2006-11-05 20:57:59Z b_lindeijer $
*/
#include "skillhandler.h"
diff --git a/src/net/skillhandler.h b/src/net/skillhandler.h
index 820a7b6a..734772b4 100644
--- a/src/net/skillhandler.h
+++ b/src/net/skillhandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: skillhandler.h 2112 2006-01-22 13:31:13Z der_doener $
*/
#ifndef _TMW_NET_SKILLHANDLER_H
diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp
index 9599fa9d..cfd24977 100644
--- a/src/net/tradehandler.cpp
+++ b/src/net/tradehandler.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: tradehandler.cpp 4354 2008-06-17 16:52:44Z the_enemy $
*/
#include "tradehandler.h"
diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h
index a1971004..22e01f48 100644
--- a/src/net/tradehandler.h
+++ b/src/net/tradehandler.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: tradehandler.h 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
#ifndef _TMW_NET_TRADEHANDLER_H
diff --git a/src/npc.cpp b/src/npc.cpp
index 2177aedc..ec7088ab 100644
--- a/src/npc.cpp
+++ b/src/npc.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npc.cpp 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#include "npc.h"
@@ -26,6 +26,7 @@
#include "animatedsprite.h"
#include "graphics.h"
#include "particle.h"
+#include "text.h"
#include "net/messageout.h"
#include "net/protocol.h"
@@ -35,6 +36,9 @@
NPC *current_npc = 0;
+static const int NAME_X_OFFSET = 15;
+static const int NAME_Y_OFFSET = 30;
+
NPC::NPC(Uint32 id, Uint16 job, Map *map, Network *network):
Being(id, job, map), mNetwork(network)
{
@@ -62,23 +66,32 @@ NPC::NPC(Uint32 id, Uint16 job, Map *map, Network *network):
Particle *p = particleEngine->addEffect(*i, 0, 0);
this->controlParticle(p);
}
+ mName = 0;
}
-Being::Type
-NPC::getType() const
+NPC::~NPC()
{
- return Being::NPC;
+ if (mName)
+ {
+ delete mName;
+ }
}
-void
-NPC::drawName(Graphics *graphics, Sint32 offsetX, Sint32 offsetY)
+void NPC::setName(const std::string &name)
{
- int px = mPx + offsetX;
- int py = mPy + offsetY;
+ if (mName)
+ {
+ delete mName;
+ }
+ mName = new Text(name, mPx + NAME_X_OFFSET, mPy + NAME_Y_OFFSET,
+ gcn::Graphics::CENTER, speechFont,
+ gcn::Color(200, 200, 255));
+ }
- graphics->setFont(speechFont);
- graphics->setColor(gcn::Color(200, 200, 255));
- graphics->drawText(mName, px + 15, py + 30, gcn::Graphics::CENTER);
+Being::Type
+NPC::getType() const
+{
+ return Being::NPC;
}
void
@@ -129,3 +142,11 @@ NPC::sell()
outMsg.writeInt32(mId);
outMsg.writeInt8(1);
}
+
+void NPC::updateCoords()
+{
+ if (mName)
+ {
+ mName->adviseXY(mPx + NAME_X_OFFSET, mPy + NAME_Y_OFFSET);
+ }
+}
diff --git a/src/npc.h b/src/npc.h
index 0d9966bd..432d26d1 100644
--- a/src/npc.h
+++ b/src/npc.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npc.h 2883 2006-12-03 17:00:07Z b_lindeijer $
*/
#ifndef _TMW_NPC_H
@@ -28,18 +28,20 @@
class Network;
class Graphics;
+class Text;
class NPC : public Being
{
public:
NPC(Uint32 id, Uint16 job, Map *map, Network *network);
+ ~NPC();
+
+ void setName(const std::string &name);
+
virtual Type
getType() const;
- virtual void
- drawName(Graphics *graphics, Sint32 offsetX, Sint32 offsetY);
-
void talk();
void nextDialog();
void dialogChoice(char choice);
@@ -49,6 +51,9 @@ class NPC : public Being
protected:
Network *mNetwork;
+ void updateCoords();
+ private:
+ Text *mName;
};
extern NPC *current_npc;
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 5b34de18..6ffc5668 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: openglgraphics.cpp 4130 2008-04-18 20:39:29Z the_enemy $
*/
#include "main.h"
diff --git a/src/openglgraphics.h b/src/openglgraphics.h
index ee5bc1e1..c3dc794c 100644
--- a/src/openglgraphics.h
+++ b/src/openglgraphics.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: openglgraphics.h 3628 2007-10-18 18:39:48Z b_lindeijer $
*/
#ifndef _TMW_OPENGLGRAPHICS_H
diff --git a/src/particle.cpp b/src/particle.cpp
index 3b3f5116..651fae41 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: particle.cpp 4362 2008-06-24 12:29:33Z crush_tmw $
*/
#include <algorithm>
diff --git a/src/particle.h b/src/particle.h
index 88a38417..d4a671c7 100644
--- a/src/particle.h
+++ b/src/particle.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: particle.h 4362 2008-06-24 12:29:33Z crush_tmw $
*/
#ifndef _PARTICLE_H
diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp
index 631ca228..996e3396 100644
--- a/src/particleemitter.cpp
+++ b/src/particleemitter.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: particleemitter.cpp 4362 2008-06-24 12:29:33Z crush_tmw $
*/
#include "particleemitter.h"
diff --git a/src/particleemitter.h b/src/particleemitter.h
index 2f45608d..481d4b44 100644
--- a/src/particleemitter.h
+++ b/src/particleemitter.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: particleemitter.h 4362 2008-06-24 12:29:33Z crush_tmw $
*/
#ifndef _PARTICLEEMITTER_H
diff --git a/src/party.cpp b/src/party.cpp
new file mode 100644
index 00000000..39c39352
--- /dev/null
+++ b/src/party.cpp
@@ -0,0 +1,219 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ * $Id: party.cpp
+ */
+
+#include "party.h"
+
+#include "beingmanager.h"
+#include "localplayer.h"
+#include "game.h"
+
+#include "gui/chat.h"
+#include "gui/confirm_dialog.h"
+
+#include "net/messageout.h"
+#include "net/protocol.h"
+
+Party::Party(ChatWindow *chat, Network *network) :
+ mChat(chat), mNetwork(network), mInviteListener(network, &mInParty)
+{
+}
+
+void Party::respond(const std::string &command, const std::string &args)
+{
+ if (command == "new" || command == "create")
+ {
+ create(args);
+ return;
+ }
+ if (command == "leave")
+ {
+ leave(args);
+ return;
+ }
+ if (command == "settings")
+ {
+ mChat->chatLog("Not yet implemented!", BY_SERVER);
+ return;
+ /*
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(CMSG_PARTY_SETTINGS);
+ outMsg.writeInt16(0); // Experience
+ outMsg.writeInt16(0); // Item
+ */
+ }
+ mChat->chatLog("Party command not known.", BY_SERVER);
+}
+
+void Party::create(const std::string &party)
+{
+ if (party == "")
+ {
+ mChat->chatLog("Party name is missing.", BY_SERVER);
+ return;
+ }
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(CMSG_PARTY_CREATE);
+ outMsg.writeString(party.substr(0, 23), 24);
+ mCreating = true;
+}
+
+void Party::leave(const std::string &args)
+{
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(CMSG_PARTY_LEAVE);
+ mChat->chatLog("Left party.", BY_SERVER);
+ mInParty = false;
+}
+
+void Party::createResponse(bool ok)
+{
+ if (ok)
+ {
+ mChat->chatLog("Party successfully created.", BY_SERVER);
+ mInParty = true;
+ }
+ else
+ {
+ mChat->chatLog("Could not create party.", BY_SERVER);
+ }
+}
+
+void Party::inviteResponse(const std::string &nick, int status)
+{
+ switch (status)
+ {
+ case 0:
+ mChat->chatLog(nick + " is already a member of a party.",
+ BY_SERVER);
+ break;
+ case 1:
+ mChat->chatLog(nick + " refused your invitation.", BY_SERVER);
+ break;
+ case 2:
+ mChat->chatLog(nick + " is now a member of your party.",
+ BY_SERVER);
+ break;
+ }
+}
+
+void Party::invitedAsk(const std::string &nick, int gender,
+ const std::string &partyName)
+{
+ mPartyName = partyName; /* Quick and nasty - needs redoing */
+ if (nick == "")
+ {
+ mChat->chatLog("Something\'s wrong!", BY_SERVER);
+ return;
+ }
+ mCreating = false;
+ ConfirmDialog *dlg = new ConfirmDialog("Invite to party",
+ nick + " invites you to join " +
+ (gender == 0 ? "his" : "her") +
+ " party, " + partyName +
+ ", do you accept?");
+ dlg->addActionListener(&mInviteListener);
+}
+
+void Party::InviteListener::action(const gcn::ActionEvent &event)
+{
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(CMSG_PARTY_INVITED);
+ outMsg.writeInt32(player_node->getId());
+ bool accept = event.getId() == "yes";
+ outMsg.writeInt32(accept ? 1 : 0);
+ *mInParty = *mInParty || accept;
+}
+
+void Party::leftResponse(const std::string &nick)
+{
+ mChat->chatLog(nick + " has left your party.", BY_SERVER);
+}
+
+void Party::receiveChat(Being *being, const std::string &msg)
+{
+ if (being == NULL)
+ {
+ return;
+ }
+ if (being->getType() != Being::PLAYER)
+ {
+ mChat->chatLog("Something\'s wrong!", BY_SERVER);
+ return;
+ }
+ being->setSpeech(msg, SPEECH_TIME);
+ mChat->chatLog(being->getName() + " : " + msg, BY_PARTY);
+}
+
+void Party::help()
+{
+ mChat->chatLog("/party <command> <params>: Party commands.", BY_SERVER);
+}
+
+void Party::help(const std::string &msg)
+{
+ if (msg == "")
+ {
+ mChat->chatLog("Command: /party <command> <args>", BY_SERVER);
+ mChat->chatLog("where <command> can be one of:", BY_SERVER);
+ mChat->chatLog(" /new", BY_SERVER);
+ mChat->chatLog(" /create", BY_SERVER);
+ mChat->chatLog(" /prefix", BY_SERVER);
+ mChat->chatLog(" /leave", BY_SERVER);
+ mChat->chatLog("This command implements the partying function.",
+ BY_SERVER);
+ mChat->chatLog("Type /help party <command> for further help.",
+ BY_SERVER);
+ return;
+ }
+ if (msg == "new" || msg == "create")
+ {
+ mChat->chatLog("Command: /party new <party-name>", BY_SERVER);
+ mChat->chatLog("Command: /party create <party-name>", BY_SERVER);
+ mChat->chatLog("These commands create a new party <party-name.",
+ BY_SERVER);
+ return;
+ }
+ if (msg == "prefix")
+ {
+ mChat->chatLog("Command: /party prefix <prefix-char>", BY_SERVER);
+ mChat->chatLog("This command sets the party prefix character.",
+ BY_SERVER);
+ mChat->chatLog("Any message preceded by <prefix-char> is sent to "
+ "the party instead of everyone.", BY_SERVER);
+ mChat->chatLog("Command: /party prefix", BY_SERVER);
+ mChat->chatLog("This command reports the current party prefix "
+ "character.", BY_SERVER);
+ return;
+ }
+ //if (msg == "settings")
+ //if (msg == "info")
+ if (msg == "leave")
+ {
+ mChat->chatLog("Command: /party leave", BY_SERVER);
+ mChat->chatLog("This command causes the player to leave the party.",
+ BY_SERVER);
+ return;
+ }
+ mChat->chatLog("Unknown /party command.", BY_SERVER);
+ mChat->chatLog("Type /help party for a list of options.", BY_SERVER);
+}
diff --git a/src/party.h b/src/party.h
new file mode 100644
index 00000000..d4f51b5a
--- /dev/null
+++ b/src/party.h
@@ -0,0 +1,75 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ * $Id: party.h
+ */
+
+#ifndef _TMW_PARTY_H
+#define _TMW_PARTY_H
+
+#include <string>
+
+#include <guichan/actionlistener.hpp>
+
+class PartyHandler;
+class Being;
+class ChatWindow;
+class Network;
+
+class Party
+{
+ public:
+ Party(ChatWindow *chat, Network *network);
+ void respond(const std::string &command, const std::string &args);
+
+ void create(const std::string &party);
+ void leave(const std::string &args);
+
+ void createResponse(bool ok);
+ void inviteResponse(const std::string &nick, int status);
+ void invitedAsk(const std::string &nick, int gender,
+ const std::string &partyName);
+ void leftResponse(const std::string &nick);
+ void receiveChat(Being *being, const std::string &msg);
+
+ void help();
+ void help(const std::string &msg);
+ private:
+ ChatWindow *mChat;
+ std::string mPartyName;
+ Network *mNetwork;
+ bool mInParty;
+ bool mCreating; /**< Used to give an appropriate response to
+ failure */
+ PartyHandler *handler;
+
+ class InviteListener : public gcn::ActionListener
+ {
+ public:
+ InviteListener(Network *network, bool *inParty) :
+ mNetwork(network), mInParty(inParty) {};
+ void action(const gcn::ActionEvent &event);
+ Network *mNetwork;
+ private:
+ bool *mInParty;
+ };
+ InviteListener mInviteListener;
+};
+#endif
diff --git a/src/player.cpp b/src/player.cpp
index d0c6bdc6..5db009ba 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: player.cpp 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
#include "player.h"
@@ -34,11 +34,34 @@
#include "utils/strprintf.h"
#include "gui/gui.h"
+#include <iostream>
+
+static const int NAME_X_OFFSET = 15;
+static const int NAME_Y_OFFSET = 30;
Player::Player(int id, int job, Map *map):
- Being(id, job, map),
- mDrawStrategy(NULL)
+ Being(id, job, map)
{
+ mName = 0;
+}
+
+Player::~Player()
+{
+ if (mName)
+ {
+ delete mName;
+ }
+}
+
+void Player::setName(const std::string &name)
+{
+ if (mName == 0)
+ {
+ mName = new FlashText(name, mPx + NAME_X_OFFSET, mPy + NAME_Y_OFFSET,
+ gcn::Graphics::CENTER,
+ speechFont, gcn::Color(255, 255, 255));
+ Being::setName(name);
+ }
}
void
@@ -75,37 +98,13 @@ Player::getType() const
return PLAYER;
}
-
void
-Player::setNameDrawStrategy(PlayerNameDrawStrategy *draw_strategy)
+Player::flash(int time)
{
- if (mDrawStrategy)
- delete mDrawStrategy;
- mDrawStrategy = draw_strategy;
-}
-
-class
-DefaultPlayerNameDrawStrategy : public PlayerNameDrawStrategy
-{
-public:
- virtual void draw(Player *player, Graphics *graphics, int px, int py)
+ if (mName)
{
- graphics->setFont(speechFont);
- graphics->setColor(gcn::Color(255, 255, 255));
- graphics->drawText(player->getName(), px + 15, py + 30, gcn::Graphics::CENTER);
+ mName->flash(time);
}
-};
-
-void
-Player::drawName(Graphics *graphics, int offsetX, int offsetY)
-{
- int px = mPx + offsetX;
- int py = mPy + offsetY;
-
- if (mDrawStrategy)
- mDrawStrategy->draw(this, graphics, px, py);
- else
- DefaultPlayerNameDrawStrategy().draw(this, graphics, px, py);
}
void Player::setGender(int gender)
@@ -202,3 +201,11 @@ void Player::setSprite(int slot, int id, std::string color)
Being::setSprite(slot, id, color);
}
+
+void Player::updateCoords()
+{
+ if (mName)
+ {
+ mName->adviseXY(mPx + NAME_X_OFFSET, mPy + NAME_Y_OFFSET);
+ }
+}
diff --git a/src/player.h b/src/player.h
index f43a6039..fdca64e8 100644
--- a/src/player.h
+++ b/src/player.h
@@ -18,30 +18,18 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: player.h 4237 2008-05-14 18:57:32Z b_lindeijer $
*/
#ifndef _TMW_PLAYER_H
#define _TMW_PLAYER_H
#include "being.h"
+#include "text.h"
class Graphics;
class Map;
-class Player;
-
-class PlayerNameDrawStrategy
-{
-public:
- virtual ~PlayerNameDrawStrategy(void) {}
-
- /**
- * Draw the player's name
- */
- virtual void draw(Player *p, Graphics *graphics, int px, int py) = 0;
-};
-
/**
* A player being. Players have their name drawn beneath them. This class also
* implements player-specific loading of base sprite, hair sprite and equipment
@@ -52,6 +40,14 @@ class Player : public Being
public:
Player(int id, int job, Map *map);
+ ~Player();
+
+ /**
+ * Set up mName to be the character's name
+ */
+ virtual void
+ setName(const std::string &name);
+
virtual void
logic();
@@ -59,9 +55,6 @@ class Player : public Being
getType() const;
virtual void
- drawName(Graphics *graphics, int offsetX, int offsetY);
-
- virtual void
setGender(int gender);
/**
@@ -83,19 +76,13 @@ class Player : public Being
setSprite(int slot, int id, std::string color = "");
/**
- * Sets the strategy responsible for drawing the player's name
- *
- * \param draw_strategy A strategy describing how the player's name
- * should be drawn, or NULL for default
+ * Flash the player's name
*/
- virtual void
- setNameDrawStrategy(PlayerNameDrawStrategy *draw_strategy);
-
- virtual PlayerNameDrawStrategy *
- getNameDrawStrategy(void) const { return mDrawStrategy; }
-
+ void flash(int time);
+ protected:
+ void updateCoords();
private:
- PlayerNameDrawStrategy *mDrawStrategy;
+ FlashText *mName;
};
#endif
diff --git a/src/player_relations.cpp b/src/player_relations.cpp
index 610f5d04..8abc9848 100644
--- a/src/player_relations.cpp
+++ b/src/player_relations.cpp
@@ -88,7 +88,7 @@ PlayerRelationsManager::PlayerRelationsManager() :
mDefaultPermissions(PlayerRelation::DEFAULT),
mIgnoreStrategy(NULL)
{
-}
+}
void
PlayerRelationsManager::clear()
@@ -325,29 +325,6 @@ public:
};
-class
-BlinkPlayerNameDrawStrategy : public PlayerNameDrawStrategy
-{
-public:
- BlinkPlayerNameDrawStrategy(int count) :
- mCount(count)
- {
- }
-
- virtual void draw(Player *player, Graphics *graphics, int px, int py)
- {
- graphics->setFont(speechFont);
- if (mCount & 4)
- graphics->drawText(player->getName(), px + 15, py + 30, gcn::Graphics::CENTER);
-
- if (mCount-- <= 0)
- player->setNameDrawStrategy(NULL);
- }
-private:
- int mCount; // Number of steps to blink
-};
-
-
class PIS_blinkname : public PlayerIgnoreStrategy
{
public:
@@ -360,7 +337,7 @@ public:
virtual void
ignore(Player *player, unsigned int flags)
{
- player->setNameDrawStrategy(new BlinkPlayerNameDrawStrategy(200));
+ player->flash(200);
}
};
@@ -407,4 +384,3 @@ PlayerRelationsManager::getPlayerIgnoreStrategies()
PlayerRelationsManager player_relations;
-
diff --git a/src/properties.h b/src/properties.h
index 93148bdf..9ebead66 100644
--- a/src/properties.h
+++ b/src/properties.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: properties.h 3754 2007-11-20 15:19:50Z b_lindeijer $
*/
#ifndef _TMW_PROPERTIES_H_
diff --git a/src/recorder.cpp b/src/recorder.cpp
new file mode 100644
index 00000000..48ecb837
--- /dev/null
+++ b/src/recorder.cpp
@@ -0,0 +1,112 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ * $Id: record.cpp
+ */
+
+#include "recorder.h"
+
+#include "gui/chat.h"
+#include "gui/buttonbox.h"
+
+#include "utils/trim.h"
+
+Recorder::Recorder(ChatWindow *chat) : mChat(chat)
+{
+ mButtonBox = new ButtonBox("Recording...", "Stop recording", this);
+ mButtonBox->setY(20);
+}
+
+void Recorder::record(const std::string &msg)
+{
+ if (mStream.is_open())
+ {
+ mStream << msg << std::endl;
+ }
+}
+
+void Recorder::respond(const std::string &msg)
+{
+ std::string msgCopy = msg;
+ trim(msgCopy);
+ if (msgCopy == "")
+ {
+ if (mStream.is_open())
+ {
+ mStream.close();
+ mButtonBox->setVisible(false);
+ /*
+ * Message should go after mStream is closed so that it isn't
+ * recorded.
+ */
+ mChat->chatLog("Finishing recording.", BY_SERVER);
+ }
+ else
+ {
+ mChat->chatLog("Not currently recording.", BY_SERVER);
+ }
+ return;
+ }
+ if (mStream.is_open())
+ {
+ mChat->chatLog("Already recording.", BY_SERVER);
+ }
+ else
+ {
+ /*
+ * Message should go before mStream is opened so that it isn't
+ * recorded.
+ */
+ mChat->chatLog("Starting to record...", BY_SERVER);
+ mStream.open(msg.c_str(), std::ios_base::trunc);
+ if (mStream.is_open())
+ {
+ mButtonBox->setVisible(true);
+ }
+ else
+ {
+ mChat->chatLog("Failed to start recording.", BY_SERVER);
+ }
+ }
+}
+
+void Recorder::help() const
+{
+ mChat->chatLog("/record <filename>: Start recording the chat.", BY_SERVER);
+}
+
+void Recorder::help(const std::string &args) const
+{
+ mChat->chatLog("Command: /record <filename>", BY_SERVER);
+ mChat->chatLog("This command starts recording the chat log to the file "
+ "<filename>.", BY_SERVER);
+ mChat->chatLog("Command: /record", BY_SERVER);
+ mChat->chatLog("This command finishes a recording session.", BY_SERVER);
+}
+
+void Recorder::buttonBoxRespond()
+{
+ respond("");
+}
+
+Recorder::~Recorder()
+{
+ delete mButtonBox;
+}
diff --git a/src/recorder.h b/src/recorder.h
new file mode 100644
index 00000000..2795cd53
--- /dev/null
+++ b/src/recorder.h
@@ -0,0 +1,50 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ * $Id: record.h
+ */
+
+#ifndef _TMW_RECORD_H
+#define _TMW_RECORD_H
+
+#include <string>
+#include <fstream>
+
+#include "gui/buttonbox.h"
+
+class ChatWindow;
+
+class Recorder : public ButtonBoxListener
+{
+ public:
+ Recorder(ChatWindow *chat);
+ void record(const std::string &msg);
+ void respond(const std::string &msg);
+ void help() const;
+ void help(const std::string &args) const;
+ void buttonBoxRespond();
+ bool isRecording() const {return mStream.is_open();}
+ ~Recorder();
+ private:
+ ChatWindow *mChat;
+ std::ofstream mStream;
+ ButtonBox *mButtonBox;
+};
+#endif
diff --git a/src/resources/action.cpp b/src/resources/action.cpp
index 6b3c2f52..facd23fb 100644
--- a/src/resources/action.cpp
+++ b/src/resources/action.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: action.cpp 3676 2007-10-23 08:02:22Z b_lindeijer $
*/
#include "action.h"
diff --git a/src/resources/action.h b/src/resources/action.h
index 8d5e8d11..61307652 100644
--- a/src/resources/action.h
+++ b/src/resources/action.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: action.h 2905 2006-12-12 15:06:06Z b_lindeijer $
*/
#ifndef _TMW_ACTION_H
diff --git a/src/resources/ambientoverlay.cpp b/src/resources/ambientoverlay.cpp
index 058b6083..654cbb32 100644
--- a/src/resources/ambientoverlay.cpp
+++ b/src/resources/ambientoverlay.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: ambientoverlay.cpp 2727 2006-10-07 20:01:34Z b_lindeijer $
*/
#include "ambientoverlay.h"
diff --git a/src/resources/ambientoverlay.h b/src/resources/ambientoverlay.h
index a939cbb4..c0b18600 100644
--- a/src/resources/ambientoverlay.h
+++ b/src/resources/ambientoverlay.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: ambientoverlay.h 2727 2006-10-07 20:01:34Z b_lindeijer $
*/
#ifndef _TMW_RESOURCES_AMBIENTOVERLAY_H_
diff --git a/src/resources/animation.cpp b/src/resources/animation.cpp
index de96525c..b740b9b5 100644
--- a/src/resources/animation.cpp
+++ b/src/resources/animation.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: animation.cpp 2905 2006-12-12 15:06:06Z b_lindeijer $
*/
#include "animation.h"
diff --git a/src/resources/animation.h b/src/resources/animation.h
index aad93cda..53420ecd 100644
--- a/src/resources/animation.h
+++ b/src/resources/animation.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: animation.h 3301 2007-05-23 21:35:01Z b_lindeijer $
*/
#ifndef _TMW_ANIMATION_H
diff --git a/src/resources/buddylist.cpp b/src/resources/buddylist.cpp
index 32d8d9f4..c917a45e 100644
--- a/src/resources/buddylist.cpp
+++ b/src/resources/buddylist.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: buddylist.cpp 4332 2008-06-05 07:33:12Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/resources/buddylist.h b/src/resources/buddylist.h
index 3791a03a..5a8f2324 100644
--- a/src/resources/buddylist.h
+++ b/src/resources/buddylist.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: buddylist.h 2239 2006-03-09 05:16:27Z der_doener $
*/
#ifndef _TMW_BUDDYLIST_H
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index d0dae462..dc22a69b 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: image.cpp 3760 2007-11-21 19:43:11Z b_lindeijer $
*/
#include <SDL_image.h>
diff --git a/src/resources/image.h b/src/resources/image.h
index 52f286f8..6f10f858 100644
--- a/src/resources/image.h
+++ b/src/resources/image.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: image.h 3760 2007-11-21 19:43:11Z b_lindeijer $
*/
#ifndef _TMW_IMAGE_H
diff --git a/src/resources/imageset.cpp b/src/resources/imageset.cpp
index 4b6dd592..6228f4e4 100644
--- a/src/resources/imageset.cpp
+++ b/src/resources/imageset.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: imageset.cpp 4209 2008-04-29 12:58:21Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/resources/imageset.h b/src/resources/imageset.h
index 15c21d90..719e9769 100644
--- a/src/resources/imageset.h
+++ b/src/resources/imageset.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: imageset.h 3753 2007-11-20 12:27:56Z b_lindeijer $
*/
#ifndef _TMW_IMAGESET_H
diff --git a/src/resources/imagewriter.cpp b/src/resources/imagewriter.cpp
index 7cfa16b4..f11cad24 100644
--- a/src/resources/imagewriter.cpp
+++ b/src/resources/imagewriter.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: imagewriter.cpp 2417 2006-07-19 15:12:06Z umperio $
*/
#include "imagewriter.h"
diff --git a/src/resources/imagewriter.h b/src/resources/imagewriter.h
index 205e4584..c7968d30 100644
--- a/src/resources/imagewriter.h
+++ b/src/resources/imagewriter.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: imagewriter.h 1766 2005-09-18 01:31:33Z bertram25 $
*/
#include <iosfwd>
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 71bd898a..52d19161 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemdb.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include <algorithm>
diff --git a/src/resources/itemdb.h b/src/resources/itemdb.h
index 0029129c..1ee1b5f0 100644
--- a/src/resources/itemdb.h
+++ b/src/resources/itemdb.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: itemdb.h 3587 2007-09-20 13:24:20Z b_lindeijer $
*/
#ifndef _TMW_ITEM_MANAGER_H
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index f1ebd0a9..64f5c37e 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: iteminfo.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "iteminfo.h"
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index 680c8d61..85f79263 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: iteminfo.h 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#ifndef _TMW_ITEMINFO_H_
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 2a080fb0..3dbaefde 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: mapreader.cpp 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#include "mapreader.h"
diff --git a/src/resources/mapreader.h b/src/resources/mapreader.h
index d16ff1d5..0d59fc9f 100644
--- a/src/resources/mapreader.h
+++ b/src/resources/mapreader.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: mapreader.h 3587 2007-09-20 13:24:20Z b_lindeijer $
*/
#ifndef _TMW_MAPREADER_H_
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp
index 0a98762f..04de0e7c 100644
--- a/src/resources/monsterdb.cpp
+++ b/src/resources/monsterdb.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: monsterdb.cpp 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#include <algorithm>
diff --git a/src/resources/monsterdb.h b/src/resources/monsterdb.h
index 46a33b06..43865bb3 100644
--- a/src/resources/monsterdb.h
+++ b/src/resources/monsterdb.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: monsterdb.h 3606 2007-09-27 14:54:09Z b_lindeijer $
*/
#ifndef _TMW_MONSTER_DB_H
diff --git a/src/resources/music.cpp b/src/resources/music.cpp
index 161d8b01..0e327218 100644
--- a/src/resources/music.cpp
+++ b/src/resources/music.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: music.cpp 3753 2007-11-20 12:27:56Z b_lindeijer $
*/
#include "music.h"
diff --git a/src/resources/music.h b/src/resources/music.h
index 72e76295..a15d22c1 100644
--- a/src/resources/music.h
+++ b/src/resources/music.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: music.h 3753 2007-11-20 12:27:56Z b_lindeijer $
*/
#ifndef _TMW_MUSIC_H
diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp
index 5869e295..c310d6e3 100644
--- a/src/resources/npcdb.cpp
+++ b/src/resources/npcdb.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npcdb.cpp 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#include "npcdb.h"
diff --git a/src/resources/npcdb.h b/src/resources/npcdb.h
index 2abf959b..e1240c5e 100644
--- a/src/resources/npcdb.h
+++ b/src/resources/npcdb.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: npcdb.h 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#ifndef _TMW_NPC_DB_H
diff --git a/src/resources/resource.cpp b/src/resources/resource.cpp
index 8f21f5d2..2bb60e56 100644
--- a/src/resources/resource.cpp
+++ b/src/resources/resource.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: resource.cpp 3808 2007-12-22 21:33:47Z b_lindeijer $
*/
#include <cassert>
diff --git a/src/resources/resource.h b/src/resources/resource.h
index 5b9a5eb8..9c70f6c0 100644
--- a/src/resources/resource.h
+++ b/src/resources/resource.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: resource.h 3808 2007-12-22 21:33:47Z b_lindeijer $
*/
#ifndef _TMW_RESOURCE_H
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index ef8671a8..6b45c9d7 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: resourcemanager.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include <cassert>
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index da85e2f9..3f0f1704 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: resourcemanager.h 3839 2008-01-13 16:28:50Z the_enemy $
*/
#ifndef _TMW_RESOURCE_MANAGER_H
diff --git a/src/resources/soundeffect.cpp b/src/resources/soundeffect.cpp
index ec9bc65c..03fa337e 100644
--- a/src/resources/soundeffect.cpp
+++ b/src/resources/soundeffect.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: soundeffect.cpp 3753 2007-11-20 12:27:56Z b_lindeijer $
*/
#include "soundeffect.h"
diff --git a/src/resources/soundeffect.h b/src/resources/soundeffect.h
index 866c53ec..0a574e7d 100644
--- a/src/resources/soundeffect.h
+++ b/src/resources/soundeffect.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: soundeffect.h 3753 2007-11-20 12:27:56Z b_lindeijer $
*/
#ifndef _TMW_SOUND_EFFECT_H
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp
index 334474d7..550b2d1c 100644
--- a/src/resources/spritedef.cpp
+++ b/src/resources/spritedef.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: spritedef.cpp 4332 2008-06-05 07:33:12Z b_lindeijer $
*/
#include <set>
diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h
index 531dfb3d..2872af06 100644
--- a/src/resources/spritedef.h
+++ b/src/resources/spritedef.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: spritedef.h 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#ifndef _TMW_SPRITEDEF_H
diff --git a/src/serverinfo.h b/src/serverinfo.h
index b317b87b..9a9eef1d 100644
--- a/src/serverinfo.h
+++ b/src/serverinfo.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: serverinfo.h 1735 2005-09-13 22:56:29Z der_doener $
*/
#ifndef _TMW_SERVERINFO_
@@ -32,6 +32,7 @@ struct SERVER_INFO
short port;
std::string name;
short online_users;
+ std::string updateHost;
};
#endif
diff --git a/src/shopitem.cpp b/src/shopitem.cpp
index ed5d30a9..8bd79cc1 100644
--- a/src/shopitem.cpp
+++ b/src/shopitem.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: shopitem.cpp 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#include "shopitem.h"
diff --git a/src/shopitem.h b/src/shopitem.h
index ffafbebe..4e6fd3a3 100644
--- a/src/shopitem.h
+++ b/src/shopitem.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: shopitem.h 4347 2008-06-12 09:06:01Z b_lindeijer $
*/
#ifndef _SHOPITEM_H_
diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp
index 18e732ef..db1c0c91 100644
--- a/src/simpleanimation.cpp
+++ b/src/simpleanimation.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: simpleanimation.cpp 3587 2007-09-20 13:24:20Z b_lindeijer $
*/
#include "simpleanimation.h"
diff --git a/src/simpleanimation.h b/src/simpleanimation.h
index 561c540d..dfca33e2 100644
--- a/src/simpleanimation.h
+++ b/src/simpleanimation.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: simpleanimation.h 3301 2007-05-23 21:35:01Z b_lindeijer $
*/
#ifndef _TMW_SIMPLEANIMAION_H
diff --git a/src/sound.cpp b/src/sound.cpp
index 0a20d3f2..f0101442 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: sound.cpp 3892 2008-02-18 10:00:45Z umperio $
*/
#include "sound.h"
diff --git a/src/sound.h b/src/sound.h
index ebcd6442..038f299e 100644
--- a/src/sound.h
+++ b/src/sound.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: sound.h 3606 2007-09-27 14:54:09Z b_lindeijer $
*/
#ifndef _TMW_SOUND_H
diff --git a/src/sprite.h b/src/sprite.h
index 89780519..cbe32186 100644
--- a/src/sprite.h
+++ b/src/sprite.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: sprite.h 3292 2007-05-07 16:22:54Z crush_tmw $
*/
#ifndef _TMW_SPRITE_H_
diff --git a/src/text.cpp b/src/text.cpp
new file mode 100644
index 00000000..545c1c0e
--- /dev/null
+++ b/src/text.cpp
@@ -0,0 +1,102 @@
+/***************************************************************************
+ * Copyright (C) 2008 by Douglas Boffey *
+ * *
+ * DougABoffey@netscape.net *
+ * This program 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 *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed with The Mana Experiment *
+ * 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. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "text.h"
+
+#include <cstring>
+
+#include <guichan/font.hpp>
+
+#include "textmanager.h"
+
+int Text::mInstances = 0;
+
+
+Text::Text(const std::string &text, int x, int y,
+ gcn::Graphics::Alignment alignment, gcn::Font *font,
+ gcn::Color colour) :
+ mText(text), mColour(colour)
+{
+ if (textManager == 0)
+ {
+ textManager = new TextManager();
+ }
+ ++mInstances;
+ mHeight = font->getHeight();
+ mWidth = font->getWidth(text);
+ switch (alignment)
+ {
+ case gcn::Graphics::LEFT:
+ mXOffset = 0;
+ break;
+ case gcn::Graphics::CENTER:
+ mXOffset = mWidth / 2;
+ break;
+ case gcn::Graphics::RIGHT:
+ mXOffset = mWidth;
+ break;
+ }
+ mX = x - mXOffset;
+ mY = y;
+ textManager->addText(this);
+ mFont = font;
+}
+
+void Text::adviseXY(int x, int y)
+{
+ textManager->moveText(this, x - mXOffset, y);
+}
+
+Text::~Text()
+{
+ textManager->removeText(this);
+ if (--mInstances == 0)
+ {
+ delete textManager;
+ textManager = 0;
+ }
+}
+
+void Text::draw(Graphics *graphics, int xOff, int yOff)
+{
+ graphics->setFont(mFont);
+ graphics->setColor(mColour);
+ graphics->drawText(mText, mX - xOff, mY - yOff, gcn::Graphics::LEFT);
+}
+
+FlashText::FlashText(const std::string &text, int x, int y,
+ gcn::Graphics::Alignment alignment, gcn::Font *font,
+ gcn::Color colour) :
+ Text(text, x, y, alignment, font, colour), mTime(0)
+{
+}
+
+void FlashText::draw(Graphics *graphics, int xOff, int yOff)
+{
+ if (mTime)
+ {
+ if ((--mTime & 4) == 0)
+ {
+ return;
+ }
+ }
+ Text::draw(graphics, xOff, yOff);
+}
diff --git a/src/text.h b/src/text.h
new file mode 100644
index 00000000..04b213b3
--- /dev/null
+++ b/src/text.h
@@ -0,0 +1,93 @@
+/***************************************************************************
+ * Copyright (C) 2008 by Douglas Boffey *
+ * *
+ * DougABoffey@netscape.net *
+ * This program 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 *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed with The Mana Experiment *
+ * 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. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _TME_TEXT_H
+#define _TME_TEXT_H
+
+#include "graphics.h"
+
+#include <list>
+
+class TextManager;
+
+class Text
+{
+ friend class TextManager;
+ public:
+ /**
+ * Constructor creates a text object to display on the screen
+ */
+ Text(const std::string &text, int x, int y,
+ gcn::Graphics::Alignment alignment, gcn::Font *font,
+ gcn::Color colour);
+
+ /**
+ * Allows the originator of the text to specify the ideal coordinates
+ */
+ void
+ adviseXY(int x, int y);
+
+ /**
+ * Remove the text from the screen
+ */
+ ~Text();
+
+ /**
+ * Draws the text
+ */
+ virtual void
+ draw(Graphics *graphics, int xOff, int yOff);
+
+ private:
+
+ int mX; /**< Actual x-value of left of text written */
+ int mY; /**< Actual y-value of top of text written */
+ int mWidth; /**< The width of the text */
+ int mHeight; /**< The height of the text */
+ int mXOffset; /**< The offset of mX from the desired x */
+ static int mInstances; /**< Instances of text */
+ gcn::Font *mFont; /**< The font used */
+ std::string mText; /**< The text to display */
+ gcn::Color mColour; /**< The colour of the text */
+};
+
+class FlashText : public Text
+{
+ public:
+ FlashText(const std::string &text, int x, int y,
+ gcn::Graphics::Alignment alignment, gcn::Font *font,
+ gcn::Color colour);
+
+ /**
+ * Flash the text for so many refreshes
+ */
+ void flash(int time) {mTime = time; }
+
+ /**
+ * Draws the text
+ */
+ virtual void
+ draw(Graphics *graphics, int xOff, int yOff);
+
+ private:
+ int mTime; /**< Time left for flashing */
+};
+#endif
diff --git a/src/textmanager.cpp b/src/textmanager.cpp
new file mode 100644
index 00000000..54d44c2a
--- /dev/null
+++ b/src/textmanager.cpp
@@ -0,0 +1,177 @@
+/***************************************************************************
+ * Copyright (C) 2008 by Douglas Boffey *
+ * *
+ * DougABoffey@netscape.net *
+ * This program 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 *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed with The Mana Experiment *
+ * 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. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "textmanager.h"
+
+#include <cstring>
+
+#include "text.h"
+
+TextManager *textManager = 0;
+
+TextManager::TextManager()
+{
+}
+
+void TextManager::addText(Text *text)
+{
+ place(text, 0, text->mX, text->mY, text->mHeight);
+ mTextList.push_back(text);
+}
+
+void TextManager::moveText(Text *text, int x, int y)
+{
+ text->mX = x;
+ text->mY = y;
+ place(text, text, text->mX, text->mY, text->mHeight);
+}
+
+void TextManager::removeText(const Text *text)
+{
+ for (TextList::iterator ptr = mTextList.begin(),
+ pEnd = mTextList.end(); ptr != pEnd; ++ptr)
+ {
+ if (*ptr == text)
+ {
+ mTextList.erase(ptr);
+ return;
+ }
+ }
+}
+
+TextManager::~TextManager()
+{
+}
+
+void TextManager::draw(Graphics *graphics, int xOff, int yOff)
+{
+ for (TextList::iterator bPtr = mTextList.begin(), ePtr = mTextList.end();
+ bPtr != ePtr; ++bPtr)
+ {
+ (*bPtr)->draw(graphics, xOff, yOff);
+ }
+}
+
+void TextManager::place(const Text *textObj, const Text *omit,
+ int &x, int &y, int h)
+{
+ int xLeft = textObj->mX;
+ int xRight = xLeft + textObj->mWidth - 1;
+ const int TEST = 100; // Number of lines to test for text
+ bool occupied[TEST]; // is some other text obscuring this line?
+ std::memset(&occupied, 0, sizeof(occupied)); // set all to false
+ int wantedTop = (TEST - h) / 2; // Entry in occupied at top of text
+ int occupiedTop = y - wantedTop; // Line in map representing to of occupied
+
+ for (TextList::const_iterator ptr = mTextList.begin(),
+ pEnd = mTextList.end(); ptr != pEnd; ++ptr)
+ {
+ if (*ptr != omit &&
+ (*ptr)->mX <= xRight &&
+ (*ptr)->mX + (*ptr)->mWidth > xLeft)
+ {
+ int from = (*ptr)->mY - occupiedTop;
+ int to = from + (*ptr)->mHeight - 1;
+ if (to < 0 || from >= TEST) // out of range considered
+ {
+ continue;
+ }
+ if (from < 0)
+ {
+ from = 0;
+ }
+ if (to >= TEST)
+ {
+ to = TEST - 1;
+ }
+ for (int i = from; i <= to; ++i)
+ {
+ occupied[i] = true;
+ }
+ }
+ }
+ bool ok = true;
+ for (int i = wantedTop; i < wantedTop + h; ++i)
+ {
+ ok = ok && !occupied[i];
+ }
+ if (ok)
+ {
+ return;
+ }
+ // Have to move it up or down, so find nearest spaces either side
+ int consec = 0;
+ int upSlot = -1; // means not found
+ for (int seek = wantedTop + h - 2; seek >= 0; --seek)
+ {
+ if (occupied[seek])
+ {
+ consec = 0;
+ }
+ else
+ {
+ if (++consec == h)
+ {
+ upSlot = seek;
+ break;
+ }
+ }
+ }
+ int downSlot = -1;
+ consec = 0;
+ for (int seek = wantedTop + 1; seek < TEST; ++seek)
+ {
+ if (occupied[seek])
+ {
+ consec = 0;
+ }
+ else
+ {
+ if (++consec == h)
+ {
+ downSlot = seek - h + 1;
+ break;
+ }
+ }
+ }
+ if (upSlot == -1 && downSlot == -1) // no good solution, so leave as is
+ {
+ return;
+ }
+ if (upSlot == -1) // must go down
+ {
+ y += downSlot - wantedTop;
+ return;
+ }
+ if (downSlot == -1) // must go up
+ {
+ y -= wantedTop - upSlot;
+ return;
+ }
+ if (wantedTop - upSlot > downSlot - wantedTop) // down is better
+ {
+ y += downSlot - wantedTop;
+ }
+ else
+ {
+ y -= wantedTop - upSlot;
+ }
+}
diff --git a/src/textmanager.h b/src/textmanager.h
new file mode 100644
index 00000000..53419240
--- /dev/null
+++ b/src/textmanager.h
@@ -0,0 +1,75 @@
+/***************************************************************************
+ * Copyright (C) 2008 by Douglas Boffey *
+ * *
+ * DougABoffey@netscape.net *
+ * This program 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 *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed with The Mana Experiment *
+ * 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. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _TME_TEXTMANAGER_H
+#define _TME_TEXTMANAGER_H
+
+#include <list>
+
+class Text;
+class Graphics;
+
+class TextManager
+{
+ public:
+ /**
+ * Constructor
+ */
+ TextManager();
+
+ /**
+ * Add text to the manager
+ */
+ void addText(Text *text);
+
+ /**
+ * Move the text around the screen
+ */
+ void moveText(Text *text, int x, int y);
+
+ /**
+ * Remove the text from the manager
+ */
+ void removeText(const Text *text);
+
+ /**
+ * Destroy the manager
+ */
+ ~TextManager();
+
+ /**
+ * Draw the text
+ */
+ void draw(Graphics *graphics, int xOff, int yOff);
+
+ private:
+ /**
+ * Position the text so as to avoid conflict
+ */
+ void place(const Text *textObj, const Text *omit,
+ int &x, int &y, int h);
+
+ typedef std::list<Text *> TextList; /**< The container type */
+ TextList mTextList; /**< The container */
+};
+
+extern TextManager *textManager;
+#endif
diff --git a/src/textparticle.cpp b/src/textparticle.cpp
index 89466006..c4b432f3 100644
--- a/src/textparticle.cpp
+++ b/src/textparticle.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: textparticle.cpp 4360 2008-06-23 14:44:20Z crush_tmw $
*/
#include "textparticle.h"
diff --git a/src/textparticle.h b/src/textparticle.h
index 34badb57..5f81abff 100644
--- a/src/textparticle.h
+++ b/src/textparticle.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: textparticle.h 3539 2007-08-28 16:42:47Z b_lindeijer $
*/
#ifndef _TEXTPARTICLE_H
diff --git a/src/tileset.h b/src/tileset.h
index 6af69235..6272d64a 100644
--- a/src/tileset.h
+++ b/src/tileset.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: tileset.h 3753 2007-11-20 12:27:56Z b_lindeijer $
*/
#ifndef _TMW_TILESET_H_
diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp
index 9a8f6356..e98216d4 100644
--- a/src/utils/base64.cpp
+++ b/src/utils/base64.cpp
@@ -26,7 +26,7 @@
| Author: Jim Winstead (jimw@php.net) |
+----------------------------------------------------------------------+
*/
-/* $Id$ */
+/* $Id: base64.cpp 2906 2006-12-12 15:18:30Z b_lindeijer $ */
#include <string.h>
#include <stdlib.h>
diff --git a/src/utils/base64.h b/src/utils/base64.h
index ff20ac53..3356debf 100644
--- a/src/utils/base64.h
+++ b/src/utils/base64.h
@@ -26,7 +26,7 @@
| Author: Jim Winstead (jimw@php.net) |
+----------------------------------------------------------------------+
*/
-/* $Id$ */
+/* $Id: base64.h 2906 2006-12-12 15:18:30Z b_lindeijer $ */
#ifndef _TMW_BASE64_H
#define _TMW_BASE64_H
diff --git a/src/utils/dtor.h b/src/utils/dtor.h
index f2c6c1b8..3b8aeb0e 100644
--- a/src/utils/dtor.h
+++ b/src/utils/dtor.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: dtor.h 2271 2006-03-18 15:15:33Z der_doener $
*/
#ifndef _TMW_UTILS_DTOR_H
diff --git a/src/utils/fastsqrt.h b/src/utils/fastsqrt.h
index afadb901..4513a79d 100644
--- a/src/utils/fastsqrt.h
+++ b/src/utils/fastsqrt.h
@@ -6,7 +6,7 @@
*
* Unfortunately the original creator of this function seems to be unknown.
*
- * $Id$
+ * $Id: fastsqrt.h 3508 2007-08-22 16:32:52Z b_lindeijer $
*/
float fastInvSqrt(float x)
diff --git a/src/utils/minmax.h b/src/utils/minmax.h
index 427c5da7..daf18c68 100644
--- a/src/utils/minmax.h
+++ b/src/utils/minmax.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: minmax.h 3628 2007-10-18 18:39:48Z b_lindeijer $
*/
#include <cstdlib>
diff --git a/src/utils/tostring.h b/src/utils/tostring.h
index 95b8985f..3cbeef27 100644
--- a/src/utils/tostring.h
+++ b/src/utils/tostring.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: tostring.h 3500 2007-08-21 15:11:19Z joshlangley $
*/
#ifndef _TMW_UTILS_TOSTRING_H
diff --git a/src/utils/trim.h b/src/utils/trim.h
index fec99100..7b236730 100644
--- a/src/utils/trim.h
+++ b/src/utils/trim.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: trim.h 3606 2007-09-27 14:54:09Z b_lindeijer $
*/
#ifndef _TMW_UTILS_TRIM_H_
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp
index 98b474cb..c0b921b8 100644
--- a/src/utils/xml.cpp
+++ b/src/utils/xml.cpp
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: xml.cpp 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#include "xml.h"
diff --git a/src/utils/xml.h b/src/utils/xml.h
index 5473b2ca..c64c1204 100644
--- a/src/utils/xml.h
+++ b/src/utils/xml.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: xml.h 4255 2008-05-21 21:44:27Z crush_tmw $
*/
#ifndef _TMW_XML_H
diff --git a/src/vector.h b/src/vector.h
index 7a5da241..379c50e1 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: vector.h 3541 2007-08-29 00:31:59Z b_lindeijer $
*/
#ifndef _TMW_VECTOR_H_
diff --git a/stamp-h1 b/stamp-h1
new file mode 100644
index 00000000..4547fe1b
--- /dev/null
+++ b/stamp-h1
@@ -0,0 +1 @@
+timestamp for config.h
diff --git a/tmw.desktop b/tme.desktop
index 398fb439..cff8d732 100644
--- a/tmw.desktop
+++ b/tme.desktop
@@ -1,14 +1,14 @@
[Desktop Entry]
Version=1.0
Encoding=UTF-8
-Name=The Mana World
-Name[fr]=Le Monde de Mana
+Name=The Mana Experiment
+Name[fr]=L'expérimentation de Mana
Comment=An on-line fantasy role playing game
Comment[fr]=Un jeu en ligne dans un univers fantastique
Comment[de]=ein Online Fantasy Spiel
Comment[it]=Un gioco fantasy online
Comment[nl]=Een online role playing game
-Exec=tmw
+Exec=tme
StartupNotify=false
Terminal=false
Type=Application
diff --git a/tmw.cbp b/tmw.cbp
index 5943f74e..ba49b449 100644
--- a/tmw.cbp
+++ b/tmw.cbp
@@ -7,7 +7,7 @@
<Option compiler="gcc" />
<Build>
<Target title="default">
- <Option output="tmw.exe" prefix_auto="0" extension_auto="0" />
+ <Option output="tme.exe" prefix_auto="0" extension_auto="0" />
<Option type="0" />
<Option compiler="gcc" />
<Option projectResourceIncludeDirsRelation="0" />
diff --git a/tools/adler32.c b/tools/adler32.c
index 4e851713..cd85d58e 100644
--- a/tools/adler32.c
+++ b/tools/adler32.c
@@ -7,9 +7,9 @@
* Usage: adler32 [file]...
*/
+#include <stdlib.h>
#include <stdio.h>
#include <zlib.h>
-
/**
* Calculates the Adler-32 checksum for the given file.
*/
diff --git a/tools/tmxcopy/Makefile b/tools/tmxcopy/Makefile
deleted file mode 100644
index 732dec36..00000000
--- a/tools/tmxcopy/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-CC=g++
-CFLAGS=-c `pkg-config --cflags libxml-2.0`
-LDFLAGS=`pkg-config --libs libxml-2.0`
-SOURCES=base64.cpp main.cpp map.cpp xmlutils.cpp zlibutils.cpp
-OBJECTS=$(SOURCES:.cpp=.o)
-EXECUTABLE=tmxcopy
-
-all: $(SOURCES) $(EXECUTABLE)
- make clean
-
-$(EXECUTABLE): $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $@
-
-.cpp.o:
- $(CC) $(CFLAGS) $< -o $@
-
-clean:
- rm -f *.o
diff --git a/tools/tmxcopy/base64.cpp b/tools/tmxcopy/base64.cpp
index 9a8f6356..6b7a4ad9 100644
--- a/tools/tmxcopy/base64.cpp
+++ b/tools/tmxcopy/base64.cpp
@@ -26,7 +26,7 @@
| Author: Jim Winstead (jimw@php.net) |
+----------------------------------------------------------------------+
*/
-/* $Id$ */
+/* $Id: base64.cpp 3773 2007-12-12 15:45:25Z crush_tmw $ */
#include <string.h>
#include <stdlib.h>
diff --git a/tools/tmxcopy/base64.h b/tools/tmxcopy/base64.h
index ff20ac53..9e1193be 100644
--- a/tools/tmxcopy/base64.h
+++ b/tools/tmxcopy/base64.h
@@ -26,7 +26,7 @@
| Author: Jim Winstead (jimw@php.net) |
+----------------------------------------------------------------------+
*/
-/* $Id$ */
+/* $Id: base64.h 3773 2007-12-12 15:45:25Z crush_tmw $ */
#ifndef _TMW_BASE64_H
#define _TMW_BASE64_H
diff --git a/tools/tmxcopy/tostring.h b/tools/tmxcopy/tostring.h
index 95b8985f..b70882b0 100644
--- a/tools/tmxcopy/tostring.h
+++ b/tools/tmxcopy/tostring.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id$
+ * $Id: tostring.h 3773 2007-12-12 15:45:25Z crush_tmw $
*/
#ifndef _TMW_UTILS_TOSTRING_H