diff options
author | Stijn Buys <ingar@osirion.org> | 2010-09-27 20:03:50 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-09-27 20:03:50 +0000 |
commit | 178f0e4a83918df416ac8274b0e845b390772d76 (patch) | |
tree | ee3d4bf0a29cfcd32530e2c38353668a42ce509d | |
parent | a80e501a0a8006034a7dc0cda1fc047f6c37fbd9 (diff) |
documentation updates, initial chat window playerlist, trade menu ESC key
-rw-r--r-- | doc/STORYLINE | 11 | ||||
-rw-r--r-- | doc/installation.html | 41 | ||||
-rw-r--r-- | doc/models.html | 55 | ||||
-rw-r--r-- | src/client/chat.cc | 84 | ||||
-rw-r--r-- | src/client/chat.h | 12 | ||||
-rw-r--r-- | src/client/trademenu.cc | 15 | ||||
-rw-r--r-- | src/client/trademenu.h | 5 | ||||
-rw-r--r-- | src/core/gameconnection.cc | 1 | ||||
-rw-r--r-- | src/core/gameinterface.cc | 6 | ||||
-rw-r--r-- | src/core/gameinterface.h | 10 | ||||
-rw-r--r-- | src/core/gameserver.cc | 2 | ||||
-rw-r--r-- | src/core/netconnection.cc | 2 |
12 files changed, 155 insertions, 89 deletions
diff --git a/doc/STORYLINE b/doc/STORYLINE index c5c5514..22c29e8 100644 --- a/doc/STORYLINE +++ b/doc/STORYLINE @@ -23,7 +23,7 @@ - House Lindblade - House Illia - - Lance Protectorate + - Council Protectorate Tsu-Khan Empire @@ -45,9 +45,9 @@ - Dover system - COUNCIL PROTECTORATE (protected by the Ordinators) + CENTRAL PROTECTORATE (protected by the Ordinators) - - Council Protectorate + - Central Protectorate planet Corona INDEPENDENT COLONIES (protected by the Colonial Militia) @@ -109,9 +109,8 @@ Since the war, the term 'Borderworlds' is used to indicate systems destroyed during the war, while the term 'colonies' is generally used as abreviation for the 'Independent Colonies'. - The Great Houses are referred to as the 'Lance Protectorate' or, - more informal, as 'the central planets'. - + The Central Protectorate and the systems controlled by The Great Houses + are called to 'The Protectorate' or, more informal, 'the central planets'. ------------------------------------------------------------------ TIMELINE diff --git a/doc/installation.html b/doc/installation.html index a1fa0b9..c10011c 100644 --- a/doc/installation.html +++ b/doc/installation.html @@ -56,7 +56,8 @@ <div class="text"> <p> Download the windows package:<br> - <a href="http://ingar.satgnu.net/osirion/files/osirion-win32-latest.zip">osirion-win32-latest.zip</a><br> + <a href="http://ingar.satgnu.net/osirion/files/osirion-win32-latest.zip">osirion-win32-latest.zip</a> (32 bit)<br> + <a href="http://ingar.satgnu.net/osirion/files/osirion-win32-latest.zip">osirion-win64-latest.zip</a> (64 bit)<br> This package contains the win32 version of the server and the client. <p> Dowload the game data package:<br> @@ -78,14 +79,14 @@ <p> Download the linux packages:<br> - <a href="http://ingar.satgnu.net/osirion/files/osirion-linux-latest.zip">osirion-linux-latest.zip</a><br> + <a href="http://ingar.satgnu.net/osirion/files/osirion-linux-latest.zip">osirion-linux-latest.zip</a>(32 and 64 bit)<br> This package contains the linux 32 and 64 bit versions of the client and the server. <p> Extract the package, a new subdirectory will be created. The actual directory name will depend on the version number. Enter the new subdirectory. <div class="code"> tar jxvf osirion-latest.tar.bz2<br> -cd osirion-linux-669 +cd osirion-linux-740 </div> <p> Dowload the game data package:<br> @@ -105,7 +106,6 @@ unzip ../osirion-data-latest.zip <div class="code"> ./osirion.x86_64 </div> - </div> <div id="building_from_source" class="title"> @@ -173,8 +173,9 @@ svn co svn://intranifty.no-ip.org/osirion osirion <a href="http://ingar.satgnu.net/osirion/files/osirion-src-latest.tar.bz2">osirion-src-latest.tar.bz2</a> </p> </div> +<!-- <div class="subtitle"> - Bullet physics support + Bullet physics support (depricated) </div> <div class="text"> <p> @@ -201,6 +202,7 @@ sudo install --mode=644 src/BulletDynamics/Dynamics/btActionInterface.h /usr/loc configure script using the <i>--with-bullet=/opt/bullet</i> option. </p> </div> +--> <div class="subtitle"> Compiling the source code </div> @@ -265,7 +267,7 @@ svn checkout svn://intranifty.no-ip.org/osirion-data data <p> The client and the dedicated server will look for game data in the <i>data</i> subdirectory of the current working directory. Since the binaries are build in the <i>src</i> you will - have to copy them with the <i>src/</i> prefix. + have start them with the <i>src/</i> prefix. </p> <p> To start the client: @@ -274,6 +276,10 @@ svn checkout svn://intranifty.no-ip.org/osirion-data data src/osirion </div> <p> + If the client opens a new window and immediatly close it again, it probably could not find + the game data and exited. Check your installation. +</p> +<p> To start the dedicated server: </p> <div class="code"> @@ -317,17 +323,17 @@ make </div> <div id="gtkradiant" class="title"> - GtkRadiant 1.5.0 support files (optional) + NetRadiant/GtkRadiant 1.5.0 support files (optional) </div> <div class="text"> <p> - You can skip this section if you do not intent to create to create models with gtkradiant 1.5. - Note that these files probably won't work with other versions. You can find precompiled - gtkradiant 1.5.0 binaries for linux on my gtkradiant page:<br> + You can skip this section if you do not intent to create to create models with netradiant or + gtkradiant 1.5. Note that these files probably won't work with other versions. You can find precompiled + netradiant packages here:<br> <a href="http://ingar.satgnu.net/gtkradiant">http://ingar.satgnu.net/gtkradiant</a> <p> These instructions assume gtkradiant is installed in the directory - <i>/usr/local/games/gtkradiant-1.5.0</i>. If it is installed in a different + <i>/usr/local/games/netradiant</i>. If it is installed in a different directory on your system, edit these instructions accordingly. <p> Copy the support files to the gtkradiant folder: @@ -335,10 +341,10 @@ make <div class="code"> cd data<br> cd gtkradiant<br> -cp -vr * /usr/local/games/gtkradiant-1.5.0 +cp -vr * /usr/local/games/netradiant </div> <p> - Open the file <i>/usr/local/games/gtkradiant-1.5.0/games/osirion.game</i> in + Open the file <i>/usr/local/games/netradiant/games/osirion.game</i> in your favourite editor. Look for a line that begins with: </p> <div class="code"> @@ -401,18 +407,19 @@ Organization of the distribution /math mathematical classes and functions /sys low-level system functions /render render library - /ui user interface widget library + /ui user interface library /data Data files /base game data files /bitmaps essential bitmaps /ini game world description files - /maps game world models - /scripts gtkradiant shader files + /maps 3D models (.map format) + /models 3D models (ase and other formats) + /scripts radiant compatible shader files /textures game world textures - /gtkradiant gtkradiant support files + /gtkradiant radiant support files </pre> </div> diff --git a/doc/models.html b/doc/models.html index 68026f4..bd0565a 100644 --- a/doc/models.html +++ b/doc/models.html @@ -10,30 +10,29 @@ The Osirion Project - Creating models </H1> <p> - The engine supports loading of Quake 3 style .map files with custom osirion - entities. While it might look like a weird choice for a file format - it has been a well-considered pragmatic choice. -<p> - First of all, creating commercial grade graphics has never been - my goal. Polished high-quality models demand a lot of time, - skill and effort. -<p> - The same goes for 3D modelling packages like Blender or 3D Studio Max. - They are capable of producing awesome results, but the learning curve - is quite steep and the number of available 3D artists is rather limited. + The engine supports two kind of models: The first one are + Quake 3 style .map files with custom osirion entities. The second + one are .ase models. Textures are supported, but no advanced features + like normal mapping. +</p> <p> - GtkRadiant on the other hand has been my personal tool for some time - now. An experienced mapper can create a LEGO-style model in a matter - of hours and without having the usual technical difficulties of creating - a map for a shoot'em'up. + The .map format allows for a quick and easy way to create usable + 3D models, while the .ase format allows importing more complex + models made with modelling packages. The .map format is also used + as a container format to place tags on models, like lights, + smoke trails and weapon locations. +</p> <p> - Creating game content is usually a chicken-and-egg in a small game - project. I hope to solve this by choosing a widely available and - easy to master format. + .ase models can be loaded as sub-models into a .map file, + making modular spaceship design possible. Ship parts like engines + can be placed into seperate files and reused in other models. +</p> <p> - The rest of this document contains information specific to creating + The rest of the document describes how to create models using + GtkRadiant and contains mostly information specific to creating models for The Osirion Project. Even if you can handle GtkRadiant, it is still worth a read. +</p> <h2> Content </h2> @@ -50,6 +49,7 @@ <li><a href="#flares">Flares</a> <li><a href="#particles">Particles</a> <li><a href="#groups">Function groups</a> + <li><a href="#submodels">Submodels</a> <li><a href="#other_entities">Other entities</a> </ul> @@ -110,14 +110,14 @@ </h2> <p> Any brush face that has the <i>common/caulk</i> texture will be ignored on load. - +</p> <h2 id="clip"> Clip </h2> <p> Any brush face that has the <i>common/clip</i> texture will be ignored on load. Clip is reserved for future use. - +</p> <h2 id="detail_brushes"> Detail brushes </h2> @@ -187,7 +187,12 @@ glass on hidden faces. The <i>common/clip</i> material is reserved for future use brush faces using this texture will be ignored as well. </p> - +<p> + For .ase models, the material name inside the .ase file is interpreted as an osirion material. + If you'd use a material called <i>common/entity</i>, those model faces will rendered using + the object's primary in-game color, regardless of the actual material settings in the .ase file. +</p> + <h2 id="shader_files"> Shader files </h2> @@ -333,6 +338,12 @@ textures/ship/stripes is automaticly calculated as the geometrical center of the group. The rotation axis can be set with the <i>direction</i>, <i>pitch</i> and <i>roll</i> keys. <i>angle</i> is an alias for <i>direction</i>. </p> +<h2 id="submodels"> + Submodels +</h2> +<p> + <i>misc_model</i> can be used to add a submodel. +</p> <h2 id="other_entities"> Other entities </h2> diff --git a/src/client/chat.cc b/src/client/chat.cc index c1fc78f..8191e52 100644 --- a/src/client/chat.cc +++ b/src/client/chat.cc @@ -29,21 +29,19 @@ Chat::Chat(ui::Widget *parent) : ui::Window(parent) chat_scrollpane->set_border(false); chat_scrollpane->set_label("text"); - chat_playerpane = new ui::ScrollPane(this, chat_players); - chat_playerpane->set_border(false); - chat_playerpane->set_label("players"); - chat_playerpane->set_alignment(ui::AlignLeft | ui::AlignTop); + chat_playerlist = new ui::ListView(this); + chat_playerlist->set_label("playerlist"); chat_input = new ui::InputBox(this); chat_input->set_border(false); chat_input->set_prompt("^BSay^F:^B "); - chat_input->set_focus(); set_background(true); set_visible(false); chat_small = false; + chat_playerlist_timestamp = 0; } Chat::~Chat() @@ -53,15 +51,17 @@ Chat::~Chat() void Chat::clear() { - chat_players.clear(); chat_log.clear(); chat_input->clear(); + chat_playerlist->clear(); + chat_playerlist_timestamp = 0; } void Chat::set_small_view(bool small_chat_view) { chat_small = small_chat_view; + resize(); } void Chat::event_text(const std::string & text) @@ -164,8 +164,11 @@ bool Chat::on_keypress(const int key, const unsigned int modifier) return false; } -void Chat::event_draw() +void Chat::draw() { + /* + * this never worked before, event_draw is NOT virtual + if (ui::console()->visible()) return; @@ -178,48 +181,51 @@ void Chat::event_draw() hide(); return; } + */ + + if (!chat_small && (chat_playerlist_timestamp != core::game()->playerlist_timestamp())) { + update_player_list(); + } + + ui::Window::draw(); +} - if (chat_small) { - chat_playerpane->hide(); - chat_scrollpane->hide(); - } else { - chat_playerpane->show(); - chat_scrollpane->show(); - - chat_players.clear(); - std::ostringstream ostr; - - ostr << "^B" << core::game()->players().size() << " " << aux::plural("player", core::game()->players().size()); - chat_players.push_back(ostr.str()); - - for (core::GameInterface::Players::iterator it = core::game()->players().begin(); it != core::game()->players().end(); it++) { - core::Player *player = (*it); - chat_players.push_back(player->name() + "^N"); - } +void Chat::update_player_list() +{ + chat_playerlist->clear(); + + for (core::GameInterface::Players::const_iterator it = core::game()->players().begin(); it != core::game()->players().end(); it++) { + ui::ListItem *listitem = new ui::ListItem(chat_playerlist, (*it)->name().c_str()); + listitem->set_height(listitem->font()->height() * 1.5f); } - Widget::event_draw(); + chat_playerlist_timestamp = core::game()->playerlist_timestamp(); } void Chat::resize() { - const float margin = 8.0f; - math::Vector2f s(size()); - - s[0] -= margin * 2; - s[1] -= margin * 2; - - // player names - chat_playerpane->set_size(ui::UI::elementsize.width() , s.height() - font()->height() * 2.5f); - chat_playerpane->set_location(s.width() - chat_playerpane->width() + 2.0f * margin, margin + font()->height()); + const float fontmargin = ui::root()->font_large()->height(); + + if (chat_small) { + chat_playerlist->hide(); + chat_scrollpane->hide(); + + } else { + chat_playerlist->show(); + chat_scrollpane->show(); + + // player names + chat_playerlist->set_size(ui::UI::elementsize.width(), height() - fontmargin * 3.0f); + chat_playerlist->set_location(width() - ui::UI::elementsize.width() - fontmargin, fontmargin); - // chat text - chat_scrollpane->set_size(s.width() - chat_playerpane->width() - margin, s.height() - font()->height() * 1.5f); - chat_scrollpane->set_location(margin, margin); + // chat text + chat_scrollpane->set_size(width() - ui::UI::elementsize.width() - fontmargin * 3.0f, height() - fontmargin * 3.0f); + chat_scrollpane->set_location(fontmargin, fontmargin); + } // input bar - chat_input->set_location(margin, height() - font()->height() - margin); - chat_input->set_size(s.width(), font()->height()); + chat_input->set_location(fontmargin, height() - fontmargin); + chat_input->set_size(width() - 2.0f * fontmargin , fontmargin); } diff --git a/src/client/chat.h b/src/client/chat.h index 61f5bd1..0972400 100644 --- a/src/client/chat.h +++ b/src/client/chat.h @@ -13,6 +13,7 @@ #include "ui/inputbox.h" #include "ui/scrollpane.h" #include "ui/window.h" +#include "ui/listview.h" namespace client { @@ -37,22 +38,23 @@ public: void clear(); protected: - virtual void event_draw(); + virtual void draw(); + virtual void resize(); virtual bool on_keypress(const int key, const unsigned int modifier); private: + void update_player_list(); bool chat_small; ui::Text chat_log; ui::ScrollPane *chat_scrollpane; - - ui::Text chat_players; - ui::ScrollPane *chat_playerpane; - ui::InputBox *chat_input; + ui::ListView *chat_playerlist; + + unsigned long chat_playerlist_timestamp; typedef std::deque<std::string> History; diff --git a/src/client/trademenu.cc b/src/client/trademenu.cc index 8aa9a52..c0d1f03 100644 --- a/src/client/trademenu.cc +++ b/src/client/trademenu.cc @@ -364,4 +364,19 @@ void TradeMenu::draw() Window::draw(); } +bool TradeMenu::on_keypress(const int key, const unsigned int modifier) +{ + switch (key) { + + case SDLK_ESCAPE: + this->hide(); + return true; + break; + default: + break; + } + + return Window::on_keypress(key, modifier); +} + } // namespace client diff --git a/src/client/trademenu.h b/src/client/trademenu.h index 5ea34aa..ecc41b9 100644 --- a/src/client/trademenu.h +++ b/src/client/trademenu.h @@ -36,11 +36,16 @@ protected: /// resize event handler virtual void resize(); + /// draw event handler virtual void draw(); /// emit event handler virtual bool on_emit(Widget *sender, const Event event, void *data); + /// keypress event handler + virtual bool on_keypress(const int key, const unsigned int modifier); + + private: void set_item(ui::ListItem *item); diff --git a/src/core/gameconnection.cc b/src/core/gameconnection.cc index f64c8fb..ba18bd5 100644 --- a/src/core/gameconnection.cc +++ b/src/core/gameconnection.cc @@ -61,6 +61,7 @@ GameConnection::GameConnection(std::string const &connectionstr) } game_players.push_back(localplayer()); + set_playerlist_timestamp(timestamp()); connection_running = true; } diff --git a/src/core/gameinterface.cc b/src/core/gameinterface.cc index 5caa270..23018d3 100644 --- a/src/core/gameinterface.cc +++ b/src/core/gameinterface.cc @@ -122,6 +122,7 @@ void GameInterface::clear() } } game_players.clear(); + game_playerlist_timestamp = 0; // remove all game functions for (Func::Registry::iterator it = Func::registry().begin(); it != Func::registry().end();) { @@ -193,4 +194,9 @@ void GameInterface::list_players() con_print << count << " connected " << aux::plural("player", count) << std::endl; } +void GameInterface::set_playerlist_timestamp(const unsigned long timestamp) +{ + game_playerlist_timestamp = ( timestamp > 0 ? timestamp : 1); +} + } diff --git a/src/core/gameinterface.h b/src/core/gameinterface.h index bdce1d3..98894e7 100644 --- a/src/core/gameinterface.h +++ b/src/core/gameinterface.h @@ -38,6 +38,10 @@ public: inline Players & players() { return game_players; } + + inline const unsigned long playerlist_timestamp() const { + return game_playerlist_timestamp; + } inline model::VertexArray *vertexarray() { return game_vertexarray; @@ -68,6 +72,9 @@ public: /// request inventory for entity with id virtual Inventory *request_inventory(Entity *entity) = 0; + + void set_playerlist_timestamp(const unsigned long timestamp); + /*----- mutators ------------------------------------------------- */ @@ -89,6 +96,9 @@ protected: Players game_players; model::VertexArray *game_vertexarray; + + /// timestamp of the time the playerlist was last changed + unsigned long game_playerlist_timestamp; }; /// global local player instance diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc index 963db6d..31c6d42 100644 --- a/src/core/gameserver.cc +++ b/src/core/gameserver.cc @@ -441,6 +441,7 @@ void GameServer::player_connect(Player *player) // manage player list game_players.push_back(player); + set_playerlist_timestamp(timestamp()); } void GameServer::player_disconnect(Player *player) @@ -464,6 +465,7 @@ void GameServer::player_disconnect(Player *player) if (it != game_players.end()) { game_players.erase(it); } + set_playerlist_timestamp(timestamp()); } void GameServer::frame(unsigned long timestamp) diff --git a/src/core/netconnection.cc b/src/core/netconnection.cc index 3318c1e..15e57e2 100644 --- a/src/core/netconnection.cc +++ b/src/core/netconnection.cc @@ -755,6 +755,7 @@ void NetConnection::parse_incoming_message(const std::string & message) if (!player) { player = new Player(); game()->players().push_back(player); + game()->set_playerlist_timestamp(game()->timestamp()); } player->receive_short_server_update(msgstream); @@ -781,6 +782,7 @@ void NetConnection::parse_incoming_message(const std::string & message) for (GameInterface::Players::iterator it = game()->players().begin(); it != game()->players().end() && !player; it++) { if ((*it)->id() == player_id) { game()->players().erase(it); + game()->set_playerlist_timestamp(game()->timestamp()); return; } } |