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
57703
    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
2724
    return new FloatData(defData);
69
}
70
71
VariableData* createData(const std::string &defData)
72
{
73
    return new StringData(defData);
74
}
75
76
55310
VariableData* createData(const char *const defData)
77
{
78
276550
    return new StringData(defData);
79
}
80
81
VariableData* createData(const bool defData)
82
{
83
216034
    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
681
void setConfigDefaults(Configuration &cfg)
91
{
92
681
    logger->log("Set config default values to configuration %s",
93
2043
        cfg.getFileName().c_str());
94
681
    cfg.cleanDefaults();
95
681
    DefaultsData &configData = cfg.getDefaultValues();
96
2724
    AddDEF("OverlayDetail", 2);
97
2724
    AddDEF("speechBubbleAlpha", 1.0F);
98
2724
    AddDEF("MostUsedServerName0", "server.themanaworld.org");
99
2724
    AddDEF("visiblenames", VisibleName::Show);
100
2724
    AddDEF("visiblenamespos", VisibleNamePos::Bottom);
101
2724
    AddDEF("speech", CAST_S32(BeingSpeech::NO_NAME_IN_BUBBLE));
102
2724
    AddDEF("showgender", true);
103
2724
    AddDEF("showlevel", false);
104
2724
    AddDEF("showMonstersTakedDamage", true);
105
2724
    AddDEF("highlightAttackRange", false);
106
2724
    AddDEF("highlightMapPortals", true);
107
2724
    AddDEF("highlightMonsterAttackRange", false);
108
2724
    AddDEF("chatMaxCharLimit", 512);
109
2724
    AddDEF("lowTraffic", true);
110
2724
    AddDEF("invertMoveDirection", 0);
111
2724
    AddDEF("crazyMoveType", 1);
112
2724
    AddDEF("attackWeaponType", 1);
113
2724
    AddDEF("quickDropCounter", 1);
114
2724
    AddDEF("pickUpType", 5);
115
2724
    AddDEF("magicAttackType", 0);
116
2724
    AddDEF("attackType", 2);
117
2724
    AddDEF("targetingType", 0);
118
2724
    AddDEF("followMode", 0);
119
2724
    AddDEF("imitationMode", 0);
120
2724
    AddDEF("syncPlayerMove", true);
121
2724
    AddDEF("syncPlayerMoveDistance", 5);
122
2724
    AddDEF("syncPlayerMoveDistanceLegacy", 15);
123
2724
    AddDEF("drawPath", false);
124
2724
    AddDEF("moveToTargetType", 10);
125
2724
    AddDEF("crazyMoveProgram", "mumrsonmdmlon");
126
2724
    AddDEF("disableGameModifiers", true);
127
2724
    AddDEF("targetDeadPlayers", false);
128
2724
    AddDEF("afkMessage", "I am away from keyboard.");
129
2724
    AddDEF("afkFormat", 0);
130
2724
    AddDEF("particleMaxCount", 3000);
131
2724
    AddDEF("particleFastPhysics", CAST_S32(ParticlePhysics::Normal));
132
2724
    AddDEF("particleEmitterSkip", 1);
133
2724
    AddDEF("particleeffects", true);
134
2724
    AddDEF("mapparticleeffects", true);
135
2724
    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
2724
    AddDEF("screenwidth", defaultScreenWidth);
152
2724
    AddDEF("screenheight", defaultScreenHeight);
153
2724
    AddDEF("showScreenJoystick", false);
154
2724
    AddDEF("showScreenButtons", false);
155
2724
    AddDEF("showBeingPopup", true);
156
2724
    AddDEF("mouseDirectionMove", false);
157
#ifdef __SWITCH__
158
    AddDEF("showScreenKeyboard", true);
159
#else
160
2724
    AddDEF("showScreenKeyboard", false);
161
#endif
162
2724
    AddDEF("fpslimit", 60);
163
2724
    AddDEF("showChatColorsList", true);
164
2724
    AddDEF("customcursor", true);
165
2724
    AddDEF("showDidYouKnow", true);
166
2724
    AddDEF("longmouseclick", false);
167
#endif  // ANDROID
168
169
2724
    AddDEF("theme", "jewelry");
170
2724
    AddDEF("showEmotesButton", true);
171
2724
    AddDEF("screen", false);
172
2724
    AddDEF("hwaccel", false);
173
#ifdef __SWITCH__
174
    AddDEF("sound", true);
175
#else
176
2724
    AddDEF("sound", false);
177
#endif
178
2724
    AddDEF("sfxVolume", 100);
179
2724
    AddDEF("musicVolume", 60);
180
2724
    AddDEF("remember", false);
181
2724
    AddDEF("username", "");
182
#ifdef SAVE_PASSWORD
183
    AddDEF("password", "");
184
#endif
185
2724
    AddDEF("lastCharacter", "");
186
2724
    AddDEF("altfpslimit", 5);
187
2724
    AddDEF("updatehost", "");
188
2724
    AddDEF("screenshotDirectory3", "");
189
2724
    AddDEF("useScreenshotDirectorySuffix", true);
190
2724
    AddDEF("screenshotDirectorySuffix", "");
191
#ifdef __SWITCH__
192
    AddDEF("joystickEnabled", true);
193
#else
194
2043
    AddDEF("joystickEnabled", false);
195
#endif
196
2724
    AddDEF("upTolerance", 100);
197
2724
    AddDEF("downTolerance", 100);
198
2724
    AddDEF("leftTolerance", 100);
199
2724
    AddDEF("rightTolerance", 100);
200
2724
    AddDEF("logNpcInGui", true);
201
2724
    AddDEF("download-music", true);
202
2724
    AddDEF("guialpha", 0.8F);
203
2724
    AddDEF("ChatLogLength", 0);
204
2724
    AddDEF("enableChatLog", true);
205
2724
    AddDEF("whispertab", true);
206
2724
    AddDEF("showownname", true);
207
2724
    AddDEF("showpickupparticle", true);
208
2724
    AddDEF("showpickupchat", true);
209
2724
    AddDEF("ReturnToggles", false);
210
2724
    AddDEF("ScrollLaziness", 16);
211
2724
    AddDEF("ScrollRadius", 0);
212
2724
    AddDEF("ScrollCenterOffsetX", 0);
213
2724
    AddDEF("ScrollCenterOffsetY", 0);
214
2724
    AddDEF("enableMumble", false);
215
2724
    AddDEF("playBattleSound", true);
216
2724
    AddDEF("playGuiSound", true);
217
2724
    AddDEF("playMusic", true);
218
2724
    AddDEF("packetcounters", true);
219
2724
    AddDEF("safemode", false);
220
2724
    AddDEF("font", "fonts/dejavusans.ttf");
221
2724
    AddDEF("boldFont", "fonts/dejavusans-bold.ttf");
222
2724
    AddDEF("particleFont", "fonts/dejavusans.ttf");
223
2724
    AddDEF("helpFont", "fonts/dejavusansmono.ttf");
224
2724
    AddDEF("secureFont", "fonts/dejavusansmono.ttf");
225
2724
    AddDEF("japanFont", "fonts/mplus-1p-regular.ttf");
226
2724
    AddDEF("chinaFont", "fonts/wqy-microhei.ttf");
227
2724
    AddDEF("npcFont", "fonts/dejavusans.ttf");
228
2724
    AddDEF("showBackground", true);
229
2724
    AddDEF("enableTradeTab", true);
230
2724
    AddDEF("cyclePlayers", true);
231
2724
    AddDEF("cycleMonsters", true);
232
2724
    AddDEF("cycleNPC", true);
233
2724
    AddDEF("floorItemsHighlight", true);
234
2724
    AddDEF("enableBotCheker", true);
235
2724
    AddDEF("removeColors", true);
236
2724
    AddDEF("showMagicInDebug", true);
237
2724
    AddDEF("allowCommandsInChatTabs", true);
238
2724
    AddDEF("serverMsgInDebug", true);
239
2724
    AddDEF("hideShopMessages", true);
240
2724
    AddDEF("showChatHistory", true);
241
2724
    AddDEF("chatMaxLinesLimit", 40);
242
2724
    AddDEF("chatColor", 0);
243
2724
    AddDEF("showJob", true);
244
2724
    AddDEF("updateOnlineList", true);
245
2724
    AddDEF("targetOnlyReachable", true);
246
2724
    AddDEF("errorsInDebug", true);
247
2724
    AddDEF("tradebot", true);
248
2724
    AddDEF("debugLog", false);
249
2724
    AddDEF("unimplimentedLog", false);
250
2724
    AddDEF("drawHotKeys", true);
251
2724
    AddDEF("serverAttack", true);
252
2724
    AddDEF("autofixPos", false);
253
2724
    AddDEF("alphaCache", true);
254
2724
    AddDEF("attackMoving", true);
255
2724
    AddDEF("attackNext", false);
256
2724
    AddDEF("quickStats", true);
257
2724
    AddDEF("warpParticle", false);
258
2724
    AddDEF("autoShop", false);
259
2724
    AddDEF("enableBattleTab", false);
260
2724
    AddDEF("showBattleEvents", false);
261
2724
    AddDEF("showMobHP", true);
262
2724
    AddDEF("showOwnHP", true);
263
2724
    AddDEF("usePersistentIP", true);
264
2724
    AddDEF("showJobExp", true);
265
2724
    AddDEF("showExtMinimaps", false);
266
2724
    AddDEF("hideChatInput", true);
267
2724
    AddDEF("enableAttackFilter", true);
268
2724
    AddDEF("enablePickupFilter", true);
269
2724
    AddDEF("securetrades", true);
270
2724
    AddDEF("unsecureChars", "IO0@#$");
271
2724
    AddDEF("currentTip", 0);
272
2724
    AddDEF("useLocalTime", false);
273
2724
    AddDEF("enableAdvert", true);
274
2724
    AddDEF("enableMapReduce", true);
275
2724
    AddDEF("showPlayersStatus", true);
276
2724
    AddDEF("beingopacity", false);
277
2724
    AddDEF("adjustPerfomance", true);
278
2724
    AddDEF("enableAlphaFix", false);
279
2724
    AddDEF("disableAdvBeingCaching", true);
280
2724
    AddDEF("disableBeingCaching", false);
281
2724
    AddDEF("enableReorderSprites", true);
282
2724
    AddDEF("showip", false);
283
2724
    AddDEF("seflMouseHeal", true);
284
2724
    AddDEF("enableLazyScrolling", false);
285
2724
    AddDEF("extMouseTargeting", true);
286
2724
    AddDEF("showMVP", false);
287
2724
    AddDEF("pvpAttackType", 0);
288
2724
    AddDEF("lang", "");
289
2724
    AddDEF("selectedJoystick", 0);
290
2724
    AddDEF("useInactiveJoystick", false);
291
2724
    AddDEF("testInfo", "");
292
2724
    AddDEF("enableresize", true);
293
2724
    AddDEF("noframe", false);
294
2724
    AddDEF("groupFriends", true);
295
2724
    AddDEF("grabinput", false);
296
2724
    AddDEF("usefbo", false);
297
2724
    AddDEF("gamma", 1);
298
2724
    AddDEF("vsync", 0);
299
2724
    AddDEF("enableBuggyServers", true);
300
2724
    AddDEF("soundwhisper", "newmessage");
301
2724
    AddDEF("soundhighlight", "reminder");
302
2724
    AddDEF("soundglobal", "email");
303
2724
    AddDEF("sounderror", "error");
304
2724
    AddDEF("soundtrade", "start");
305
2724
    AddDEF("soundinfo", "notify");
306
2724
    AddDEF("soundrequest", "attention");
307
2724
    AddDEF("soundguild", "newmessage");
308
2724
    AddDEF("soundparty", "newmessage");
309
2724
    AddDEF("soundclan", "newmessage");
310
2724
    AddDEF("soundshowwindow", "page");
311
2724
    AddDEF("soundhidewindow", "book");
312
2724
    AddDEF("autohideButtons", true);
313
2724
    AddDEF("autohideChat", false);
314
2724
    AddDEF("downloadProxy", "");
315
2724
    AddDEF("downloadProxyType", 0);
316
2724
    AddDEF("downloadProxyTunnel", false);
317
2724
    AddDEF("blur", false);
318
#if defined(WIN32) || defined(__APPLE__)
319
    AddDEF("centerwindow", true);
320
#else  // defined(WIN32) || defined(__APPLE__)
321
322
2724
    AddDEF("centerwindow", false);
323
#endif  // defined(WIN32) || defined(__APPLE__)
324
325
2724
    AddDEF("audioFrequency", 44100);
326
2724
    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
2724
    AddDEF("repeateDelay", SDL_DEFAULT_REPEAT_DELAY);
334
2724
    AddDEF("repeateInterval", SDL_DEFAULT_REPEAT_INTERVAL);
335
2724
    AddDEF("repeateInterval2", SDL_DEFAULT_REPEAT_DELAY);
336
#endif  // USE_SDL2
337
338
2724
    AddDEF("compresstextures", 0);
339
2724
    AddDEF("rectangulartextures", false);
340
2724
    AddDEF("networksleep", 0);
341
2724
    AddDEF("newtextures", true);
342
2724
    AddDEF("videodetected", false);
343
2724
    AddDEF("hideErased", false);
344
2724
    AddDEF("enableDelayedAnimations", true);
345
2724
    AddDEF("enableCompoundSpriteDelay", true);
346
#ifdef ANDROID
347
    AddDEF("useAtlases", false);
348
#else  // ANDROID
349
350
2724
    AddDEF("useAtlases", true);
351
#endif  // ANDROID
352
353
2724
    AddDEF("useTextureSampler", false);
354
2724
    AddDEF("ministatussaved", 0);
355
2724
    AddDEF("allowscreensaver", false);
356
2724
    AddDEF("debugOpenGL", 0);
357
2724
    AddDEF("protectChatFocus", true);
358
#if defined(__APPLE__)
359
    AddDEF("enableGamma", false);
360
#else  // defined(__APPLE__)
361
362
2724
    AddDEF("enableGamma", true);
363
#endif  // defined(__APPLE__)
364
365
2724
    AddDEF("logInput", false);
366
2724
    AddDEF("highlightWords", "");
367
2724
    AddDEF("globalsFilter", "Sagatha");
368
2724
    AddDEF("selfMouseHeal", true);
369
2724
    AddDEF("serverslistupdate", "");
370
2724
    AddDEF("fadeoutmusic", true);
371
2043
    AddDEF("screenActionKeyboard", CAST_S32(
372
681
        InputAction::SHOW_KEYBOARD));
373
2724
    AddDEF("screenActionButton0", CAST_S32(InputAction::TALK));
374
2043
    AddDEF("screenActionButton1", CAST_S32(
375
681
        InputAction::TARGET_ATTACK));
376
2724
    AddDEF("screenActionButton2", CAST_S32(InputAction::PICKUP));
377
2724
    AddDEF("screenActionButton3", CAST_S32(InputAction::STOP_SIT));
378
2724
    AddDEF("screenActionButton4", CAST_S32(InputAction::TARGET_NPC));
379
2043
    AddDEF("screenActionButton5", CAST_S32(
380
681
        InputAction::WINDOW_STATUS));
381
2043
    AddDEF("screenActionButton6", CAST_S32(
382
681
        InputAction::WINDOW_INVENTORY));
383
2724
    AddDEF("screenActionButton7", CAST_S32(InputAction::WINDOW_SKILL));
384
2043
    AddDEF("screenActionButton8", CAST_S32(
385
681
        InputAction::WINDOW_SOCIAL));
386
2724
    AddDEF("screenActionButton9", CAST_S32(InputAction::WINDOW_DEBUG));
387
2043
    AddDEF("screenActionButton10", CAST_S32(
388
681
        InputAction::CHANGE_TRADE));
389
2724
    AddDEF("screenActionButton11", CAST_S32(InputAction::DIRECT_DOWN));
390
2724
    AddDEF("screenButtonsFormat", 0);
391
2724
    AddDEF("autoresizeminimaps", false);
392
2724
    AddDEF("showGuildOnline", false);
393
2724
    AddDEF("showPartyOnline", false);
394
2724
    AddDEF("enableGmTab", true);
395
2724
    AddDEF("gamecount", 0);
396
2724
    AddDEF("rated", false);
397
2724
    AddDEF("weightMsg", true);
398
2724
    AddDEF("enableLangTab", true);
399
2724
    AddDEF("showAllLang", false);
400
2724
    AddDEF("moveNames", false);
401
2724
    AddDEF("uselonglivesprites", false);
402
2724
    AddDEF("uselonglivesounds", true);
403
2724
    AddDEF("screenDensity", 0);
404
2724
    AddDEF("cfgver", 14);
405
2724
    AddDEF("enableDebugLog", false);
406
2724
    AddDEF("doubleClick", true);
407
2724
    AddDEF("useDiagonalSpeed", true);
408
2724
    AddDEF("protectedItems", "");
409
2724
    AddDEF("inventorySortOrder", 0);
410
2724
    AddDEF("storageSortOrder", 0);
411
2724
    AddDEF("cartSortOrder", 0);
412
2724
    AddDEF("buySortOrder", 0);
413
2724
    AddDEF("showmotd", false);
414
2724
    AddDEF("playMapAnimations", true);
415
2724
    AddDEF("usepets", true);
416
2724
    AddDEF("scale", 1);
417
2724
    AddDEF("addwatermark", true);
418
2724
    AddDEF("hidesupport", false);
419
2724
    AddDEF("showserverpos", false);
420
2724
    AddDEF("textureSize", "1024,1024,1024,1024,1024,1024");
421
2724
    AddDEF("ignorelogpackets", "");
422
2724
    AddDEF("disableLoggingInGame", false);
423
2724
    AddDEF("sellShopName", "unnamed");
424
2724
    AddDEF("showBadges", BadgeDrawType::Top);
425
2724
    AddDEF("tradescreenshot", false);
426
2724
    AddDEF("skillAutotarget", true);
427
2724
    AddDEF("logPlayerActions", false);
428
2724
    AddDEF("enableGuiOpacity", true);
429
2724
    AddDEF("enableTradeFilter", true);
430
2724
    AddDEF("enableIdCollecting", false);
431
2724
    AddDEF("checkOpenGLVersion", true);
432
2724
    AddDEF("openglContext", false);
433
2724
    AddDEF("allowMoveByMouse", true);
434
2724
    AddDEF("enableDSA", true);
435
2724
    AddDEF("blockAltTab", false);
436
2724
    AddDEF("sdlLogLevel", 0);
437
2724
    AddDEF("allowHighDPI", false);
438
2724
    AddDEF("sdlDriver", "");
439
2724
    AddDEF("parallelAudioChannels", 16);
440
2724
    AddDEF("showButtonIcons", false);
441
681
}
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
245
void setBrandingDefaults(Configuration &cfg)
491
{
492
245
    logger->log("Set branding default values to configuration %s",
493
735
        cfg.getFileName().c_str());
494
245
    cfg.cleanDefaults();
495
245
    DefaultsData &configData = cfg.getDefaultValues();
496
980
    AddDEF("wallpapersPath", "");
497
980
    AddDEF("wallpapersFile", "");
498
980
    AddDEF("appName", "ManaPlus");
499
980
    AddDEF("appIcon", "icons/manaplus");
500
980
    AddDEF("loginMusic", "keprohm.ogg");
501
980
    AddDEF("defaultServer", "");
502
980
    AddDEF("defaultPort", DEFAULT_PORT);
503
980
    AddDEF("defaultServerType", "tmwathena");
504
735
    AddDEF("onlineServerList",
505
245
           "http://manaplus.org/serverlist.xml");
506
735
    AddDEF("onlineServerList2",
507
245
           "http://www.manaplus.org/serverlist.xml");
508
980
    AddDEF("onlineServerFile", "serverlistplus.xml");
509
980
    AddDEF("appShort", "mana");
510
980
    AddDEF("screenshots", "ManaPlus");
511
980
    AddDEF("defaultUpdateHost", "");
512
980
    AddDEF("helpPath", "");
513
980
    AddDEF("tagsPath", "");
514
980
    AddDEF("theme", "");
515
980
    AddDEF("font", "fonts/dejavusans.ttf");
516
980
    AddDEF("boldFont", "fonts/dejavusans-bold.ttf");
517
980
    AddDEF("particleFont", "fonts/dejavusans.ttf");
518
980
    AddDEF("helpFont", "fonts/dejavusansmono.ttf");
519
980
    AddDEF("secureFont", "fonts/dejavusansmono.ttf");
520
980
    AddDEF("npcFont", "fonts/dejavusans.ttf");
521
980
    AddDEF("japanFont", "fonts/mplus-1p-regular.ttf");
522
980
    AddDEF("chinaFont", "fonts/wqy-microhei.ttf");
523
524
980
    AddDEF("guiPath", "graphics/gui/");
525
980
    AddDEF("guiThemePath", "themes/");
526
980
    AddDEF("fontsPath", "fonts/");
527
528
980
    AddDEF("systemsounds", "sfx/system/");
529
530
980
    AddDEF("wallpaperFile", "");
531
980
    AddDEF("dataPath", "");
532
533
735
    AddDEF("androidDownloadUrl", "https://play.google.com/store/apps/details"
534
245
        "?id=org.evolonline.beta.manaplus");
535
980
    AddDEF("androidDownloadText", "Google Play");
536
980
    AddDEF("otherDownloadUrl", "http://manaplus.org/");
537
980
    AddDEF("otherDownloadText", "http://manaplus.org/");
538
735
    AddDEF("windowsDownloadUrl", "http://download.manaplus.org/"
539
245
        "manaplus/download/manaplus-win32.exe");
540
980
    AddDEF("windowsDownloadText", "download here");
541
980
    AddDEF("updateMirror1", "http://manaplus.org/update/");
542
980
    AddDEF("updateMirror2", "http://www.manaplus.org/update/");
543
980
    AddDEF("updateMirror3", "http://www2.manaplus.org/update/");
544
980
    AddDEF("updateMirror4", "http://www3.manaplus.org/update/");
545
980
    AddDEF("updateMirror5", "");
546
980
    AddDEF("updateMirror6", "");
547
980
    AddDEF("updateMirror7", "");
548
245
}
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