From ca0c1d3e6f8b5fa4eb2e0a86fcf47b12fb600786 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 27 Sep 2008 17:16:15 +0000 Subject: mission targets, texture unloading, private messages --- src/client/client.cc | 55 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 18 deletions(-) (limited to 'src/client/client.cc') diff --git a/src/client/client.cc b/src/client/client.cc index 7ba61d6..a8d4ca8 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -19,6 +19,8 @@ #include "client/input.h" #include "client/view.h" #include "core/core.h" +#include "core/zone.h" +#include "render/render.h" namespace client { @@ -181,6 +183,8 @@ void Client::shutdown() { con_print << "^BShutting down client..." << std::endl; + if (connected()) disconnect(); + core::Func::remove("r_restart"); core::Func::remove("snd_restart"); @@ -210,34 +214,49 @@ void Client::notify_remove_sound(size_t source) audio::Sources::remove(source); } -void Client::notify_message(std::string const & message) +void Client::notify_message(core::Message::Channel const channel, std::string const message) { - con_print << message << std::endl; + + switch(channel) { + + case core::Message::Info: // Info message + break; + + case core::Message::Local: // Chat message in the local zone + break; + + case core::Message::RCon: // RCon message + break; + + case core::Message::Public: // Public chat message + audio::play("com/chat"); + break; + + case core::Message::Private: // Private chat message + audio::play("com/priv"); + break; + + default: + break; + } + + con_print << message << std::endl; console()->notify(message); } void Client::notify_zoneclear(core::Zone *zone) { - // FIXME unload zone textures - /* if (!zone) return; - for (core::Zone::Content::iterator it = zone->content().begin(); it != zone->content.end(); i++) { - core:: Entity *entity = (*it); - - if (entity->type() == core::Entity::Globe) { - core::EntityGlobe *globe = static_cast(entity); - if (globe->render_texture) - render::Textures::unload(render_texture); - - } + view::clear_zone(zone); +} - if (zone->sky_texture()) { - render::Textures::unload(zone->sky_texture()); - zone->set_sky_texture(0); - } - */ +void Client::notify_disconnect() +{ + // FIXME unload sounds + + render::unload(); } } // namespace client -- cgit v1.2.3