static void CheckMasterStatus(void) { boolean added; if (!NET_Query_CheckAddedToMaster(&added)) { return; } if (master_msg_label == NULL) { BuildMasterStatusWindow(); } if (added) { TXT_SetLabel(master_msg_label, "Your server is now registered with the global master server.\n" "Other players can find your server online."); } else { TXT_SetLabel(master_msg_label, "Failed to register with the master server. Your server is not\n" "publicly accessible. You may need to reconfigure your Internet\n" "router to add a port forward for UDP port 2342. Look up\n" "information on port forwarding online."); } }
static void VKBUpdateLabel() { char buf[vkb_window->window_w - 5]; if (strlen(vkb_inputbox->buffer) > vkb_window->window_w - 7) { sprintf(buf, "...%s", strchr(vkb_inputbox->buffer, '\0') - vkb_window->window_w - 10); TXT_SetLabel(vkb_label, buf); } else { TXT_SetLabel(vkb_label, vkb_inputbox->buffer); } }
void UpdateInputBox(void) { char buf[20]; TXT_snprintf(buf, sizeof(buf), " %i", input_value); TXT_SetLabel(input_box, buf); }
static void SetCalibrationLabel(void) { char *message = "???"; switch (calibrate_stage) { case CALIBRATE_CENTER: message = "Move the D-pad or joystick to the\n" "center, and press a button."; break; case CALIBRATE_UP: message = "Push the D-pad or joystick up,\n" "and press the button."; break; case CALIBRATE_LEFT: message = "Push the D-pad or joystick to the\n" "left, and press the button."; break; case CALIBRATE_DOWN: message = "Push the D-pad or joystick down,\n" "and press the button."; break; case CALIBRATE_RIGHT: message = "Push the D-pad or joystick to the\n" "right, and press the button."; break; } TXT_SetLabel(calibration_label, message); }
void UpdateLabel(TXT_UNCAST_ARG(widget), void *user_data) { char buf[40]; strcpy(buf, " Current value: "); if (cheesy) { strcat(buf, "Cheesy "); } strcat(buf, radio_values[radiobutton_value]); strcat(buf, "\n"); TXT_SetLabel(value_label, buf); }
txt_label_t *TXT_NewLabel(char *text) { txt_label_t *label; label = malloc(sizeof(txt_label_t)); TXT_InitWidget(label, &txt_label_class); label->label = NULL; label->lines = NULL; // Default colors label->bgcolor = -1; label->fgcolor = -1; TXT_SetLabel(label, text); return label; }
txt_label_t *TXT_NewLabel(char *text) { txt_label_t *label; label = malloc(sizeof(txt_label_t)); TXT_InitWidget(label, &txt_label_class); label->widget.selectable = 0; label->label = NULL; label->lines = NULL; // Default colors label->bgcolor = TXT_COLOR_BLUE; label->fgcolor = TXT_COLOR_BRIGHT_WHITE; TXT_SetLabel(label, text); return label; }
static void SetCalibrationLabel(txt_joystick_axis_t *joystick_axis) { TXT_SetLabel(joystick_axis->config_label, CalibrationLabel(joystick_axis)); }
static void UpdateGUI(void) { txt_window_action_t *startgame; char buf[50]; unsigned int i; // If the value of max_players changes, we must rebuild the // contents of the window. This includes when the first // waiting data packet is received. if (net_client_received_wait_data) { if (net_client_wait_data.max_players != old_max_players) { BuildWindow(); } } else { return; } for (i = 0; i < net_client_wait_data.max_players; ++i) { txt_color_t color = TXT_COLOR_BRIGHT_WHITE; if ((signed) i == net_client_wait_data.consoleplayer) { color = TXT_COLOR_YELLOW; } TXT_SetFGColor(player_labels[i], color); TXT_SetFGColor(ip_labels[i], color); if (i < net_client_wait_data.num_players) { TXT_SetLabel(player_labels[i], net_client_wait_data.player_names[i]); TXT_SetLabel(ip_labels[i], net_client_wait_data.player_addrs[i]); } else { TXT_SetLabel(player_labels[i], ""); TXT_SetLabel(ip_labels[i], ""); } } if (net_client_wait_data.num_drones > 0) { sprintf(buf, " (+%i observer clients)", net_client_wait_data.num_drones); TXT_SetLabel(drone_label, buf); } else { TXT_SetLabel(drone_label, ""); } if (net_client_wait_data.is_controller) { startgame = TXT_NewWindowAction(' ', "Start game"); TXT_SignalConnect(startgame, "pressed", StartGame, NULL); } else { startgame = NULL; } TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, startgame); }