GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/defaults.cpp Lines: 549 558 98.4 %
Date: 2017-11-29 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-2017  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
106290
    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
2536
    return new FloatData(defData);
68
}
69
70
VariableData* createData(const std::string &defData)
71
{
72
    return new StringData(defData);
73
}
74
75
101304
VariableData* createData(const char *const defData)
76
{
77

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