Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-05-31 13:17:14 +0000
committerStijn Buys <ingar@osirion.org>2011-05-31 13:17:14 +0000
commitb7d62e90a7a0e4e404623af0c646495a3dd3fd2b (patch)
treea8c15b9a40428e5c7bb03138a9260f16f4e3daf4 /src
parent1c63cbf204b1d2c667ce9f821ccb197d0ffb0ac3 (diff)
Removed a forced recalculateLocalAabb for compound shapes,
semi-colon in chat messages doesn't truncate the chat text any more, changed chat prompt to "Command:" if the first character is a slash, small misc cleanups
Diffstat (limited to 'src')
-rw-r--r--src/client/chat.cc15
-rw-r--r--src/client/chat.h5
-rw-r--r--src/client/client.h5
-rw-r--r--src/core/application.h1
-rw-r--r--src/core/entity.cc4
-rw-r--r--src/core/gameserver.cc6
-rw-r--r--src/core/netserver.cc3
-rw-r--r--src/dedicated/console.cc2
8 files changed, 31 insertions, 10 deletions
diff --git a/src/client/chat.cc b/src/client/chat.cc
index bdce6d8..cf995cb 100644
--- a/src/client/chat.cc
+++ b/src/client/chat.cc
@@ -34,7 +34,7 @@ Chat::Chat(ui::Widget *parent) : ui::Window(parent)
chat_input = new ui::InputBox(this);
chat_input->set_border(false);
- chat_input->set_prompt("^BSay^F:^B ");
+ set_prompt();
chat_input->set_focus();
set_background(true);
@@ -117,7 +117,8 @@ bool Chat::on_keypress(const int key, const unsigned int modifier)
core::cmd() << &chat_input->text().c_str()[1] << std::endl;
} else {
// FIXME semi-column ; truncates the command
- core::cmd() << "say " << chat_input->text() << std::endl;
+ //core::cmd() << "say " << chat_input->text() << std::endl;
+ client()->say(chat_input->text());
}
(*history.rbegin()) = chat_input->text();
@@ -165,12 +166,22 @@ bool Chat::on_keypress(const int key, const unsigned int modifier)
return false;
}
+void Chat::set_prompt()
+{
+ if (chat_input->text().size() && chat_input->text()[0] == '/') {
+ chat_input->set_prompt("^BCommand^F:^B ");
+ } else {
+ chat_input->set_prompt("^BSay^F:^B ");
+ }
+}
+
void Chat::draw()
{
if (!chat_small && (chat_playerlist_timestamp != core::game()->playerlist_timestamp())) {
update_player_list();
}
+ set_prompt();
ui::Window::draw();
}
diff --git a/src/client/chat.h b/src/client/chat.h
index 0972400..fa50e87 100644
--- a/src/client/chat.h
+++ b/src/client/chat.h
@@ -43,6 +43,11 @@ protected:
virtual void resize();
virtual bool on_keypress(const int key, const unsigned int modifier);
+
+ /**
+ * @brief set the chatbox prompt to 'say:' or 'command:' depending on the current input text.
+ */
+ void set_prompt();
private:
diff --git a/src/client/client.h b/src/client/client.h
index 85562a1..ddc6dd5 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -73,6 +73,11 @@ public:
return client_testmodelview;
}
+ /// local client seds a chat message
+ inline void say(std::string const &text) {
+ func_say(text);
+ }
+
protected:
/// run a client frame
virtual void frame();
diff --git a/src/core/application.h b/src/core/application.h
index cdaef67..3f71b4c 100644
--- a/src/core/application.h
+++ b/src/core/application.h
@@ -124,6 +124,7 @@ private:
static Application *application_instance;
+protected:
/*-- engine functions --*/
static void func_help(std::string const &args);
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 6ce94a7..84f4de0 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -492,7 +492,6 @@ void Entity::frame(const unsigned long elapsed)
{
if (entity_collision_child_shapes.size() > 0) {
btCompoundShape *compoundshape = static_cast<btCompoundShape *> (entity_collision_shape);
- bool recalculate = false;
const float modelscale = radius() / model()->radius();
for (int n = 0; n < compoundshape->getNumChildShapes(); n++) {
@@ -524,9 +523,6 @@ void Entity::frame(const unsigned long elapsed)
compoundshape->updateChildTransform(n, child_transform);
}
}
-
- if (recalculate)
- compoundshape->recalculateLocalAabb();
}
}
}
diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc
index 58367e5..b4b3322 100644
--- a/src/core/gameserver.cc
+++ b/src/core/gameserver.cc
@@ -52,7 +52,7 @@ void func_time(std::string const &args)
<< std::setw(2) << hour << ":"
<< std::setw(2) << min << ":"
<< std::setw(2) << sec << " "
- << std::setw(2) << " ";
+ << std::setw(2) << " ";
// uptime
float uptime = core::game()->time();
@@ -68,9 +68,9 @@ void func_time(std::string const &args)
const int uptime_seconds = (int) floorf(uptime);
- con_print << " Uptime: ";
+ con_print << "Uptime: ";
if (uptime_days > 0) {
- con_print << uptime_days << " " << aux::plural("day", uptime_days);
+ con_print << uptime_days << " " << aux::plural("day", uptime_days) << " ";
}
con_print << std::setfill('0') << std::setw(2) << uptime_hours << ":"
<< std::setfill('0') << std::setw(2) << uptime_minutes << ":"
diff --git a/src/core/netserver.cc b/src/core/netserver.cc
index d9a5bed..37adfc1 100644
--- a/src/core/netserver.cc
+++ b/src/core/netserver.cc
@@ -713,6 +713,9 @@ void NetServer::parse_incoming_message(NetClient *client, const std::string & me
send_message(client, "info", message);
send_disconnect(client);
}
+
+ // TODO add player uid to connect message
+
return;
} else if (command.compare("pif") == 0) {
diff --git a/src/dedicated/console.cc b/src/dedicated/console.cc
index 10fe261..2481f58 100644
--- a/src/dedicated/console.cc
+++ b/src/dedicated/console.cc
@@ -237,7 +237,7 @@ void Console::draw_status()
status << "uptime ";
if (uptime_days > 0) {
- status << uptime_days << " " << aux::plural("day", uptime_days);
+ status << uptime_days << " " << aux::plural("day", uptime_days) << " ";
}
status << std::setfill('0') << std::setw(2) << uptime_hours << ":"
<< std::setfill('0') << std::setw(2) << uptime_minutes << ":"