mpsettingsmgr.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Combat *
  23. * *
  24. * $Archive:: /Commando/Code/Commando/mpsettingsmgr.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 2/06/02 2:39p $*
  29. * *
  30. * $Revision:: 20 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __DLG_MP_SETTINGS_MGR_H
  39. #define __DLG_MP_SETTINGS_MGR_H
  40. #include "wwstring.h"
  41. #include "vector.h"
  42. #include "widestring.h"
  43. #if defined(_MSC_VER)
  44. #pragma warning(push, 3)
  45. #endif
  46. #include <vector>
  47. #include <map>
  48. #if defined(_MSC_VER)
  49. #pragma warning(pop)
  50. #endif
  51. ////////////////////////////////////////////////////////////////
  52. // Forward declarations
  53. ////////////////////////////////////////////////////////////////
  54. ////////////////////////////////////////////////////////////////
  55. //
  56. // MPSettingsMgrClass
  57. //
  58. ////////////////////////////////////////////////////////////////
  59. class MPSettingsMgrClass
  60. {
  61. public:
  62. ////////////////////////////////////////////////////////////////
  63. // Public constants
  64. ////////////////////////////////////////////////////////////////
  65. typedef enum
  66. {
  67. OPTION_ALLOW_PAGES = 1,
  68. OPTION_LANGUAGE_FILTER = 2,
  69. OPTION_ALLOW_FIND = 4,
  70. OPTION_DISPLAY_ASIAN = 8,
  71. OPTION_DISPLAY_NONASIAN = 16,
  72. OPTION_BUDDY_CHAT_ONLY = 32,
  73. OPTION_CLAN_CHAT_ONLY = 64,
  74. OPTION_DEFAULTS = OPTION_ALLOW_PAGES | OPTION_ALLOW_FIND |
  75. OPTION_DISPLAY_ASIAN | OPTION_DISPLAY_NONASIAN,
  76. OPTION_DEFAULTS_LATIN = OPTION_ALLOW_PAGES|OPTION_ALLOW_FIND|OPTION_DISPLAY_NONASIAN,
  77. } OPTION;
  78. ////////////////////////////////////////////////////////////////
  79. // Public methods
  80. ////////////////////////////////////////////////////////////////
  81. //
  82. // Save/load settings
  83. //
  84. static void Load_Settings (void);
  85. //
  86. // Login methods
  87. //
  88. static void Set_Last_Login (const char *name);
  89. static const char * Get_Last_Login (void);
  90. static void Set_Auto_Login (const char *);
  91. static const char * Get_Auto_Login (void);
  92. static void Set_Auto_Password (const char *);
  93. static const char * Get_Auto_Password (void);
  94. #ifdef OBSOLETE
  95. //
  96. // Quickmatch preferences
  97. //
  98. static void Set_QuickMatch_Mode_Preference (const char *mode, int preference);
  99. static int Get_QuickMatch_Mode_Preference (const char *mode);
  100. static void Save_QuickMatch_Mode_Preferences (void);
  101. #endif
  102. //
  103. // Sidebar help
  104. //
  105. static bool Is_Sidebar_Help_Displayed (void) { return DisplaySidebarHelp; }
  106. static void Set_Is_Sidebar_Help_Displayed (bool onoff);
  107. //
  108. // Auto login prompt
  109. //
  110. static bool Is_Auto_Login_Prompt_Enabled (void) { return IsAutoLoginPromptEnabled; }
  111. static void Enable_Auto_Login_Prompt (bool onoff);
  112. //
  113. // Message of the day support
  114. //
  115. static bool Has_MOTD_Been_Viewed (void) { return HasMOTDBeenViewed; }
  116. static void Set_MOTD_Viewed (bool onoff) { HasMOTDBeenViewed = onoff; }
  117. //
  118. // Options
  119. //
  120. static void Set_Option_Flag (OPTION flag, bool onoff);
  121. static bool Get_Option_Flag (OPTION flag) { return (OptionFlags & flag) == flag; }
  122. //
  123. // Alternate skins unlocking
  124. //
  125. static bool Are_Alternate_Skins_Unlocked (void);
  126. private:
  127. ////////////////////////////////////////////////////////////////
  128. // Private methods
  129. ////////////////////////////////////////////////////////////////
  130. ////////////////////////////////////////////////////////////////
  131. // Private member data
  132. ////////////////////////////////////////////////////////////////
  133. static StringClass SelectedLogin;
  134. static StringClass LastLogin;
  135. static StringClass AutoLogin;
  136. static StringClass AutoPassword;
  137. static bool DisplaySidebarHelp;
  138. static bool IsAutoLoginPromptEnabled;
  139. static bool IsIGR;
  140. static bool HasMOTDBeenViewed;
  141. static bool AreSkinsUnlocked;
  142. static int OptionFlags;
  143. #ifdef OBSOLETE
  144. typedef std::map<const char*, int> GameModeMap;
  145. static GameModeMap _mModePrefs;
  146. #endif
  147. };
  148. #endif //__DLG_MP_SETTINGS_MGR_H