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