ManaPlus
defaults.cpp
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2010 The Mana Developers
4  * Copyright (C) 2011-2019 The ManaPlus Developers
5  * Copyright (C) 2019-2021 Andrei Karas
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #include "defaults.h"
24 
25 #include "configuration.h"
26 #include "graphicsmanager.h"
27 #include "variabledata.h"
28 
29 #include "being/beingspeech.h"
30 
31 #include "const/render/graphics.h"
32 
33 #include "enums/screendensity.h"
34 
38 
40 
42 
43 #include "render/graphics.h"
44 
45 #include "const/net/net.h"
46 
47 #ifndef USE_SDL2
48 PRAGMA48(GCC diagnostic push)
49 PRAGMA48(GCC diagnostic ignored "-Wshadow")
50 #include <SDL_keyboard.h>
51 PRAGMA48(GCC diagnostic pop)
52 #endif // USE_SDL2
53 
54 #include "debug.h"
55 
56 VariableData* createData(const int defData)
57 {
58  return new IntData(defData);
59 }
60 
61 VariableData* createData(const double defData)
62 {
63  return new FloatData(defData);
64 }
65 
66 VariableData* createData(const float defData)
67 {
68  return new FloatData(defData);
69 }
70 
71 VariableData* createData(const std::string &defData)
72 {
73  return new StringData(defData);
74 }
75 
76 VariableData* createData(const char *const defData)
77 {
78  return new StringData(defData);
79 }
80 
81 VariableData* createData(const bool defData)
82 {
83  return new BoolData(defData);
84 }
85 
86 #define AddDEF(key, value) \
87  configData.insert(std::pair<std::string, VariableData*> \
88  (key, createData(value)))
89 
91 {
92  logger->log("Set config default values to configuration %s",
93  cfg.getFileName().c_str());
94  cfg.cleanDefaults();
95  DefaultsData &configData = cfg.getDefaultValues();
96  AddDEF("OverlayDetail", 2);
97  AddDEF("speechBubbleAlpha", 1.0F);
98  AddDEF("MostUsedServerName0", "server.themanaworld.org");
99  AddDEF("visiblenames", VisibleName::Show);
100  AddDEF("visiblenamespos", VisibleNamePos::Bottom);
102  AddDEF("showgender", true);
103  AddDEF("showlevel", false);
104  AddDEF("showMonstersTakedDamage", true);
105  AddDEF("highlightAttackRange", false);
106  AddDEF("highlightMapPortals", true);
107  AddDEF("highlightMonsterAttackRange", false);
108  AddDEF("chatMaxCharLimit", 512);
109  AddDEF("lowTraffic", true);
110  AddDEF("invertMoveDirection", 0);
111  AddDEF("crazyMoveType", 1);
112  AddDEF("attackWeaponType", 1);
113  AddDEF("quickDropCounter", 1);
114  AddDEF("pickUpType", 5);
115  AddDEF("magicAttackType", 0);
116  AddDEF("attackType", 2);
117  AddDEF("targetingType", 0);
118  AddDEF("followMode", 0);
119  AddDEF("imitationMode", 0);
120  AddDEF("syncPlayerMove", true);
121  AddDEF("syncPlayerMoveDistance", 5);
122  AddDEF("syncPlayerMoveDistanceLegacy", 15);
123  AddDEF("drawPath", false);
124  AddDEF("moveToTargetType", 10);
125  AddDEF("crazyMoveProgram", "mumrsonmdmlon");
126  AddDEF("disableGameModifiers", true);
127  AddDEF("targetDeadPlayers", false);
128  AddDEF("afkMessage", "I am away from keyboard.");
129  AddDEF("afkFormat", 0);
130  AddDEF("particleMaxCount", 3000);
131  AddDEF("particleFastPhysics", CAST_S32(ParticlePhysics::Normal));
132  AddDEF("particleEmitterSkip", 1);
133  AddDEF("particleeffects", true);
134  AddDEF("mapparticleeffects", true);
135  AddDEF("opengl", 0);
136 #ifdef ANDROID
137  AddDEF("screenwidth", 0);
138  AddDEF("screenheight", 0);
139  AddDEF("showScreenJoystick", true);
140  AddDEF("showScreenButtons", true);
141  AddDEF("showBeingPopup", false);
142  AddDEF("mouseDirectionMove", true);
143  AddDEF("showScreenKeyboard", true);
144  AddDEF("fpslimit", 100);
145  AddDEF("showChatColorsList", false);
146  AddDEF("customcursor", false);
147  AddDEF("showDidYouKnow", false);
148  AddDEF("longmouseclick", true);
149 #else // ANDROID
150 
151  AddDEF("screenwidth", defaultScreenWidth);
152  AddDEF("screenheight", defaultScreenHeight);
153  AddDEF("showScreenJoystick", false);
154  AddDEF("showScreenButtons", false);
155  AddDEF("showBeingPopup", true);
156  AddDEF("mouseDirectionMove", false);
157 #ifdef __SWITCH__
158  AddDEF("showScreenKeyboard", true);
159 #else
160  AddDEF("showScreenKeyboard", false);
161 #endif
162  AddDEF("fpslimit", 60);
163  AddDEF("showChatColorsList", true);
164  AddDEF("customcursor", true);
165  AddDEF("showDidYouKnow", true);
166  AddDEF("longmouseclick", false);
167 #endif // ANDROID
168 
169  AddDEF("theme", "jewelry");
170  AddDEF("showEmotesButton", true);
171  AddDEF("screen", false);
172  AddDEF("hwaccel", false);
173 #ifdef __SWITCH__
174  AddDEF("sound", true);
175 #else
176  AddDEF("sound", false);
177 #endif
178  AddDEF("sfxVolume", 100);
179  AddDEF("musicVolume", 60);
180  AddDEF("remember", false);
181  AddDEF("username", "");
182 #ifdef SAVE_PASSWORD
183  AddDEF("password", "");
184 #endif
185  AddDEF("lastCharacter", "");
186  AddDEF("altfpslimit", 5);
187  AddDEF("updatehost", "");
188  AddDEF("screenshotDirectory3", "");
189  AddDEF("useScreenshotDirectorySuffix", true);
190  AddDEF("screenshotDirectorySuffix", "");
191 #ifdef __SWITCH__
192  AddDEF("joystickEnabled", true);
193 #else
194  AddDEF("joystickEnabled", false);
195 #endif
196  AddDEF("upTolerance", 100);
197  AddDEF("downTolerance", 100);
198  AddDEF("leftTolerance", 100);
199  AddDEF("rightTolerance", 100);
200  AddDEF("logNpcInGui", true);
201  AddDEF("download-music", true);
202  AddDEF("guialpha", 0.8F);
203  AddDEF("ChatLogLength", 0);
204  AddDEF("enableChatLog", true);
205  AddDEF("whispertab", true);
206  AddDEF("showownname", true);
207  AddDEF("showpickupparticle", true);
208  AddDEF("showpickupchat", true);
209  AddDEF("ReturnToggles", false);
210  AddDEF("ScrollLaziness", 16);
211  AddDEF("ScrollRadius", 0);
212  AddDEF("ScrollCenterOffsetX", 0);
213  AddDEF("ScrollCenterOffsetY", 0);
214  AddDEF("enableMumble", false);
215  AddDEF("playBattleSound", true);
216  AddDEF("playGuiSound", true);
217  AddDEF("playMusic", true);
218  AddDEF("packetcounters", true);
219  AddDEF("safemode", false);
220  AddDEF("font", "fonts/dejavusans.ttf");
221  AddDEF("boldFont", "fonts/dejavusans-bold.ttf");
222  AddDEF("particleFont", "fonts/dejavusans.ttf");
223  AddDEF("helpFont", "fonts/dejavusansmono.ttf");
224  AddDEF("secureFont", "fonts/dejavusansmono.ttf");
225  AddDEF("japanFont", "fonts/mplus-1p-regular.ttf");
226  AddDEF("chinaFont", "fonts/wqy-microhei.ttf");
227  AddDEF("npcFont", "fonts/dejavusans.ttf");
228  AddDEF("showBackground", true);
229  AddDEF("enableTradeTab", true);
230  AddDEF("cyclePlayers", true);
231  AddDEF("cycleMonsters", true);
232  AddDEF("cycleNPC", true);
233  AddDEF("floorItemsHighlight", true);
234  AddDEF("enableBotCheker", true);
235  AddDEF("removeColors", true);
236  AddDEF("showMagicInDebug", true);
237  AddDEF("allowCommandsInChatTabs", true);
238  AddDEF("serverMsgInDebug", true);
239  AddDEF("hideShopMessages", true);
240  AddDEF("showChatHistory", true);
241  AddDEF("chatMaxLinesLimit", 40);
242  AddDEF("chatColor", 0);
243  AddDEF("showJob", true);
244  AddDEF("updateOnlineList", true);
245  AddDEF("targetOnlyReachable", true);
246  AddDEF("errorsInDebug", true);
247  AddDEF("tradebot", true);
248  AddDEF("debugLog", false);
249  AddDEF("unimplimentedLog", false);
250  AddDEF("drawHotKeys", true);
251  AddDEF("serverAttack", true);
252  AddDEF("autofixPos", false);
253  AddDEF("alphaCache", true);
254  AddDEF("attackMoving", true);
255  AddDEF("attackNext", false);
256  AddDEF("quickStats", true);
257  AddDEF("warpParticle", false);
258  AddDEF("autoShop", false);
259  AddDEF("enableBattleTab", false);
260  AddDEF("showBattleEvents", false);
261  AddDEF("showMobHP", true);
262  AddDEF("showOwnHP", true);
263  AddDEF("usePersistentIP", true);
264  AddDEF("showJobExp", true);
265  AddDEF("showExtMinimaps", false);
266  AddDEF("hideChatInput", true);
267  AddDEF("enableAttackFilter", true);
268  AddDEF("enablePickupFilter", true);
269  AddDEF("securetrades", true);
270  AddDEF("unsecureChars", "IO0@#$");
271  AddDEF("currentTip", 0);
272  AddDEF("useLocalTime", false);
273  AddDEF("enableAdvert", true);
274  AddDEF("enableMapReduce", true);
275  AddDEF("showPlayersStatus", true);
276  AddDEF("beingopacity", false);
277  AddDEF("adjustPerfomance", true);
278  AddDEF("enableAlphaFix", false);
279  AddDEF("disableAdvBeingCaching", true);
280  AddDEF("disableBeingCaching", false);
281  AddDEF("enableReorderSprites", true);
282  AddDEF("showip", false);
283  AddDEF("seflMouseHeal", true);
284  AddDEF("enableLazyScrolling", false);
285  AddDEF("extMouseTargeting", true);
286  AddDEF("showMVP", false);
287  AddDEF("pvpAttackType", 0);
288  AddDEF("lang", "");
289  AddDEF("selectedJoystick", 0);
290  AddDEF("useInactiveJoystick", false);
291  AddDEF("testInfo", "");
292  AddDEF("enableresize", true);
293  AddDEF("noframe", false);
294  AddDEF("groupFriends", true);
295  AddDEF("grabinput", false);
296  AddDEF("usefbo", false);
297  AddDEF("gamma", 1);
298  AddDEF("vsync", 0);
299  AddDEF("enableBuggyServers", true);
300  AddDEF("soundwhisper", "newmessage");
301  AddDEF("soundhighlight", "reminder");
302  AddDEF("soundglobal", "email");
303  AddDEF("sounderror", "error");
304  AddDEF("soundtrade", "start");
305  AddDEF("soundinfo", "notify");
306  AddDEF("soundrequest", "attention");
307  AddDEF("soundguild", "newmessage");
308  AddDEF("soundparty", "newmessage");
309  AddDEF("soundclan", "newmessage");
310  AddDEF("soundshowwindow", "page");
311  AddDEF("soundhidewindow", "book");
312  AddDEF("autohideButtons", true);
313  AddDEF("autohideChat", false);
314  AddDEF("downloadProxy", "");
315  AddDEF("downloadProxyType", 0);
316  AddDEF("downloadProxyTunnel", false);
317  AddDEF("blur", false);
318 #if defined(WIN32) || defined(__APPLE__)
319  AddDEF("centerwindow", true);
320 #else // defined(WIN32) || defined(__APPLE__)
321 
322  AddDEF("centerwindow", false);
323 #endif // defined(WIN32) || defined(__APPLE__)
324 
325  AddDEF("audioFrequency", 44100);
326  AddDEF("audioChannels", 2);
327 #ifdef USE_SDL2
328  AddDEF("repeateDelay", 500);
329  AddDEF("repeateInterval", 30);
330  AddDEF("repeateInterval2", 500);
331 #else // USE_SDL2
332 
333  AddDEF("repeateDelay", SDL_DEFAULT_REPEAT_DELAY);
334  AddDEF("repeateInterval", SDL_DEFAULT_REPEAT_INTERVAL);
335  AddDEF("repeateInterval2", SDL_DEFAULT_REPEAT_DELAY);
336 #endif // USE_SDL2
337 
338  AddDEF("compresstextures", 0);
339  AddDEF("rectangulartextures", false);
340  AddDEF("networksleep", 0);
341  AddDEF("newtextures", true);
342  AddDEF("videodetected", false);
343  AddDEF("hideErased", false);
344  AddDEF("enableDelayedAnimations", true);
345  AddDEF("enableCompoundSpriteDelay", true);
346 #ifdef ANDROID
347  AddDEF("useAtlases", false);
348 #else // ANDROID
349 
350  AddDEF("useAtlases", true);
351 #endif // ANDROID
352 
353  AddDEF("useTextureSampler", false);
354  AddDEF("ministatussaved", 0);
355  AddDEF("allowscreensaver", false);
356  AddDEF("debugOpenGL", 0);
357  AddDEF("protectChatFocus", true);
358 #if defined(__APPLE__)
359  AddDEF("enableGamma", false);
360 #else // defined(__APPLE__)
361 
362  AddDEF("enableGamma", true);
363 #endif // defined(__APPLE__)
364 
365  AddDEF("logInput", false);
366  AddDEF("highlightWords", "");
367  AddDEF("globalsFilter", "Sagatha");
368  AddDEF("selfMouseHeal", true);
369  AddDEF("serverslistupdate", "");
370  AddDEF("fadeoutmusic", true);
371  AddDEF("screenActionKeyboard", CAST_S32(
373  AddDEF("screenActionButton0", CAST_S32(InputAction::TALK));
374  AddDEF("screenActionButton1", CAST_S32(
376  AddDEF("screenActionButton2", CAST_S32(InputAction::PICKUP));
377  AddDEF("screenActionButton3", CAST_S32(InputAction::STOP_SIT));
378  AddDEF("screenActionButton4", CAST_S32(InputAction::TARGET_NPC));
379  AddDEF("screenActionButton5", CAST_S32(
381  AddDEF("screenActionButton6", CAST_S32(
383  AddDEF("screenActionButton7", CAST_S32(InputAction::WINDOW_SKILL));
384  AddDEF("screenActionButton8", CAST_S32(
386  AddDEF("screenActionButton9", CAST_S32(InputAction::WINDOW_DEBUG));
387  AddDEF("screenActionButton10", CAST_S32(
389  AddDEF("screenActionButton11", CAST_S32(InputAction::DIRECT_DOWN));
390  AddDEF("screenButtonsFormat", 0);
391  AddDEF("autoresizeminimaps", false);
392  AddDEF("showGuildOnline", false);
393  AddDEF("showPartyOnline", false);
394  AddDEF("enableGmTab", true);
395  AddDEF("gamecount", 0);
396  AddDEF("rated", false);
397  AddDEF("weightMsg", true);
398  AddDEF("enableLangTab", true);
399  AddDEF("showAllLang", false);
400  AddDEF("moveNames", false);
401  AddDEF("uselonglivesprites", false);
402  AddDEF("uselonglivesounds", true);
403  AddDEF("screenDensity", 0);
404  AddDEF("cfgver", 14);
405  AddDEF("enableDebugLog", false);
406  AddDEF("doubleClick", true);
407  AddDEF("useDiagonalSpeed", true);
408  AddDEF("protectedItems", "");
409  AddDEF("inventorySortOrder", 0);
410  AddDEF("storageSortOrder", 0);
411  AddDEF("cartSortOrder", 0);
412  AddDEF("buySortOrder", 0);
413  AddDEF("showmotd", false);
414  AddDEF("playMapAnimations", true);
415  AddDEF("usepets", true);
416  AddDEF("scale", 1);
417  AddDEF("addwatermark", true);
418  AddDEF("hidesupport", false);
419  AddDEF("showserverpos", false);
420  AddDEF("textureSize", "1024,1024,1024,1024,1024,1024");
421  AddDEF("ignorelogpackets", "");
422  AddDEF("disableLoggingInGame", false);
423  AddDEF("sellShopName", "unnamed");
424  AddDEF("showBadges", BadgeDrawType::Top);
425  AddDEF("tradescreenshot", false);
426  AddDEF("skillAutotarget", true);
427  AddDEF("logPlayerActions", false);
428  AddDEF("enableGuiOpacity", true);
429  AddDEF("enableTradeFilter", true);
430  AddDEF("enableIdCollecting", false);
431  AddDEF("checkOpenGLVersion", true);
432  AddDEF("openglContext", false);
433  AddDEF("allowMoveByMouse", true);
434  AddDEF("enableDSA", true);
435  AddDEF("blockAltTab", false);
436  AddDEF("sdlLogLevel", 0);
437  AddDEF("allowHighDPI", false);
438  AddDEF("sdlDriver", "");
439  AddDEF("parallelAudioChannels", 16);
440  AddDEF("showButtonIcons", false);
441 }
442 
444 {
445  logger->log("Add config default values to configuration %s",
446  cfg.getFileName().c_str());
447  DefaultsData &configData = cfg.getDefaultValues();
448  const int density = graphicsManager.getDensity();
449  int size = 12;
450  int buttonSize = 1;
451  switch (density)
452  {
453  case DENSITY_LOW:
454  case DENSITY_MEDIUM:
455  buttonSize = 1;
456  break;
457  case DENSITY_TV:
458  size = 14;
459  buttonSize = 1;
460  break;
461  case DENSITY_HIGH:
462  size = 16;
463  buttonSize = 2;
464  break;
465  case DENSITY_XHIGH:
466  size = 18;
467  buttonSize = 3;
468  break;
469  case DENSITY_XXHIGH:
470  size = 20;
471  buttonSize = 3;
472  break;
473  default:
474  break;
475  }
476  AddDEF("fontSize", size);
477  AddDEF("npcfontSize", size + 1);
478  if (mainGraphics->getHeight() < 480)
479  {
480  AddDEF("screenButtonsSize", 0);
481  AddDEF("screenJoystickSize", 0);
482  }
483  else
484  {
485  AddDEF("screenButtonsSize", buttonSize);
486  AddDEF("screenJoystickSize", buttonSize);
487  }
488 }
489 
491 {
492  logger->log("Set branding default values to configuration %s",
493  cfg.getFileName().c_str());
494  cfg.cleanDefaults();
495  DefaultsData &configData = cfg.getDefaultValues();
496  AddDEF("wallpapersPath", "");
497  AddDEF("wallpapersFile", "");
498  AddDEF("appName", "ManaPlus");
499  AddDEF("appIcon", "icons/manaplus");
500  AddDEF("loginMusic", "keprohm.ogg");
501  AddDEF("defaultServer", "");
502  AddDEF("defaultPort", DEFAULT_PORT);
503  AddDEF("defaultServerType", "tmwathena");
504  AddDEF("onlineServerList",
505  "http://manaplus.org/serverlist.xml");
506  AddDEF("onlineServerList2",
507  "http://www.manaplus.org/serverlist.xml");
508  AddDEF("onlineServerFile", "serverlistplus.xml");
509  AddDEF("appShort", "mana");
510  AddDEF("screenshots", "ManaPlus");
511  AddDEF("defaultUpdateHost", "");
512  AddDEF("helpPath", "");
513  AddDEF("tagsPath", "");
514  AddDEF("theme", "");
515  AddDEF("font", "fonts/dejavusans.ttf");
516  AddDEF("boldFont", "fonts/dejavusans-bold.ttf");
517  AddDEF("particleFont", "fonts/dejavusans.ttf");
518  AddDEF("helpFont", "fonts/dejavusansmono.ttf");
519  AddDEF("secureFont", "fonts/dejavusansmono.ttf");
520  AddDEF("npcFont", "fonts/dejavusans.ttf");
521  AddDEF("japanFont", "fonts/mplus-1p-regular.ttf");
522  AddDEF("chinaFont", "fonts/wqy-microhei.ttf");
523 
524  AddDEF("guiPath", "graphics/gui/");
525  AddDEF("guiThemePath", "themes/");
526  AddDEF("fontsPath", "fonts/");
527 
528  AddDEF("systemsounds", "sfx/system/");
529 
530  AddDEF("wallpaperFile", "");
531  AddDEF("dataPath", "");
532 
533  AddDEF("androidDownloadUrl", "https://play.google.com/store/apps/details"
534  "?id=org.evolonline.beta.manaplus");
535  AddDEF("androidDownloadText", "Google Play");
536  AddDEF("otherDownloadUrl", "http://manaplus.org/");
537  AddDEF("otherDownloadText", "http://manaplus.org/");
538  AddDEF("windowsDownloadUrl", "http://download.manaplus.org/"
539  "manaplus/download/manaplus-win32.exe");
540  AddDEF("windowsDownloadText", "download here");
541  AddDEF("updateMirror1", "http://manaplus.org/update/");
542  AddDEF("updateMirror2", "http://www.manaplus.org/update/");
543  AddDEF("updateMirror3", "http://www2.manaplus.org/update/");
544  AddDEF("updateMirror4", "http://www3.manaplus.org/update/");
545  AddDEF("updateMirror5", "");
546  AddDEF("updateMirror6", "");
547  AddDEF("updateMirror7", "");
548 }
549 
551 {
552  logger->log("Set path default values to configuration %s",
553  cfg.getFileName().c_str());
554  cfg.cleanDefaults();
555  DefaultsData &configData = cfg.getDefaultValues();
556  AddDEF("itemIcons", "graphics/items/");
557  AddDEF("unknownItemFile", "unknown-item.png");
558  AddDEF("sprites", "graphics/sprites/");
559  AddDEF("spriteErrorFile", "error.xml");
560  AddDEF("guiIcons", "graphics/guiicons/");
561  AddDEF("shaders", "graphics/shaders/");
562  AddDEF("help", "help/");
563  AddDEF("tags", "help/idx/");
564  AddDEF("badges", "graphics/badges/");
565 
566  AddDEF("simpleVertexShader", "simple_vertex.glsl");
567  AddDEF("simpleFragmentShader", "simple_frag.glsl");
568  AddDEF("gles2VertexShader", "gles2_vertex.glsl");
569  AddDEF("gles2FragmentShader", "gles2_frag.glsl");
570 
571  AddDEF("particles", "graphics/particles/");
572  AddDEF("portalEffectFile", "warparea.particle.xml");
573  AddDEF("effectId", -1);
574  AddDEF("hitEffectId", 26);
575  AddDEF("missEffectId", -1);
576  AddDEF("criticalHitEffectId", 28);
577  AddDEF("afkEffectId", -1);
578  AddDEF("newQuestEffectId", -1);
579  AddDEF("completeQuestEffectId", -1);
580  AddDEF("skillLevelUpEffectId", -1);
581  AddDEF("skillRemoveEffectId", -1);
582  AddDEF("skillSrcEffectId", -1);
583  AddDEF("skillDstEffectId", -1);
584  AddDEF("skillCastingSrcEffectId", -1);
585  AddDEF("skillCastingDstEffectId", -1);
586  AddDEF("skillCastingGroundEffectId", -1);
587  AddDEF("skillHitEffectId", -1);
588  AddDEF("skillMissEffectId", -1);
589 
590  AddDEF("spiritEffectId", -1);
591 
592  AddDEF("minimaps", "graphics/minimaps/");
593  AddDEF("maps", "maps/");
594  AddDEF("sfx", "sfx/");
595  AddDEF("music", "music/");
596 
597  AddDEF("wallpapers", "graphics/images/");
598  AddDEF("wallpaperFile", "login_wallpaper.png");
599 
600  AddDEF("statusEffectsFile", "status-effects.xml");
601  AddDEF("statusEffectsPatchFile", "status-effects_patch.xml");
602  AddDEF("statusEffectsPatchDir", "status-effects.d");
603  AddDEF("effectsFile", "effects.xml");
604  AddDEF("effectsPatchFile", "effects_patch.xml");
605  AddDEF("effectsPatchDir", "effects.d");
606  AddDEF("unitsFile", "units.xml");
607  AddDEF("unitsPatchFile", "units_patch.xml");
608  AddDEF("unitsPatchDir", "units.d");
609  AddDEF("featuresFile", "features.xml");
610  AddDEF("questsFile", "quests.xml");
611  AddDEF("questsPatchFile", "quests_patch.xml");
612  AddDEF("questsPatchDir", "quests.d");
613  AddDEF("skillsFile", "skills.xml");
614  AddDEF("skillsPatchFile", "skills_patch.xml");
615  AddDEF("skillsPatchDir", "skills.d");
616  AddDEF("skillsFile2", "ea-skills.xml");
617  AddDEF("equipmentWindowFile", "equipmentwindow.xml");
618  AddDEF("emotesFile", "emotes.xml");
619  AddDEF("emotesPatchFile", "emotes_patch.xml");
620  AddDEF("emotesPatchDir", "emotes.d");
621  AddDEF("hairColorFile", "hair.xml");
622  AddDEF("hairColorPatchFile", "hair_patch.xml");
623  AddDEF("hairColorPatchDir", "hair.d");
624  AddDEF("horsesFile", "horses.xml");
625  AddDEF("horsesPatchFile", "horses_patch.xml");
626  AddDEF("horsesPatchDir", "horses.d");
627  AddDEF("itemColorsFile", "itemcolors.xml");
628  AddDEF("itemColorsPatchFile", "itemcolors_patch.xml");
629  AddDEF("itemColorsPatchDir", "itemcolors.d");
630  AddDEF("charCreationFile", "charcreation.xml");
631  AddDEF("soundsFile", "sounds.xml");
632  AddDEF("soundsPatchFile", "sounds_patch.xml");
633  AddDEF("soundsPatchDir", "sounds.d");
634  AddDEF("itemsFile", "items.xml");
635  AddDEF("itemsPatchFile", "items_patch.xml");
636  AddDEF("itemsPatchDir", "items.d");
637  AddDEF("itemFieldsFile", "itemfields.xml");
638  AddDEF("itemFieldsPatchFile", "itemfields_patch.xml");
639  AddDEF("itemFieldsPatchDir", "itemfields.d");
640  AddDEF("itemOptionsFile", "itemoptions.xml");
641  AddDEF("itemOptionsPatchFile", "itemoptions_patch.xml");
642  AddDEF("itemOptionsPatchDir", "itemoptions.d");
643  AddDEF("avatarsFile", "avatars.xml");
644  AddDEF("avatarsPatchFile", "avatars_patch.xml");
645  AddDEF("avatarsPatchDir", "avatars.d");
646  AddDEF("modsFile", "mods.xml");
647  AddDEF("modsPatchFile", "mods_patch.xml");
648  AddDEF("modsPatchDir", "mods.d");
649  AddDEF("npcsFile", "npcs.xml");
650  AddDEF("npcsPatchFile", "npcs_patch.xml");
651  AddDEF("npcsPatchDir", "npcs.d");
652  AddDEF("petsFile", "pets.xml");
653  AddDEF("petsPatchFile", "pets_patch.xml");
654  AddDEF("petsPatchDir", "pets.d");
655  AddDEF("monstersFile", "monsters.xml");
656  AddDEF("monstersPatchFile", "monsters_patch.xml");
657  AddDEF("monstersPatchDir", "monsters.d");
658  AddDEF("mercenariesFile", "mercenaries.xml");
659  AddDEF("mercenariesPatchFile", "mercenaries_patch.xml");
660  AddDEF("mercenariesPatchDir", "mercenaries.d");
661  AddDEF("homunculusesFile", "homunculuses.xml");
662  AddDEF("homunculusesPatchFile", "homunculuses_patch.xml");
663  AddDEF("homunculusesPatchDir", "homunculuses.d");
664  AddDEF("skillUnitsFile", "skillunits.xml");
665  AddDEF("skillUnitsPatchFile", "skillunits_patch.xml");
666  AddDEF("skillUnitsPatchDir", "skillunits.d");
667  AddDEF("elementalsFile", "elementals.xml");
668  AddDEF("elementalsPatchFile", "elementals_patch.xml");
669  AddDEF("elementalsPatchDir", "elementals.d");
670  AddDEF("mapsRemapFile", "maps/remap.xml");
671  AddDEF("mapsRemapPatchFile", "maps/remap_patch.xml");
672  AddDEF("mapsRemapPatchDir", "maps/remap.d");
673  AddDEF("mapsFile", "maps.xml");
674  AddDEF("mapsPatchFile", "maps_patch.xml");
675  AddDEF("mapsPatchDir", "maps.d");
676  AddDEF("npcDialogsFile", "npcdialogs.xml");
677  AddDEF("npcDialogsPatchFile", "npcdialogs_patch.xml");
678  AddDEF("npcDialogsPatchDir", "npcdialogs.d");
679  AddDEF("deadMessagesFile", "deadmessages.xml");
680  AddDEF("deadMessagesPatchFile", "deadmessages_patch.xml");
681  AddDEF("deadMessagesPatchDir", "deadmessages.d");
682  AddDEF("defaultCommandsFile", "defaultcommands.xml");
683  AddDEF("defaultCommandsPatchFile", "defaultcommands_patch.xml");
684  AddDEF("defaultCommandsPatchDir", "defaultcommands.d");
685  AddDEF("badgesFile", "badges.xml");
686  AddDEF("badgesPatchFile", "badges_patch.xml");
687  AddDEF("badgesPatchDir", "badges.d");
688  AddDEF("languagesFile", "languages.xml");
689  AddDEF("languagesPatchFile", "languages_patch.xml");
690  AddDEF("languagesPatchDir", "languages.d");
691  AddDEF("textsFile", "texts.xml");
692  AddDEF("textsPatchFile", "texts_patch.xml");
693  AddDEF("textsPatchDir", "texts.d");
694  AddDEF("networkFile", "network.xml");
695  AddDEF("networkPatchFile", "network_patch.xml");
696  AddDEF("networkPatchDir", "network.d");
697  AddDEF("statFile", "stats.xml");
698  AddDEF("statPatchFile", "stats_patch.xml");
699  AddDEF("statPatchDir", "stats.d");
700  AddDEF("groupsFile", "groups.xml");
701  AddDEF("groupsPatchFile", "groups_patch.xml");
702  AddDEF("groupsPatchDir", "groups.d");
703  AddDEF("clansFile", "clans.xml");
704  AddDEF("clansPatchFile", "clans_patch.xml");
705  AddDEF("clansPatchDir", "clans.d");
706  AddDEF("equipmentSlotsFile", "equipmentslots.xml");
707  AddDEF("weaponsFile", "weapons.xml");
708  AddDEF("poisonEffectName", "poison");
709  AddDEF("cartEffectName", "cart");
710  AddDEF("ridingEffectName", "riding");
711  AddDEF("trickDeadEffectName", "trick dead");
712  AddDEF("postDelayName", "post delay");
713  AddDEF("gmTabMinimalLevel", "2");
714  AddDEF("team1badge", "team1.xml");
715  AddDEF("team2badge", "team2.xml");
716  AddDEF("team3badge", "team3.xml");
717  AddDEF("gmbadge", "gm.xml");
718  AddDEF("shopbadge", "shop.xml");
719  AddDEF("inactivebadge", "inactive.xml");
720  AddDEF("awaybadge", "away.xml");
721  AddDEF("cutInsDir", "graphics/cutins");
722  AddDEF("gmCommandSymbol", "@");
723  AddDEF("gmCharCommandSymbol", "#");
724  AddDEF("linkCommandSymbol", "=");
725  AddDEF("emptyAtlasName", "ignored");
726  AddDEF("skillCastingAnimation", "");
727  AddDEF("languageIcons", "graphics/badges/flags");
728  AddDEF("palettesDir", "");
729  AddDEF("defaultPaletteFile", "palette.gpl");
730  AddDEF("unknownSkillIcon", "graphics/sprites/error.png");
731  AddDEF("attackSkillIcon", "graphics/sprites/error.png");
732  AddDEF("groundSkillIcon", "graphics/sprites/error.png");
733  AddDEF("selfSkillIcon", "graphics/sprites/error.png");
734  AddDEF("unusedSkillIcon", "graphics/sprites/error.png");
735  AddDEF("supportSkillIcon", "graphics/sprites/error.png");
736  AddDEF("trapSkillIcon", "graphics/sprites/error.png");
737  AddDEF("missingSkillIcon", "graphics/sprites/error.png");
738  AddDEF("unknownSkillsAutoTab", true);
739 
740  AddDEF("overweightPercent", 50);
741  AddDEF("playerNameOffset", 64);
742  AddDEF("playerBadgeAtRightOffset", 32);
743  AddDEF("fixedInventorySize", 100);
744 
745 #ifdef TMWA_SUPPORT
746  AddDEF("gmDefaultLevel", 60);
747 #endif // TMWA_SUPPORT
748 
749  AddDEF("enableNewMailSystem", true);
750 }
751 
753 {
754  logger->log("Set features default values to configuration %s",
755  cfg.getFileName().c_str());
756  cfg.cleanDefaults();
757  DefaultsData &configData = cfg.getDefaultValues();
758  AddDEF("languageTab", false);
759  AddDEF("allowFollow", true);
760  AddDEF("fixDeadAnimation", true);
761  AddDEF("forceAccountGender", -1);
762  AddDEF("forceCharGender", -1);
763 }
764 
765 #undef AddDEF
#define CAST_S32
Definition: cast.h:30
DefaultsData & getDefaultValues()
std::string getFileName() const
int getDensity() const
int getHeight() const
Definition: graphics.cpp:648
void log(const char *const log_text,...)
Definition: logger.cpp:269
static const uint16_t DEFAULT_PORT
Definition: net.h:32
static const int defaultScreenWidth
Definition: graphics.h:33
static const int defaultScreenHeight
Definition: graphics.h:34
void setFeaturesDefaults(Configuration &cfg)
Definition: defaults.cpp:752
VariableData * createData(const int defData)
Definition: defaults.cpp:56
void setPathsDefaults(Configuration &cfg)
Definition: defaults.cpp:550
void setConfigDefaults2(Configuration &cfg)
Definition: defaults.cpp:443
void setConfigDefaults(Configuration &cfg)
Definition: defaults.cpp:90
#define AddDEF(key, value)
Definition: defaults.cpp:86
void setBrandingDefaults(Configuration &cfg)
Definition: defaults.cpp:490
std::map< std::string, VariableData * > DefaultsData
Definition: defaults.h:32
Graphics * mainGraphics
Definition: graphics.cpp:109
GraphicsManager graphicsManager
#define PRAGMA48(str)
Definition: localconsts.h:199
Logger * logger
Definition: logger.cpp:89
@ NO_NAME_IN_BUBBLE
Definition: beingspeech.h:33
int size()
Definition: emotedb.cpp:306
@ WINDOW_INVENTORY
Definition: inputaction.h:94
@ DENSITY_HIGH
Definition: screendensity.h:31
@ DENSITY_MEDIUM
Definition: screendensity.h:29
@ DENSITY_LOW
Definition: screendensity.h:28
@ DENSITY_TV
Definition: screendensity.h:30
@ DENSITY_XHIGH
Definition: screendensity.h:32
@ DENSITY_XXHIGH
Definition: screendensity.h:33