Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-10-07 17:14:27 +0000
committerStijn Buys <ingar@osirion.org>2008-10-07 17:14:27 +0000
commitf54bd48a884e4e3c95818f042a4b2418a6e070a4 (patch)
tree73e82729a2f97b58e94ffd6944ac1ad47bf8314e /src/client/client.cc
parentf8d1ee921c83b7b148883b3ee16e4ec9c776d6db (diff)
working button click
Diffstat (limited to 'src/client/client.cc')
-rw-r--r--src/client/client.cc37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/client/client.cc b/src/client/client.cc
index b218166..e9bfba8 100644
--- a/src/client/client.cc
+++ b/src/client/client.cc
@@ -168,9 +168,8 @@ void Client::run()
if ((d > 0)) {
if (d >= client_frame_lenght) {
float elapsed = (float)(d) / 1000.f;
- core::Application::frame(elapsed);
- video::frame(elapsed);
- input::frame(elapsed);
+
+ frame(elapsed);
client_previous_timestamp = client_current_timestamp;
} else {
@@ -183,6 +182,30 @@ void Client::run()
}
+void Client::frame(float seconds)
+{
+ core::Application::frame(seconds);
+
+ if (!core::application()->connected()) {
+ // load the intro if nothing is running
+ if (core::application()->load("intro")) {
+ core::application()->connect("");
+ }
+ // if all fails, show the console
+ if (!core::application()->connected() && !console()->visible()) {
+ console()->toggle();
+ }
+ } else {
+ // show the main menu on non-interactive modules
+ if (!core::game()->interactive() && !ui::root()->active()) {
+ ui::root()->show_window("main");
+ }
+ }
+
+ video::frame(seconds);
+ input::frame(seconds);
+}
+
void Client::shutdown()
{
con_print << "^BShutting down client..." << std::endl;
@@ -258,8 +281,14 @@ void Client::notify_zoneclear(core::Zone *zone)
void Client::notify_disconnect()
{
// FIXME unload sounds
-
render::unload();
+ view::clear_zone(0);
+}
+
+void Client::notify_connect()
+{
+ ui::root()->hide_window();
+ view::clear_zone(0);
}
} // namespace client