MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DoPilotTauntScreen

Function DoPilotTauntScreen

Descent3/pilot.cpp:2705–2757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2703#define TAUNT_EDIT_WIDTH 400
2704
2705void DoPilotTauntScreen(pilot *plt) {
2706 newuiTiledWindow taunt_wnd;
2707 newuiSheet *sheet;
2708 char *taunt_edit[MAX_PILOT_TAUNTS];
2709 int cury = 10;
2710 bool exit_menu = false;
2711 int i;
2712
2713 // create window
2714 taunt_wnd.Create(TXT_MULTIPLAYER_TAUNTS, 0, 0, TAUNT_MENU_W, TAUNT_MENU_H);
2715 sheet = taunt_wnd.GetSheet();
2716
2717 // Ok/Cancel buttons
2718 for (i = 0; i < MAX_PILOT_TAUNTS; i++) {
2719 char str[70];
2720
2721 snprintf(str, sizeof(str), "%s%d", TXT_TAUNT_NUMBER, i + 1);
2722 sheet->NewGroup(str, 10, cury);
2723
2724 taunt_edit[i] = sheet->AddEditBox(str, PILOT_TAUNT_SIZE, TAUNT_EDIT_WIDTH);
2725 strcpy(taunt_edit[i], plt->taunts[i]);
2726 cury += 32;
2727 }
2728
2729 sheet->NewGroup(NULL, TAUNT_MENU_W - 210, TAUNT_MENU_H - 100, NEWUI_ALIGN_HORIZ);
2730 sheet->AddButton(TXT_OK, UID_OK);
2731 sheet->AddButton(TXT_CANCEL, UID_CANCEL);
2732
2733 taunt_wnd.Open();
2734
2735 while (!exit_menu) {
2736 int res = taunt_wnd.DoUI();
2737
2738 // handle all UI results.
2739 switch (res) {
2740 case UID_OK:
2741 for (i = 0; i < MAX_PILOT_TAUNTS; i++) {
2742 strcpy(plt->taunts[i], taunt_edit[i]);
2743 // taunt_edit[i].GetText(plt->taunts[i],PILOT_TAUNT_SIZE);
2744 }
2745 exit_menu = true;
2746 break;
2747 case UID_CANCEL:
2748 exit_menu = true;
2749 break;
2750 default:
2751 break;
2752 }
2753 }
2754
2755 taunt_wnd.Close();
2756 taunt_wnd.Destroy();
2757}
2758
2759bool PltSelectShip(pilot *Pilot) {
2760#define IDP_SHPLIST 19

Callers 1

PltSelectShipFunction · 0.85

Calls 9

GetSheetMethod · 0.80
NewGroupMethod · 0.80
AddEditBoxMethod · 0.80
AddButtonMethod · 0.80
CreateMethod · 0.45
OpenMethod · 0.45
DoUIMethod · 0.45
CloseMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected