2016-01-20 23:45:09 +01:00
|
|
|
/*****************************************************************************
|
2019-03-17 08:16:15 +01:00
|
|
|
* Copyright (c) 2014-2019 OpenRCT2 developers
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2016-05-04 19:24:41 +02:00
|
|
|
*****************************************************************************/
|
2016-01-20 23:45:09 +01:00
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2-ui/interface/Dropdown.h>
|
|
|
|
#include <openrct2-ui/interface/Viewport.h>
|
|
|
|
#include <openrct2-ui/interface/Widget.h>
|
2017-09-06 15:09:18 +02:00
|
|
|
#include <openrct2-ui/windows/Window.h>
|
2017-11-30 18:17:06 +01:00
|
|
|
#include <openrct2/Game.h>
|
2017-12-12 14:52:57 +01:00
|
|
|
#include <openrct2/Input.h>
|
2019-05-12 19:54:41 +02:00
|
|
|
#include <openrct2/actions/PlayerKickAction.hpp>
|
2019-05-01 17:54:12 +02:00
|
|
|
#include <openrct2/actions/PlayerSetGroupAction.hpp>
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2/config/Config.h>
|
|
|
|
#include <openrct2/drawing/Drawing.h>
|
|
|
|
#include <openrct2/interface/Colour.h>
|
2018-01-06 18:32:25 +01:00
|
|
|
#include <openrct2/localisation/Localisation.h>
|
2019-02-20 22:30:12 +01:00
|
|
|
#include <openrct2/network/NetworkAction.h>
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2/network/network.h>
|
2017-09-06 15:09:18 +02:00
|
|
|
#include <openrct2/sprites.h>
|
2017-12-13 13:02:24 +01:00
|
|
|
#include <openrct2/util/Util.h>
|
2016-01-20 23:45:09 +01:00
|
|
|
|
2018-05-16 20:41:29 +02:00
|
|
|
// clang-format off
|
2016-01-20 23:45:09 +01:00
|
|
|
enum WINDOW_PLAYER_PAGE {
|
2017-06-06 23:24:18 +02:00
|
|
|
WINDOW_PLAYER_PAGE_OVERVIEW,
|
|
|
|
WINDOW_PLAYER_PAGE_STATISTICS,
|
2016-01-20 23:45:09 +01:00
|
|
|
};
|
|
|
|
|
2016-02-11 01:09:10 +01:00
|
|
|
#pragma region Widgets
|
|
|
|
|
2016-01-20 23:45:09 +01:00
|
|
|
enum WINDOW_PLAYER_WIDGET_IDX {
|
2017-06-06 23:24:18 +02:00
|
|
|
WIDX_BACKGROUND,
|
|
|
|
WIDX_TITLE,
|
|
|
|
WIDX_CLOSE,
|
|
|
|
WIDX_PAGE_BACKGROUND,
|
|
|
|
WIDX_TAB_1,
|
|
|
|
WIDX_TAB_2,
|
|
|
|
|
|
|
|
WIDX_GROUP = 6,
|
|
|
|
WIDX_GROUP_DROPDOWN,
|
|
|
|
WIDX_LOCATE,
|
|
|
|
WIDX_KICK,
|
|
|
|
WIDX_VIEWPORT,
|
2016-01-20 23:45:09 +01:00
|
|
|
};
|
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
#define WINDOW_PLAYER_COMMON_WIDGETS \
|
|
|
|
{ WWT_FRAME, 0, 0, 191, 0, 156, 0xFFFFFFFF, STR_NONE }, /* Panel / Background */ \
|
|
|
|
{ WWT_CAPTION, 0, 1, 190, 1, 14, STR_STRING, STR_WINDOW_TITLE_TIP }, /* Title */ \
|
|
|
|
{ WWT_CLOSEBOX, 0, 179, 189, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP }, /* Close x button */ \
|
|
|
|
{ WWT_RESIZE, 1, 0, 191, 43, 156, 0xFFFFFFFF, STR_NONE }, /* Resize */ \
|
2017-07-20 20:56:29 +02:00
|
|
|
{ WWT_TAB, 1, 3, 33, 17, 43, IMAGE_TYPE_REMAP | SPR_TAB, STR_NONE }, /* Tab 1 */ \
|
|
|
|
{ WWT_TAB, 1, 34, 64, 17, 43, IMAGE_TYPE_REMAP | SPR_TAB, STR_NONE } /* Tab 2 */
|
2016-02-11 01:09:10 +01:00
|
|
|
|
2017-10-09 17:13:14 +02:00
|
|
|
static rct_widget window_player_overview_widgets[] = {
|
2017-06-06 23:24:18 +02:00
|
|
|
WINDOW_PLAYER_COMMON_WIDGETS,
|
|
|
|
{ WWT_DROPDOWN, 1, 3, 177, 46, 57, 0xFFFFFFFF, STR_NONE }, // Permission group
|
2018-01-03 20:30:58 +01:00
|
|
|
{ WWT_BUTTON, 1, 167, 177, 47, 56, STR_DROPDOWN_GLYPH, STR_NONE }, //
|
2017-06-06 23:24:18 +02:00
|
|
|
{ WWT_FLATBTN, 1, 179, 190, 45, 68, SPR_LOCATE, STR_LOCATE_PLAYER_TIP }, // Locate button
|
|
|
|
{ WWT_FLATBTN, 1, 179, 190, 69, 92, SPR_DEMOLISH, STR_KICK_PLAYER_TIP }, // Kick button
|
|
|
|
{ WWT_VIEWPORT, 1, 3, 177, 60, 120, 0xFFFFFFFF, STR_NONE }, // Viewport
|
|
|
|
{ WIDGETS_END },
|
2016-02-11 01:09:10 +01:00
|
|
|
};
|
|
|
|
|
2017-10-09 17:13:14 +02:00
|
|
|
static rct_widget window_player_statistics_widgets[] = {
|
2017-06-06 23:24:18 +02:00
|
|
|
WINDOW_PLAYER_COMMON_WIDGETS,
|
|
|
|
{ WIDGETS_END },
|
2016-01-20 23:45:09 +01:00
|
|
|
};
|
|
|
|
|
2017-10-09 17:13:14 +02:00
|
|
|
static rct_widget *window_player_page_widgets[] = {
|
2017-06-06 23:24:18 +02:00
|
|
|
window_player_overview_widgets,
|
|
|
|
window_player_statistics_widgets
|
2016-01-20 23:45:09 +01:00
|
|
|
};
|
|
|
|
|
2016-02-11 01:09:10 +01:00
|
|
|
#pragma endregion
|
|
|
|
|
|
|
|
#pragma region Events
|
2016-01-20 23:45:09 +01:00
|
|
|
|
2017-08-06 14:41:13 +02:00
|
|
|
static void window_player_overview_close(rct_window *w);
|
|
|
|
static void window_player_overview_mouse_up(rct_window *w, rct_widgetindex widgetIndex);
|
|
|
|
static void window_player_overview_resize(rct_window *w);
|
|
|
|
static void window_player_overview_mouse_down(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
2018-06-20 17:28:51 +02:00
|
|
|
static void window_player_overview_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
2017-08-06 14:41:13 +02:00
|
|
|
static void window_player_overview_update(rct_window* w);
|
|
|
|
static void window_player_overview_invalidate(rct_window *w);
|
|
|
|
static void window_player_overview_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
2016-01-20 23:45:09 +01:00
|
|
|
|
|
|
|
static rct_window_event_list window_player_overview_events = {
|
2017-06-06 23:24:18 +02:00
|
|
|
window_player_overview_close,
|
|
|
|
window_player_overview_mouse_up,
|
|
|
|
window_player_overview_resize,
|
|
|
|
window_player_overview_mouse_down,
|
|
|
|
window_player_overview_dropdown,
|
2017-08-15 10:07:44 +02:00
|
|
|
nullptr,
|
2017-06-06 23:24:18 +02:00
|
|
|
window_player_overview_update,
|
2017-08-15 10:07:44 +02:00
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
2017-06-06 23:24:18 +02:00
|
|
|
window_player_overview_invalidate,
|
|
|
|
window_player_overview_paint,
|
2017-08-15 10:07:44 +02:00
|
|
|
nullptr
|
2016-01-20 23:45:09 +01:00
|
|
|
};
|
|
|
|
|
2017-08-06 14:41:13 +02:00
|
|
|
static void window_player_statistics_close(rct_window *w);
|
|
|
|
static void window_player_statistics_mouse_up(rct_window *w, rct_widgetindex widgetIndex);
|
|
|
|
static void window_player_statistics_resize(rct_window *w);
|
|
|
|
static void window_player_statistics_update(rct_window* w);
|
|
|
|
static void window_player_statistics_invalidate(rct_window *w);
|
|
|
|
static void window_player_statistics_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
2016-02-11 01:09:10 +01:00
|
|
|
|
|
|
|
static rct_window_event_list window_player_statistics_events = {
|
2017-06-06 23:24:18 +02:00
|
|
|
window_player_statistics_close,
|
|
|
|
window_player_statistics_mouse_up,
|
|
|
|
window_player_statistics_resize,
|
2017-08-15 10:07:44 +02:00
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
2017-06-06 23:24:18 +02:00
|
|
|
window_player_statistics_update,
|
2017-08-15 10:07:44 +02:00
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
2017-06-06 23:24:18 +02:00
|
|
|
window_player_statistics_invalidate,
|
|
|
|
window_player_statistics_paint,
|
2017-08-15 10:07:44 +02:00
|
|
|
nullptr
|
2016-02-11 01:09:10 +01:00
|
|
|
};
|
|
|
|
|
2016-01-20 23:45:09 +01:00
|
|
|
static rct_window_event_list *window_player_page_events[] = {
|
2017-06-06 23:24:18 +02:00
|
|
|
&window_player_overview_events,
|
|
|
|
&window_player_statistics_events
|
2016-01-20 23:45:09 +01:00
|
|
|
};
|
|
|
|
|
2016-02-11 01:09:10 +01:00
|
|
|
#pragma endregion
|
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
static void window_player_set_page(rct_window* w, int32_t page);
|
2016-02-11 01:09:10 +01:00
|
|
|
static void window_player_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
|
|
|
|
static void window_player_update_viewport(rct_window *w, bool scroll);
|
2016-04-20 08:16:17 +02:00
|
|
|
static void window_player_update_title(rct_window* w);
|
2016-02-11 01:09:10 +01:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
static uint32_t window_player_page_enabled_widgets[] = {
|
2017-06-06 23:24:18 +02:00
|
|
|
(1 << WIDX_CLOSE) |
|
|
|
|
(1 << WIDX_TAB_1) |
|
|
|
|
(1 << WIDX_TAB_2) |
|
|
|
|
(1 << WIDX_GROUP) |
|
|
|
|
(1 << WIDX_GROUP_DROPDOWN) |
|
|
|
|
(1 << WIDX_LOCATE) |
|
|
|
|
(1 << WIDX_KICK),
|
|
|
|
|
|
|
|
(1 << WIDX_CLOSE) |
|
|
|
|
(1 << WIDX_TAB_1) |
|
|
|
|
(1 << WIDX_TAB_2)
|
2016-01-20 23:45:09 +01:00
|
|
|
};
|
2018-05-16 20:41:29 +02:00
|
|
|
// clang-format on
|
2016-01-20 23:45:09 +01:00
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
rct_window* window_player_open(uint8_t id)
|
2016-02-11 01:09:10 +01:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
rct_window* window;
|
|
|
|
|
|
|
|
window = window_bring_to_front_by_number(WC_PLAYER, id);
|
2018-06-22 23:21:44 +02:00
|
|
|
if (window == nullptr)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window = window_create_auto_pos(240, 170, &window_player_overview_events, WC_PLAYER, WF_RESIZABLE);
|
|
|
|
window->number = id;
|
|
|
|
window->page = 0;
|
|
|
|
window->viewport_focus_coordinates.y = 0;
|
|
|
|
window->frame_no = 0;
|
|
|
|
window->list_information_type = 0;
|
|
|
|
window->picked_peep_frame = 0;
|
|
|
|
window->highlighted_item = 0;
|
|
|
|
window->min_width = 210;
|
|
|
|
window->min_height = 134;
|
|
|
|
window->max_width = 500;
|
|
|
|
window->max_height = 450;
|
|
|
|
window->no_list_items = 0;
|
|
|
|
window->selected_list_item = -1;
|
|
|
|
|
|
|
|
window->viewport_focus_coordinates.y = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
window->page = 0;
|
2019-06-15 17:20:16 +02:00
|
|
|
window->Invalidate();
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
window->widgets = window_player_page_widgets[WINDOW_PLAYER_PAGE_OVERVIEW];
|
|
|
|
window->enabled_widgets = window_player_page_enabled_widgets[WINDOW_PLAYER_PAGE_OVERVIEW];
|
|
|
|
window->hold_down_widgets = 0;
|
|
|
|
window->event_handlers = window_player_page_events[WINDOW_PLAYER_PAGE_OVERVIEW];
|
|
|
|
window->pressed_widgets = 0;
|
|
|
|
|
|
|
|
window_init_scroll_widgets(window);
|
|
|
|
window_player_set_page(window, WINDOW_PLAYER_PAGE_OVERVIEW);
|
2017-09-06 15:09:18 +02:00
|
|
|
|
|
|
|
return window;
|
2016-01-20 23:45:09 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
static void window_player_overview_show_group_dropdown(rct_window* w, rct_widget* widget)
|
2016-01-20 23:45:09 +01:00
|
|
|
{
|
2018-06-22 23:21:44 +02:00
|
|
|
rct_widget* dropdownWidget;
|
2018-06-20 17:28:51 +02:00
|
|
|
int32_t numItems, i;
|
2020-04-18 13:32:48 +02:00
|
|
|
int32_t player = network_get_player_index(static_cast<uint8_t>(w->number));
|
2018-06-22 23:21:44 +02:00
|
|
|
if (player == -1)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
dropdownWidget = widget - 1;
|
|
|
|
|
|
|
|
numItems = network_get_num_groups();
|
|
|
|
|
|
|
|
window_dropdown_show_text_custom_width(
|
2020-05-01 20:48:20 +02:00
|
|
|
{ w->windowPos.x + dropdownWidget->left, w->windowPos.y + dropdownWidget->top },
|
2020-03-01 20:32:35 +01:00
|
|
|
dropdownWidget->bottom - dropdownWidget->top + 1, w->colours[1], 0, 0, numItems, widget->right - dropdownWidget->left);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
for (i = 0; i < network_get_num_groups(); i++)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM;
|
2020-04-18 13:32:48 +02:00
|
|
|
gDropdownItemsArgs[i] = reinterpret_cast<uintptr_t>(network_get_group_name(i));
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
dropdown_set_checked(network_get_group_index(network_get_player_group(player)), true);
|
2016-01-20 23:45:09 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_overview_close(rct_window* w)
|
2016-01-20 23:45:09 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_overview_mouse_up(rct_window* w, rct_widgetindex widgetIndex)
|
2016-01-20 23:45:09 +01:00
|
|
|
{
|
2018-06-22 23:21:44 +02:00
|
|
|
switch (widgetIndex)
|
|
|
|
{
|
|
|
|
case WIDX_CLOSE:
|
|
|
|
window_close(w);
|
|
|
|
break;
|
|
|
|
case WIDX_TAB_1:
|
|
|
|
case WIDX_TAB_2:
|
|
|
|
window_player_set_page(w, widgetIndex - WIDX_TAB_1);
|
|
|
|
break;
|
|
|
|
case WIDX_LOCATE:
|
|
|
|
{
|
|
|
|
rct_window* mainWindow = window_get_main();
|
|
|
|
if (mainWindow != nullptr)
|
|
|
|
{
|
2020-04-18 13:32:48 +02:00
|
|
|
int32_t player = network_get_player_index(static_cast<uint8_t>(w->number));
|
2018-06-22 23:21:44 +02:00
|
|
|
if (player == -1)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2019-12-19 21:48:20 +01:00
|
|
|
auto coord = network_get_player_last_action_coord(player);
|
2018-06-22 23:21:44 +02:00
|
|
|
if (coord.x || coord.y || coord.z)
|
|
|
|
{
|
|
|
|
window_scroll_to_location(mainWindow, coord.x, coord.y, coord.z);
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2018-06-22 23:21:44 +02:00
|
|
|
case WIDX_KICK:
|
2019-05-12 19:54:41 +02:00
|
|
|
{
|
|
|
|
auto kickPlayerAction = PlayerKickAction(w->number);
|
|
|
|
GameActions::Execute(&kickPlayerAction);
|
|
|
|
}
|
|
|
|
break;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-01-20 23:45:09 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_overview_mouse_down(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget)
|
2016-01-20 23:45:09 +01:00
|
|
|
{
|
2018-06-22 23:21:44 +02:00
|
|
|
switch (widgetIndex)
|
|
|
|
{
|
|
|
|
case WIDX_GROUP_DROPDOWN:
|
|
|
|
window_player_overview_show_group_dropdown(w, widget);
|
|
|
|
break;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-01-20 23:45:09 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
2016-01-20 23:45:09 +01:00
|
|
|
{
|
2020-04-18 13:32:48 +02:00
|
|
|
int32_t player = network_get_player_index(static_cast<uint8_t>(w->number));
|
2018-06-22 23:21:44 +02:00
|
|
|
if (player == -1)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
2018-06-22 23:21:44 +02:00
|
|
|
if (dropdownIndex == -1)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
2018-06-20 17:28:51 +02:00
|
|
|
int32_t group = network_get_group_id(dropdownIndex);
|
2019-05-01 17:54:12 +02:00
|
|
|
auto playerSetGroupAction = PlayerSetGroupAction(w->number, group);
|
|
|
|
playerSetGroupAction.SetCallback([=](const GameAction* ga, const GameActionResult* result) {
|
|
|
|
if (result->Error == GA_ERROR::OK)
|
|
|
|
{
|
2019-06-15 17:20:16 +02:00
|
|
|
w->Invalidate();
|
2019-05-01 17:54:12 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
GameActions::Execute(&playerSetGroupAction);
|
2016-01-20 23:45:09 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_overview_resize(rct_window* w)
|
2016-02-11 01:09:10 +01:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_set_resize(w, 240, 170, 500, 300);
|
2016-01-20 23:45:09 +01:00
|
|
|
}
|
|
|
|
|
2016-02-11 01:09:10 +01:00
|
|
|
void window_player_overview_update(rct_window* w)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
w->frame_no++;
|
|
|
|
widget_invalidate(w, WIDX_TAB_1 + w->page);
|
|
|
|
|
2020-04-18 13:32:48 +02:00
|
|
|
if (network_get_player_index(static_cast<uint8_t>(w->number)) == -1)
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_close(w);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update viewport
|
|
|
|
bool scroll = true;
|
|
|
|
|
|
|
|
// Use this spare window field for rotation check
|
2018-06-22 23:21:44 +02:00
|
|
|
if (w->var_4AE != get_current_rotation())
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
w->var_4AE = get_current_rotation();
|
|
|
|
scroll = false;
|
|
|
|
}
|
|
|
|
window_player_update_viewport(w, scroll);
|
2016-01-20 23:45:09 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_overview_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
2016-01-20 23:45:09 +01:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_draw_widgets(w, dpi);
|
|
|
|
window_player_draw_tab_images(dpi, w);
|
|
|
|
|
2020-04-18 13:32:48 +02:00
|
|
|
int32_t player = network_get_player_index(static_cast<uint8_t>(w->number));
|
2018-06-22 23:21:44 +02:00
|
|
|
if (player == -1)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Draw current group
|
2018-06-20 17:28:51 +02:00
|
|
|
int32_t groupindex = network_get_group_index(network_get_player_group(player));
|
2018-06-22 23:21:44 +02:00
|
|
|
if (groupindex != -1)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
rct_widget* widget = &window_player_overview_widgets[WIDX_GROUP];
|
|
|
|
char buffer[300];
|
|
|
|
char* lineCh;
|
|
|
|
lineCh = buffer;
|
|
|
|
lineCh = utf8_write_codepoint(lineCh, FORMAT_WINDOW_COLOUR_2);
|
|
|
|
safe_strcpy(lineCh, network_get_group_name(groupindex), sizeof(buffer) - (lineCh - buffer));
|
2018-06-22 23:21:44 +02:00
|
|
|
set_format_arg(0, const char*, buffer);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
gfx_draw_string_centred_clipped(
|
2020-03-01 20:32:35 +01:00
|
|
|
dpi, STR_STRING, gCommonFormatArgs, COLOUR_BLACK, w->windowPos.x + (widget->left + widget->right - 11) / 2,
|
|
|
|
w->windowPos.y + widget->top, widget->right - widget->left - 8);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Draw ping
|
2020-05-10 14:49:15 +02:00
|
|
|
auto screenCoords = ScreenCoordsXY{ w->windowPos.x + 90, w->windowPos.y + 24 };
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
set_format_arg(0, rct_string_id, STR_PING);
|
2020-05-10 14:49:15 +02:00
|
|
|
gfx_draw_string_left(dpi, STR_WINDOW_COLOUR_2_STRINGID, gCommonFormatArgs, 0, screenCoords.x, screenCoords.y);
|
2017-06-06 23:24:18 +02:00
|
|
|
char ping[64];
|
|
|
|
snprintf(ping, 64, "%d ms", network_get_player_ping(player));
|
2020-05-10 14:49:15 +02:00
|
|
|
gfx_draw_string(dpi, ping, w->colours[2], screenCoords + ScreenCoordsXY(30, 0));
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
// Draw last action
|
2020-05-10 14:49:15 +02:00
|
|
|
screenCoords = { w->windowPos.x + (w->width / 2), w->windowPos.y + w->height - 13 };
|
2018-06-20 17:28:51 +02:00
|
|
|
int32_t width = w->width - 8;
|
|
|
|
int32_t lastaction = network_get_player_last_action(player, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
set_format_arg(0, rct_string_id, STR_ACTION_NA);
|
2018-06-22 23:21:44 +02:00
|
|
|
if (lastaction != -999)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
set_format_arg(0, rct_string_id, network_get_action_name_string_id(lastaction));
|
|
|
|
}
|
2020-05-10 14:49:15 +02:00
|
|
|
gfx_draw_string_centred_clipped(
|
|
|
|
dpi, STR_LAST_ACTION_RAN, gCommonFormatArgs, COLOUR_BLACK, screenCoords.x, screenCoords.y, width);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
if (w->viewport != nullptr && w->var_492 != -1)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_draw_viewport(dpi, w);
|
|
|
|
}
|
2016-01-20 23:45:09 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_overview_invalidate(rct_window* w)
|
2016-01-20 23:45:09 +01:00
|
|
|
{
|
2020-04-18 13:32:48 +02:00
|
|
|
int32_t playerIndex = network_get_player_index(static_cast<uint8_t>(w->number));
|
2019-03-15 01:40:43 +01:00
|
|
|
if (playerIndex == -1)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
if (window_player_page_widgets[w->page] != w->widgets)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
w->widgets = window_player_page_widgets[w->page];
|
|
|
|
window_init_scroll_widgets(w);
|
|
|
|
}
|
|
|
|
|
|
|
|
w->pressed_widgets &= ~(WIDX_TAB_1);
|
|
|
|
w->pressed_widgets &= ~(WIDX_TAB_2);
|
|
|
|
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
|
|
|
|
|
|
|
|
window_player_update_title(w);
|
|
|
|
|
|
|
|
w->widgets[WIDX_BACKGROUND].right = w->width - 1;
|
|
|
|
w->widgets[WIDX_BACKGROUND].bottom = w->height - 1;
|
2018-06-22 23:21:44 +02:00
|
|
|
w->widgets[WIDX_PAGE_BACKGROUND].right = w->width - 1;
|
2017-06-06 23:24:18 +02:00
|
|
|
w->widgets[WIDX_PAGE_BACKGROUND].bottom = w->height - 1;
|
|
|
|
w->widgets[WIDX_TITLE].right = w->width - 2;
|
|
|
|
w->widgets[WIDX_CLOSE].left = w->width - 13;
|
|
|
|
w->widgets[WIDX_CLOSE].right = w->width - 3;
|
|
|
|
w->widgets[WIDX_LOCATE].right = w->width - 2;
|
|
|
|
w->widgets[WIDX_LOCATE].left = w->width - 25;
|
|
|
|
w->widgets[WIDX_KICK].right = w->width - 2;
|
|
|
|
w->widgets[WIDX_KICK].left = w->width - 25;
|
|
|
|
w->widgets[WIDX_VIEWPORT].right = w->width - 26;
|
|
|
|
w->widgets[WIDX_VIEWPORT].bottom = w->height - 14;
|
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
int32_t groupDropdownWidth = w->widgets[WIDX_GROUP].right - w->widgets[WIDX_GROUP].left;
|
2017-06-06 23:24:18 +02:00
|
|
|
w->widgets[WIDX_GROUP].left = (w->width - groupDropdownWidth) / 2;
|
|
|
|
w->widgets[WIDX_GROUP].right = w->widgets[WIDX_GROUP].left + groupDropdownWidth;
|
|
|
|
w->widgets[WIDX_GROUP_DROPDOWN].left = w->widgets[WIDX_GROUP].right - 10;
|
|
|
|
w->widgets[WIDX_GROUP_DROPDOWN].right = w->widgets[WIDX_GROUP].right;
|
|
|
|
|
|
|
|
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_2);
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
rct_viewport* viewport = w->viewport;
|
|
|
|
if (viewport != nullptr)
|
|
|
|
{
|
|
|
|
rct_widget* viewportWidget = &window_player_overview_widgets[WIDX_VIEWPORT];
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2020-03-01 20:32:35 +01:00
|
|
|
viewport->pos = w->windowPos + ScreenCoordsXY{ viewportWidget->left, viewportWidget->top };
|
2017-06-06 23:24:18 +02:00
|
|
|
viewport->width = viewportWidget->right - viewportWidget->left;
|
|
|
|
viewport->height = viewportWidget->bottom - viewportWidget->top;
|
2020-02-20 01:18:05 +01:00
|
|
|
viewport->view_width = viewport->width * viewport->zoom;
|
|
|
|
viewport->view_height = viewport->height * viewport->zoom;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2019-02-20 22:18:40 +01:00
|
|
|
|
|
|
|
// Only enable kick button for other players
|
2019-02-20 22:30:12 +01:00
|
|
|
const bool canKick = network_can_perform_action(network_get_current_player_group_index(), NETWORK_PERMISSION_KICK_PLAYER);
|
2019-03-15 01:40:43 +01:00
|
|
|
const bool isServer = network_get_player_flags(playerIndex) & NETWORK_PLAYER_FLAG_ISSERVER;
|
2019-02-20 22:18:40 +01:00
|
|
|
const bool isOwnWindow = (network_get_current_player_id() == w->number);
|
|
|
|
widget_set_enabled(w, WIDX_KICK, canKick && !isOwnWindow && !isServer);
|
2016-02-11 01:09:10 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_statistics_close(rct_window* w)
|
2016-02-11 01:09:10 +01:00
|
|
|
{
|
2018-06-22 23:21:44 +02:00
|
|
|
if (w->error.var_480)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
w->error.var_480 = 0;
|
|
|
|
}
|
2016-02-11 01:09:10 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_statistics_mouse_up(rct_window* w, rct_widgetindex widgetIndex)
|
2016-02-11 01:09:10 +01:00
|
|
|
{
|
2018-06-22 23:21:44 +02:00
|
|
|
switch (widgetIndex)
|
|
|
|
{
|
|
|
|
case WIDX_CLOSE:
|
|
|
|
window_close(w);
|
|
|
|
break;
|
|
|
|
case WIDX_TAB_1:
|
|
|
|
case WIDX_TAB_2:
|
|
|
|
window_player_set_page(w, widgetIndex - WIDX_TAB_1);
|
|
|
|
break;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-02-11 01:09:10 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_statistics_resize(rct_window* w)
|
2016-02-11 01:09:10 +01:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_set_resize(w, 210, 80, 210, 80);
|
2016-02-11 01:09:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void window_player_statistics_update(rct_window* w)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
w->frame_no++;
|
|
|
|
widget_invalidate(w, WIDX_TAB_1 + w->page);
|
2016-02-11 01:09:10 +01:00
|
|
|
|
2020-04-18 13:32:48 +02:00
|
|
|
if (network_get_player_index(static_cast<uint8_t>(w->number)) == -1)
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_close(w);
|
|
|
|
}
|
2016-02-11 01:09:10 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_statistics_invalidate(rct_window* w)
|
2016-02-11 01:09:10 +01:00
|
|
|
{
|
2018-06-22 23:21:44 +02:00
|
|
|
if (window_player_page_widgets[w->page] != w->widgets)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
w->widgets = window_player_page_widgets[w->page];
|
|
|
|
window_init_scroll_widgets(w);
|
|
|
|
}
|
|
|
|
|
|
|
|
w->pressed_widgets &= ~(WIDX_TAB_1);
|
|
|
|
w->pressed_widgets &= ~(WIDX_TAB_2);
|
|
|
|
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
|
|
|
|
|
|
|
|
window_player_update_title(w);
|
|
|
|
|
|
|
|
w->widgets[WIDX_BACKGROUND].right = w->width - 1;
|
|
|
|
w->widgets[WIDX_BACKGROUND].bottom = w->height - 1;
|
|
|
|
w->widgets[WIDX_PAGE_BACKGROUND].right = w->width - 1;
|
|
|
|
w->widgets[WIDX_PAGE_BACKGROUND].bottom = w->height - 1;
|
|
|
|
w->widgets[WIDX_TITLE].right = w->width - 2;
|
|
|
|
w->widgets[WIDX_CLOSE].left = w->width - 13;
|
|
|
|
w->widgets[WIDX_CLOSE].right = w->width - 3;
|
|
|
|
|
|
|
|
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_2);
|
2016-02-11 01:09:10 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
void window_player_statistics_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
2016-02-11 01:09:10 +01:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_draw_widgets(w, dpi);
|
|
|
|
window_player_draw_tab_images(dpi, w);
|
2016-02-11 01:09:10 +01:00
|
|
|
|
2020-04-18 13:32:48 +02:00
|
|
|
int32_t player = network_get_player_index(static_cast<uint8_t>(w->number));
|
2018-06-22 23:21:44 +02:00
|
|
|
if (player == -1)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
2016-02-11 01:09:10 +01:00
|
|
|
|
2020-03-01 20:32:35 +01:00
|
|
|
int32_t x = w->windowPos.x + window_player_overview_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
|
|
|
int32_t y = w->windowPos.y + window_player_overview_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
2016-02-11 01:09:10 +01:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
set_format_arg(0, uint32_t, network_get_player_commands_ran(player));
|
2017-06-06 23:24:18 +02:00
|
|
|
gfx_draw_string_left(dpi, STR_COMMANDS_RAN, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
2016-02-11 01:09:10 +01:00
|
|
|
|
2018-03-09 20:49:27 +01:00
|
|
|
y += LIST_ROW_HEIGHT;
|
2016-11-13 20:17:49 +01:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
set_format_arg(0, uint32_t, network_get_player_money_spent(player));
|
2017-06-06 23:24:18 +02:00
|
|
|
gfx_draw_string_left(dpi, STR_MONEY_SPENT, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
2016-02-11 01:09:10 +01:00
|
|
|
}
|
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
static void window_player_set_page(rct_window* w, int32_t page)
|
2016-02-11 01:09:10 +01:00
|
|
|
{
|
2018-06-20 17:28:51 +02:00
|
|
|
int32_t originalPage = w->page;
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
w->page = page;
|
|
|
|
w->frame_no = 0;
|
|
|
|
w->no_list_items = 0;
|
|
|
|
w->selected_list_item = -1;
|
|
|
|
|
|
|
|
w->enabled_widgets = window_player_page_enabled_widgets[page];
|
|
|
|
w->hold_down_widgets = 0;
|
|
|
|
w->event_handlers = window_player_page_events[page];
|
|
|
|
w->pressed_widgets = 0;
|
|
|
|
w->widgets = window_player_page_widgets[page];
|
2019-06-15 17:20:16 +02:00
|
|
|
w->Invalidate();
|
2017-06-06 23:24:18 +02:00
|
|
|
window_event_resize_call(w);
|
|
|
|
window_event_invalidate_call(w);
|
|
|
|
window_init_scroll_widgets(w);
|
2019-06-15 17:20:16 +02:00
|
|
|
w->Invalidate();
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
if (page == WINDOW_PLAYER_PAGE_OVERVIEW)
|
|
|
|
{
|
|
|
|
if (w->viewport == nullptr)
|
|
|
|
{
|
2020-03-01 05:53:21 +01:00
|
|
|
viewport_create(
|
2020-03-01 20:32:35 +01:00
|
|
|
w, w->windowPos, w->width, w->height, 0, TileCoordsXYZ(128, 128, 0).ToCoordsXYZ(), 1, SPRITE_INDEX_NULL);
|
2017-06-06 23:24:18 +02:00
|
|
|
w->flags |= WF_NO_SCROLLING;
|
|
|
|
window_event_invalidate_call(w);
|
|
|
|
window_player_update_viewport(w, false);
|
2018-06-22 23:21:44 +02:00
|
|
|
}
|
|
|
|
else if (originalPage != page)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_event_invalidate_call(w);
|
|
|
|
window_player_update_viewport(w, false);
|
|
|
|
}
|
2018-06-22 23:21:44 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (w->viewport != nullptr)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
w->viewport->width = 0;
|
2017-08-15 10:07:44 +02:00
|
|
|
w->viewport = nullptr;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
2016-02-11 01:09:10 +01:00
|
|
|
}
|
2016-01-20 23:45:09 +01:00
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
static void window_player_draw_tab_images(rct_drawpixelinfo* dpi, rct_window* w)
|
2016-02-11 01:09:10 +01:00
|
|
|
{
|
2018-06-22 23:21:44 +02:00
|
|
|
rct_widget* widget;
|
2018-06-20 17:28:51 +02:00
|
|
|
int32_t x, y, imageId;
|
2017-06-06 23:24:18 +02:00
|
|
|
|
|
|
|
// Tab 1
|
2018-06-22 23:21:44 +02:00
|
|
|
if (!widget_is_disabled(w, WIDX_TAB_1))
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
widget = &w->widgets[WIDX_TAB_1];
|
2020-03-01 20:32:35 +01:00
|
|
|
x = widget->left + w->windowPos.x;
|
|
|
|
y = widget->top + w->windowPos.y;
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = SPR_PEEP_LARGE_FACE_NORMAL;
|
|
|
|
gfx_draw_sprite(dpi, imageId, x, y, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tab 2
|
2018-06-22 23:21:44 +02:00
|
|
|
if (!widget_is_disabled(w, WIDX_TAB_2))
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
widget = &w->widgets[WIDX_TAB_2];
|
2020-03-01 20:32:35 +01:00
|
|
|
x = widget->left + w->windowPos.x;
|
|
|
|
y = widget->top + w->windowPos.y;
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId = SPR_TAB_FINANCES_SUMMARY_0;
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
if (w->page == WINDOW_PLAYER_PAGE_STATISTICS)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
imageId += (w->frame_no / 2) & 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
gfx_draw_sprite(dpi, imageId, x, y, 0);
|
|
|
|
}
|
2016-01-20 23:45:09 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
static void window_player_update_viewport(rct_window* w, bool scroll)
|
2016-02-11 01:09:10 +01:00
|
|
|
{
|
2020-04-18 13:32:48 +02:00
|
|
|
int32_t playerIndex = network_get_player_index(static_cast<uint8_t>(w->number));
|
2018-06-22 23:21:44 +02:00
|
|
|
if (playerIndex == -1)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
rct_viewport* viewport = w->viewport;
|
|
|
|
if (viewport != nullptr)
|
|
|
|
{
|
2019-12-19 21:48:20 +01:00
|
|
|
auto coord = network_get_player_last_action_coord(playerIndex);
|
2018-06-22 23:21:44 +02:00
|
|
|
if (coord.x != 0 || coord.y != 0 || coord.z != 0)
|
|
|
|
{
|
2019-12-19 21:48:20 +01:00
|
|
|
auto centreLoc = centre_2d_coordinates(coord, viewport);
|
2019-11-19 16:30:07 +01:00
|
|
|
if (!centreLoc)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
// Don't scroll if the view was originally undefined
|
2018-06-22 23:21:44 +02:00
|
|
|
if (w->var_492 == -1)
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
scroll = false;
|
|
|
|
}
|
|
|
|
|
2020-03-01 20:32:35 +01:00
|
|
|
if (!scroll || w->savedViewPos != centreLoc)
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
w->flags |= WF_SCROLLING_TO_LOCATION;
|
2020-03-01 20:32:35 +01:00
|
|
|
w->savedViewPos = *centreLoc;
|
2018-06-22 23:21:44 +02:00
|
|
|
if (!scroll)
|
|
|
|
{
|
2020-03-01 13:56:14 +01:00
|
|
|
w->viewport->viewPos = *centreLoc;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
widget_invalidate(w, WIDX_VIEWPORT);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Draw the viewport
|
|
|
|
w->var_492 = 0;
|
2018-06-22 23:21:44 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
// Don't draw the viewport
|
|
|
|
w->var_492 = -1;
|
|
|
|
}
|
|
|
|
}
|
2016-02-11 01:09:10 +01:00
|
|
|
}
|
2016-04-20 08:16:17 +02:00
|
|
|
|
|
|
|
static void window_player_update_title(rct_window* w)
|
|
|
|
{
|
2020-04-18 13:32:48 +02:00
|
|
|
int32_t player = network_get_player_index(static_cast<uint8_t>(w->number));
|
2018-06-22 23:21:44 +02:00
|
|
|
if (player != -1)
|
|
|
|
{
|
|
|
|
set_format_arg(0, const char*, network_get_player_name(player)); // set title caption to player name
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
set_format_arg(0, const char*, "");
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2016-04-20 08:16:17 +02:00
|
|
|
}
|