change text depending on if you are client or server (#92)

This commit is contained in:
Isaac 2022-05-18 09:24:56 +10:00 committed by GitHub
parent 897f6712a3
commit a1ac136258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 5 deletions

View File

@ -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);