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

Function ShowNetgameInfo

Descent3/multi_ui.cpp:1734–1905  ·  view source on GitHub ↗

Display a dialog box showing the information relating to this particular net game

Source from the content-addressed store, hash-verified

1732
1733// Display a dialog box showing the information relating to this particular net game
1734void ShowNetgameInfo(network_game *game) {
1735 char str[200];
1736 int cury = 10;
1737 int exit_menu = 0;
1738 newuiTiledWindow menu_wnd;
1739 newuiListBox *lists;
1740 newuiSheet *sheet;
1741 char *plyr;
1742
1743 ASSERT(game);
1744
1745 menu_wnd.Create(TXT_GAME_INFO, 0, 0, GAME_INFO_MENU_W, GAME_INFO_MENU_H);
1746 sheet = menu_wnd.GetSheet();
1747
1748 sheet->NewGroup(game->name, GAME_INFO_COL1, cury);
1749 cury += 15;
1750 snprintf(str, sizeof(str), TXT_GINFO_MISSION, game->mission_name);
1751 sheet->NewGroup(str, GAME_INFO_COL1, cury);
1752 GAME_INFO_GOTO_NEXT_LINE;
1753
1754 snprintf(str, sizeof(str), TXT_PLAYERS_X_OF_X, game->curr_num_players, game->max_num_players);
1755 sheet->NewGroup(str, GAME_INFO_COL1, cury);
1756 GAME_INFO_GOTO_NEXT_LINE;
1757
1758 const char *szdiff = TXT_ERROR;
1759
1760 switch (game->difficulty) {
1761 case 0:
1762 szdiff = TXT_TRAINEE;
1763 break;
1764 case 1:
1765 szdiff = TXT_ROOKIE;
1766 break;
1767 case 2:
1768 szdiff = TXT_HOTSHOT;
1769 break;
1770 case 3:
1771 szdiff = TXT_ACE;
1772 break;
1773 case 4:
1774 szdiff = TXT_INSANE;
1775 break;
1776 default:
1777 szdiff = TXT_ERROR;
1778 }
1779
1780 snprintf(str, sizeof(str), "%s: %s", TXT_PLTDIFFICULT, szdiff);
1781 sheet->NewGroup(str, GAME_INFO_COL1, cury);
1782 GAME_INFO_GOTO_NEXT_LINE;
1783
1784 const char *mode;
1785 if ((game->flags & NF_PEER_PEER)) {
1786 mode = TXT_GEN_PEERPEER;
1787 } else if ((game->flags & NF_PERMISSABLE)) {
1788 mode = TXT_GEN_PERMISSABLE_CS;
1789 } else {
1790 mode = TXT_GEN_CLIENTSERVER;
1791 }

Callers

nothing calls this directly

Calls 15

CreateSplashScreenFunction · 0.85
RequestPlayerListFunction · 0.85
MultiProcessIncomingFunction · 0.85
PollUIFunction · 0.85
CloseSplashScreenFunction · 0.85
DoMessageBoxFunction · 0.85
GetSheetMethod · 0.80
NewGroupMethod · 0.80
AddListBoxMethod · 0.80
AddButtonMethod · 0.80
CreateMethod · 0.45
RemoveAllMethod · 0.45

Tested by

no test coverage detected