From d8d8eb731a56eae03b1c741193960e9eb4aa2bc4 Mon Sep 17 00:00:00 2001 From: Isaac <62234577+Isaac0-dev@users.noreply.github.com> Date: Wed, 18 May 2022 09:24:56 +1000 Subject: [PATCH] change text depending on if you are client or server (#92) --- src/pc/djui/djui_panel_pause.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/pc/djui/djui_panel_pause.c b/src/pc/djui/djui_panel_pause.c index 16669434..212905ed 100644 --- a/src/pc/djui/djui_panel_pause.c +++ b/src/pc/djui/djui_panel_pause.c @@ -14,10 +14,17 @@ static void djui_panel_pause_quit_yes(UNUSED struct DjuiBase* caller) { } static void djui_panel_pause_quit(struct DjuiBase* caller) { - djui_panel_confirm_create(caller, - "\\#ff0800\\Q\\#1be700\\U\\#00b3ff\\I\\#ffef00\\T", - "Are you sure you want to disconnect?", - djui_panel_pause_quit_yes); + if (gNetworkType == NT_SERVER) { + djui_panel_confirm_create(caller, + "\\#ff0800\\Q\\#1be700\\U\\#00b3ff\\I\\#ffef00\\T", + "Are you sure you want to stop hosting?", + djui_panel_pause_quit_yes); + } else { + djui_panel_confirm_create(caller, + "\\#ff0800\\Q\\#1be700\\U\\#00b3ff\\I\\#ffef00\\T", + "Are you sure you want to disconnect?", + djui_panel_pause_quit_yes); + } } void djui_panel_pause_create(struct DjuiBase* caller) { @@ -48,7 +55,12 @@ void djui_panel_pause_create(struct DjuiBase* caller) { djui_base_set_size(&button2->base, 1.0f, 64); djui_interactable_hook_click(&button2->base, djui_panel_pause_resume); - struct DjuiButton* button3 = djui_button_create(&body->base, "Disconnect"); + struct DjuiButton* button3; + if (gNetworkType == NT_SERVER) { + button3 = djui_button_create(&body->base, "Stop Hosting"); + } else { + button3 = djui_button_create(&body->base, "Disconnect"); + } djui_base_set_size_type(&button3->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&button3->base, 1.0f, 64); djui_interactable_hook_click(&button3->base, djui_panel_pause_quit);