GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/defaults.cpp Lines: 566 575 98.4 %
Date: 2021-03-17 Branches: 9 18 50.0 %

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