From bab086a02132685ad78ecf66ddbc1b7e0488ba1b Mon Sep 17 00:00:00 2001 From: Joshua Moerman Date: Wed, 24 Apr 2013 09:42:32 +0200 Subject: [PATCH] Changed font, added label to join --- src/client/client.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/client/client.cpp b/src/client/client.cpp index c6aa35b..7626dea 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -191,8 +191,8 @@ namespace games { context = libwebsocket_create_context(&info); if(!context) throw std::runtime_error("context could not be created."); - std::string address = "127.0.0.1"; - // std::string address = "vadovas-studios.com"; + // std::string address = "127.0.0.1"; + std::string address = "vadovas-studios.com"; wsi = libwebsocket_client_connect(context, address.c_str(), 7681, false, "/", address.c_str(), "origin", "uberclient", -1); if(!wsi) throw std::runtime_error("socket could not be created."); @@ -200,6 +200,12 @@ namespace games { world.physics.set_gravity({0.0, 0.0, 0.0}); hud->camera.set_orthographic(-100, 100, -100, 100, 1, -1); update_peeps(""); + auto join_lbl = std::make_shared("Join at: http://vadovas-studios.com/beats", motor::bundle.get_font_path() + "Arial Rounded Bold.ttf", 72); + join_lbl->get_mesh()->material->diffuse_color = {1.0f, 1.0f, 1.0f, 1.0f}; + join_lbl->set_position({-95.0, -95.0, 0.0}); + join_lbl->set_scale(motor::scale(0.05)); + join_lbl->set_rotation(motor::lookat_rotation({0, 0, -1}, {0, 1, 0})); + hud->add(join_lbl); } void Client::handle_input(float dt, Input input){ @@ -292,7 +298,7 @@ namespace games { void Client::update_peeps(std::string peeps){ if(!peeps_lbl){ try { - peeps_lbl = std::make_shared("Peeps:", motor::bundle.get_font_path() + "VeraMoBd.ttf", 72); + peeps_lbl = std::make_shared("Peeps:", motor::bundle.get_font_path() + "Arial Rounded Bold.ttf", 72); peeps_lbl->get_mesh()->material->diffuse_color = {1.0f, 1.0f, 1.0f, 1.0f}; peeps_lbl->set_position({-95.0, -90.0, 0.0}); peeps_lbl->set_scale(motor::scale(0.05)); @@ -302,7 +308,11 @@ namespace games { CERR << e.what() << std::endl; } } - peeps_lbl->set_text("Peeps: " + peeps); + if(peeps == ""){ + peeps_lbl->set_text("No peeps online :(."); + } else { + peeps_lbl->set_text("Peeps: " + peeps); + } } void Client::update(float const dt, Input input){