GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/defaults.cpp Lines: 565 574 98.4 %
Date: 2018-12-09 Branches: 8 16 50.0 %

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