GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/gui/windows/statuswindow.cpp Lines: 145 300 48.3 %
Date: 2017-11-29 Branches: 143 465 30.8 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2004-2009  The Mana World Development Team
4
 *  Copyright (C) 2009-2010  The Mana Developers
5
 *  Copyright (C) 2011-2017  The ManaPlus Developers
6
 *
7
 *  This file is part of The ManaPlus Client.
8
 *
9
 *  This program is free software; you can redistribute it and/or modify
10
 *  it under the terms of the GNU General Public License as published by
11
 *  the Free Software Foundation; either version 2 of the License, or
12
 *  any later version.
13
 *
14
 *  This program is distributed in the hope that it will be useful,
15
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 *  GNU General Public License for more details.
18
 *
19
 *  You should have received a copy of the GNU General Public License
20
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 */
22
23
#include "gui/windows/statuswindow.h"
24
25
#include "configuration.h"
26
#include "gamemodifiers.h"
27
#include "settings.h"
28
29
#include "being/localplayer.h"
30
#include "being/playerinfo.h"
31
32
#include "enums/gui/layouttype.h"
33
34
#include "gui/windows/chatwindow.h"
35
36
#include "gui/windows/equipmentwindow.h"
37
#include "gui/windows/setupwindow.h"
38
39
#include "gui/widgets/button.h"
40
#include "gui/widgets/createwidget.h"
41
#include "gui/widgets/layout.h"
42
#include "gui/widgets/progressbar.h"
43
#include "gui/widgets/statspage.h"
44
#include "gui/widgets/statspagebasic.h"
45
#include "gui/widgets/tabbedarea.h"
46
#include "gui/widgets/windowcontainer.h"
47
48
#include "net/inventoryhandler.h"
49
#include "net/playerhandler.h"
50
51
#include "resources/db/groupdb.h"
52
#include "resources/db/unitsdb.h"
53
#include "resources/db/statdb.h"
54
55
#include "resources/item/item.h"
56
57
#include "utils/delete2.h"
58
#include "utils/dtor.h"
59
#include "utils/foreach.h"
60
#include "utils/gettext.h"
61
62
#include "debug.h"
63
64
StatusWindow *statusWindow = nullptr;
65
66
2
StatusWindow::StatusWindow() :
67

4
    Window(localPlayer != nullptr ? localPlayer->getName() :
68
        "?", Modal_false, nullptr, "status.xml"),
69
    ActionListener(),
70
    AttributeListener(),
71
    mPages(),
72

2
    mTabs(CREATEWIDGETR(TabbedArea, this)),
73
    // TRANSLATORS: status window label
74

4
    mLvlLabel(new Label(this, strprintf(_("Level: %d"), 0))),
75
    // TRANSLATORS: status window label
76

4
    mMoneyLabel(new Label(this, strprintf(_("Money: %s"), ""))),
77
    // TRANSLATORS: status window label
78

4
    mHpLabel(new Label(this, _("HP:"))),
79
    mMpLabel(nullptr),
80
    // TRANSLATORS: status window label
81

4
    mXpLabel(new Label(this, _("Exp:"))),
82
    mHpBar(nullptr),
83
    mMpBar(nullptr),
84
    mXpBar(nullptr),
85
    mJobLvlLabel(nullptr),
86
    mJobLabel(nullptr),
87
    mJobBar(nullptr),
88

2
    mBasicStatsPage(new StatsPageBasic(this)),
89
    // TRANSLATORS: status window button
90




52
    mCopyButton(new Button(this, _("Copy to chat"), "copy", this))
91
{
92
10
    setWindowName("Status");
93
2
    if (setupWindow != nullptr)
94
        setupWindow->registerWindowForReset(this);
95
2
    setResizable(true);
96
2
    setCloseButton(true);
97
4
    setSaveVisible(true);
98
2
    setStickyButtonLock(true);
99
4
    setDefaultSize((windowContainer->getWidth() - 480) / 2,
100
4
        (windowContainer->getHeight() - 500) / 2, 480, 500);
101
102
4
    mTabs->setSelectable(false);
103
6
    mTabs->getWidgetContainer()->setSelectable(false);
104
6
    mTabs->getTabContainer()->setSelectable(false);
105
106


8
    if ((localPlayer != nullptr) && !localPlayer->getRaceName().empty())
107
    {
108
        setCaption(strprintf("%s (%s)", localPlayer->getName().c_str(),
109
            localPlayer->getRaceName().c_str()));
110
    }
111
112
2
    int max = PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP);
113
2
    if (max == 0)
114
2
        max = 1;
115
116

16
    mHpBar = new ProgressBar(this,
117
2
        static_cast<float>(PlayerInfo::getAttribute(Attributes::PLAYER_HP))
118
2
        / static_cast<float>(max),
119
        80,
120
        0,
121
        ProgressColorId::PROG_HP,
122

2
        "hpprogressbar.xml", "hpprogressbar_fill.xml");
123
6
    mHpBar->setColor(getThemeColor(ThemeColorId::HP_BAR),
124
        getThemeColor(ThemeColorId::HP_BAR_OUTLINE));
125
4
    mHpBar->setSelectable(false);
126
127
    const int64_t maxExp = PlayerInfo::getAttribute64(
128
2
        Attributes::PLAYER_EXP_NEEDED);
129

16
    mXpBar = new ProgressBar(this,
130
2
        maxExp != 0 ?
131
        static_cast<float>(PlayerInfo::getAttribute64(
132
        Attributes::PLAYER_EXP)) /
133
        static_cast<float>(maxExp) : static_cast<float>(0),
134
        80,
135
        0,
136
        ProgressColorId::PROG_EXP,
137

2
        "xpprogressbar.xml", "xpprogressbar_fill.xml");
138
6
    mXpBar->setColor(getThemeColor(ThemeColorId::XP_BAR),
139
        getThemeColor(ThemeColorId::XP_BAR_OUTLINE));
140
4
    mXpBar->setSelectable(false);
141
142

8
    const bool job = serverConfig.getValueBool("showJob", true);
143
144
2
    max = PlayerInfo::getAttribute(Attributes::PLAYER_MAX_MP);
145
    // TRANSLATORS: status window label
146

8
    mMpLabel = new Label(this, _("MP:"));
147
2
    const bool useMagic = playerHandler->canUseMagic();
148


16
    mMpBar = new ProgressBar(this,
149

2
        max != 0 ? static_cast<float>(PlayerInfo::getAttribute(
150
        Attributes::PLAYER_MAX_MP)) / static_cast<float>(max)
151
        : static_cast<float>(0),
152
        80,
153
        0,
154
        useMagic ? ProgressColorId::PROG_MP : ProgressColorId::PROG_NO_MP,
155
        useMagic ? "mpprogressbar.xml" : "nompprogressbar.xml",
156

2
        useMagic ? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml");
157
4
    mMpBar->setSelectable(false);
158
2
    if (useMagic)
159
    {
160
        mMpBar->setColor(getThemeColor(ThemeColorId::MP_BAR),
161
            getThemeColor(ThemeColorId::MP_BAR_OUTLINE));
162
    }
163
    else
164
    {
165
6
        mMpBar->setColor(getThemeColor(ThemeColorId::NO_MP_BAR),
166
            getThemeColor(ThemeColorId::NO_MP_BAR_OUTLINE));
167
    }
168
169
2
    place(0, 0, mLvlLabel, 3);
170
4
    place(0, 1, mHpLabel).setPadding(3);
171
2
    place(1, 1, mHpBar, 4);
172
4
    place(5, 1, mXpLabel).setPadding(3);
173
2
    place(6, 1, mXpBar, 5);
174
4
    place(0, 2, mMpLabel).setPadding(3);
175
    // 5, 2 and 6, 2 Job Progress Bar
176
2
    if (job)
177
2
        place(1, 2, mMpBar, 4);
178
    else
179
        place(1, 2, mMpBar, 10);
180
181
2
    if (job)
182
    {
183
        // TRANSLATORS: status window label
184

4
        mJobLvlLabel = new Label(this, strprintf(_("Job: %d"), 0));
185
        // TRANSLATORS: status window label
186

8
        mJobLabel = new Label(this, _("Job:"));
187

16
        mJobBar = new ProgressBar(this, 0.0F, 80, 0, ProgressColorId::PROG_JOB,
188

2
            "jobprogressbar.xml", "jobprogressbar_fill.xml");
189
6
        mJobBar->setColor(getThemeColor(ThemeColorId::JOB_BAR),
190
            getThemeColor(ThemeColorId::JOB_BAR_OUTLINE));
191
4
        mJobBar->setSelectable(false);
192
193
2
        place(3, 0, mJobLvlLabel, 3);
194
4
        place(5, 2, mJobLabel).setPadding(3);
195
2
        place(6, 2, mJobBar, 5);
196
2
        place(6, 0, mMoneyLabel, 3);
197
    }
198
    else
199
    {
200
        mJobLvlLabel = nullptr;
201
        mJobLabel = nullptr;
202
        mJobBar = nullptr;
203
        place(3, 0, mMoneyLabel, 3);
204
    }
205
206

2
    place(0, 3, mTabs, 11, 3);
207
208

2
    getLayout().setRowHeight(3, LayoutType::SET);
209
210
2
    place(0, 5, mCopyButton);
211
212
2
    loadWindowState();
213
4
    enableVisibleSound(true);
214
215
    // Update bars
216
2
    updateHPBar(mHpBar, true);
217
2
    updateMPBar(mMpBar, true);
218
2
    updateXPBar(mXpBar, false);
219
220
    // TRANSLATORS: status window label
221

6
    mMoneyLabel->setCaption(strprintf(_("Money: %s"),
222

4
        UnitsDb::formatCurrency(PlayerInfo::getAttribute(
223
        Attributes::MONEY)).c_str()));
224
2
    mMoneyLabel->adjustSize();
225
226
2
    updateLevelLabel();
227
2
    addTabs();
228
2
}
229
230
10
StatusWindow::~StatusWindow()
231
{
232
4
    delete2(mBasicStatsPage);
233
4
    delete_all(mPages);
234
4
}
235
236
2
void StatusWindow::addTabs()
237
{
238
    // TRANSLATORS: status window tab name
239
10
    addTabBasic(_("Basic"));
240
2
    const STD_VECTOR<std::string> &pages = StatDb::getPages();
241
8
    FOR_EACH(STD_VECTOR<std::string>::const_iterator, it, pages)
242
    {
243
        addTab(*it);
244
    }
245
2
    mTabs->adjustSize();
246
2
}
247
248
void StatusWindow::addTab(const std::string &name)
249
{
250
    StatsPage *const page = new StatsPage(this, name);
251
    mTabs->addTab(name,
252
        page);
253
    mPages.push_back(page);
254
}
255
256
void StatusWindow::addTabBasic(const std::string &name)
257
{
258
4
    mTabs->addTab(name,
259
2
        mBasicStatsPage);
260
}
261
262
2
void StatusWindow::updateLevelLabel()
263
{
264
2
    if (localPlayer == nullptr)
265
        return;
266
267
4
    const int groupId = localPlayer->getGroupId();
268
2
    const std::string &name = GroupDb::getName(groupId);
269
2
    if (!name.empty())
270
    {
271
        // TRANSLATORS: status window label
272
        mLvlLabel->setCaption(strprintf(_("Level: %d (%s %d)"),
273
            PlayerInfo::getAttribute(Attributes::PLAYER_BASE_LEVEL),
274
            name.c_str(),
275
            groupId));
276
    }
277
    else
278
    {
279
        // TRANSLATORS: status window label
280
4
        mLvlLabel->setCaption(strprintf(_("Level: %d"),
281
            PlayerInfo::getAttribute(Attributes::PLAYER_BASE_LEVEL)));
282
    }
283
2
    mLvlLabel->adjustSize();
284
}
285
286
void StatusWindow::attributeChanged(const AttributesT id,
287
                                    const int64_t oldVal,
288
                                    const int64_t newVal)
289
{
290
    static bool blocked = false;
291
292
    PRAGMA45(GCC diagnostic push)
293
    PRAGMA45(GCC diagnostic ignored "-Wswitch-enum")
294
    switch (id)
295
    {
296
        case Attributes::PLAYER_HP:
297
        case Attributes::PLAYER_MAX_HP:
298
            updateHPBar(mHpBar, true);
299
            break;
300
301
        case Attributes::PLAYER_MP:
302
        case Attributes::PLAYER_MAX_MP:
303
            updateMPBar(mMpBar, true);
304
            break;
305
306
        case Attributes::PLAYER_EXP:
307
        case Attributes::PLAYER_EXP_NEEDED:
308
            updateXPBar(mXpBar, false);
309
            break;
310
311
        case Attributes::MONEY:
312
            // TRANSLATORS: status window label
313
            mMoneyLabel->setCaption(strprintf(_("Money: %s"),
314
                UnitsDb::formatCurrency64(newVal).c_str()));
315
            mMoneyLabel->adjustSize();
316
            break;
317
318
        case Attributes::PLAYER_BASE_LEVEL:
319
            // TRANSLATORS: status window label
320
            mLvlLabel->setCaption(strprintf(_("Level: %d"),
321
                CAST_S32(newVal)));
322
            mLvlLabel->adjustSize();
323
            break;
324
325
        // +++ probable need use only some attributes here
326
        case Attributes::PLAYER_JOB_LEVEL:
327
        case Attributes::PLAYER_JOB_EXP:
328
        case Attributes::PLAYER_JOB_EXP_NEEDED:
329
            if (blocked)
330
                return;
331
            if (mJobLvlLabel != nullptr)
332
            {
333
                int lvl = PlayerInfo::getAttribute(
334
                    Attributes::PLAYER_JOB_LEVEL);
335
                const int64_t exp = PlayerInfo::getAttribute(
336
                    Attributes::PLAYER_JOB_EXP);
337
                const int64_t expNeed = PlayerInfo::getAttribute(
338
                    Attributes::PLAYER_JOB_EXP_NEEDED);
339
340
                if (lvl == 0)
341
                {
342
                    // possible server broken and don't send job level,
343
                    // then we fixing it.
344
                    if (expNeed < 20000)
345
                    {
346
                        lvl = 0;
347
                    }
348
                    else
349
                    {
350
                        lvl = CAST_S32((expNeed - 20000) / 150);
351
                        blocked = true;
352
                        PlayerInfo::setAttribute(Attributes::PLAYER_JOB_LEVEL,
353
                            lvl);
354
                        blocked = false;
355
                    }
356
                }
357
358
                if (id == Attributes::PLAYER_JOB_EXP &&
359
                    exp < oldVal &&
360
                    expNeed >= 20000)
361
                {   // possible job level up. but server broken and don't send
362
                    // new job exp limit, we fixing it
363
                    lvl ++;
364
                    blocked = true;
365
                    PlayerInfo::setAttribute(Attributes::PLAYER_JOB_EXP_NEEDED,
366
                        20000 + lvl * 150);
367
                    PlayerInfo::setAttribute(Attributes::PLAYER_JOB_LEVEL,
368
                        lvl);
369
                    blocked = false;
370
                }
371
372
                // TRANSLATORS: status window label
373
                mJobLvlLabel->setCaption(strprintf(_("Job: %d"), lvl));
374
                mJobLvlLabel->adjustSize();
375
376
                updateJobBar(mJobBar, false);
377
            }
378
            break;
379
380
        default:
381
            break;
382
    }
383
    PRAGMA45(GCC diagnostic pop)
384
}
385
386
void StatusWindow::setPointsNeeded(const AttributesT id,
387
                                   const int needed)
388
{
389
    mBasicStatsPage->setPointsNeeded(id, needed);
390
}
391
392
4
void StatusWindow::updateHPBar(ProgressBar *const bar, const bool showMax)
393
{
394
4
    if (bar == nullptr)
395
        return;
396
397
4
    const int hp = PlayerInfo::getAttribute(Attributes::PLAYER_HP);
398
4
    const int maxHp = PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP);
399
4
    if (showMax)
400

8
        bar->setText(toString(hp).append("/").append(toString(maxHp)));
401
    else
402
4
        bar->setText(toString(hp));
403
404
4
    float prog = 1.0;
405
4
    if (maxHp > 0)
406
        prog = static_cast<float>(hp) / static_cast<float>(maxHp);
407
4
    bar->setProgress(prog);
408
}
409
410
2
void StatusWindow::updateMPBar(ProgressBar *const bar,
411
                               const bool showMax) const
412
{
413
2
    if (bar == nullptr)
414
        return;
415
416
2
    const int mp = PlayerInfo::getAttribute(Attributes::PLAYER_MP);
417
2
    const int maxMp = PlayerInfo::getAttribute(Attributes::PLAYER_MAX_MP);
418
2
    if (showMax)
419

8
        bar->setText(toString(mp).append("/").append(toString(maxMp)));
420
    else
421
        bar->setText(toString(mp));
422
423
2
    float prog = 1.0F;
424
2
    if (maxMp > 0)
425
        prog = static_cast<float>(mp) / static_cast<float>(maxMp);
426
427
2
    if (playerHandler->canUseMagic())
428
    {
429
        bar->setColor(getThemeColor(ThemeColorId::MP_BAR),
430
            getThemeColor(ThemeColorId::MP_BAR_OUTLINE));
431
        bar->setProgressPalette(ProgressColorId::PROG_MP);
432
    }
433
    else
434
    {
435
6
        bar->setColor(getThemeColor(ThemeColorId::NO_MP_BAR),
436
            getThemeColor(ThemeColorId::NO_MP_BAR_OUTLINE));
437
2
        bar->setProgressPalette(ProgressColorId::PROG_NO_MP);
438
    }
439
440
2
    bar->setProgress(prog);
441
}
442
443
6
void StatusWindow::updateProgressBar(ProgressBar *const bar,
444
                                     const int64_t value,
445
                                     const int64_t max,
446
                                     const bool percent)
447
{
448
6
    if (bar == nullptr)
449
        return;
450
451
6
    if (max == 0)
452
    {
453
        // TRANSLATORS: status bar label
454

24
        bar->setText(_("Max"));
455
6
        bar->setProgress(1);
456
12
        bar->setText(toString(CAST_U64(value)));
457
    }
458
    else
459
    {
460
        const float progress = static_cast<float>(value)
461
            / static_cast<float>(max);
462
        if (percent)
463
        {
464
            bar->setText(strprintf("%2.5f%%",
465
                static_cast<double>(100 * progress)));
466
        }
467
        else
468
        {
469
            bar->setText(toString(
470
                CAST_U64(value)).append(
471
                "/").append(toString(
472
                CAST_U64(max))));
473
        }
474
        bar->setProgress(progress);
475
    }
476
}
477
478
4
void StatusWindow::updateXPBar(ProgressBar *const bar, const bool percent)
479
{
480
4
    if (bar == nullptr)
481
        return;
482
483
12
    updateProgressBar(bar,
484
4
        PlayerInfo::getAttribute(Attributes::PLAYER_EXP),
485
4
        PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED),
486
        percent);
487
}
488
489
2
void StatusWindow::updateJobBar(ProgressBar *const bar, const bool percent)
490
{
491
2
    if (bar == nullptr)
492
        return;
493
494
6
    updateProgressBar(bar,
495
2
        PlayerInfo::getAttribute(Attributes::PLAYER_JOB_EXP),
496
2
        PlayerInfo::getAttribute(Attributes::PLAYER_JOB_EXP_NEEDED),
497
        percent);
498
}
499
500
void StatusWindow::updateProgressBar(ProgressBar *const bar,
501
                                     const AttributesT id,
502
                                     const bool percent)
503
{
504
    const std::pair<int, int> exp =  PlayerInfo::getStatExperience(id);
505
    updateProgressBar(bar, exp.first, exp.second, percent);
506
}
507
508
void StatusWindow::updateWeightBar(ProgressBar *const bar)
509
{
510
    if (bar == nullptr)
511
        return;
512
513
    if (PlayerInfo::getAttribute(Attributes::MAX_WEIGHT) == 0)
514
    {
515
        // TRANSLATORS: status bar label
516
        bar->setText(_("Max"));
517
        bar->setProgress(1.0);
518
    }
519
    else
520
    {
521
        const int totalWeight = PlayerInfo::getAttribute(
522
            Attributes::TOTAL_WEIGHT);
523
        const int maxWeight = PlayerInfo::getAttribute(Attributes::MAX_WEIGHT);
524
        float progress = 1.0F;
525
        if (maxWeight != 0)
526
        {
527
            progress = static_cast<float>(totalWeight)
528
                / static_cast<float>(maxWeight);
529
        }
530
        bar->setText(strprintf("%s/%s",
531
            UnitsDb::formatWeight(totalWeight).c_str(),
532
            UnitsDb::formatWeight(maxWeight).c_str()));
533
        bar->setProgress(progress);
534
    }
535
}
536
537
2
void StatusWindow::updateMoneyBar(ProgressBar *const bar)
538
{
539
2
    if (bar == nullptr)
540
        return;
541
542
2
    const int money = PlayerInfo::getAttribute(Attributes::MONEY);
543
4
    bar->setText(UnitsDb::formatCurrency(money));
544
2
    if (money > 0)
545
    {
546
        const float progress = static_cast<float>(money)
547
            / static_cast<float>(1000000000);
548
        bar->setProgress(progress);
549
    }
550
    else
551
    {
552
2
        bar->setProgress(1.0);
553
    }
554
}
555
556
2
void StatusWindow::updateArrowsBar(ProgressBar *const bar)
557
{
558

2
    if ((bar == nullptr) || (equipmentWindow == nullptr))
559
        return;
560
561
    const Item *const item = equipmentWindow->getEquipment(
562
        inventoryHandler->getProjectileSlot());
563
564
    if ((item != nullptr) && item->getQuantity() > 0)
565
        bar->setText(toString(item->getQuantity()));
566
    else
567
        bar->setText("0");
568
}
569
570
void StatusWindow::updateInvSlotsBar(ProgressBar *const bar)
571
{
572
    if (bar == nullptr)
573
        return;
574
575
    const Inventory *const inv = PlayerInfo::getInventory();
576
    if (inv == nullptr)
577
        return;
578
579
    const int usedSlots = inv->getNumberOfSlotsUsed();
580
    const int maxSlots = inv->getSize();
581
582
    if (maxSlots != 0)
583
    {
584
        bar->setProgress(static_cast<float>(usedSlots)
585
            / static_cast<float>(maxSlots));
586
    }
587
588
    bar->setText(strprintf("%d", usedSlots));
589
}
590
591
std::string StatusWindow::translateLetter(const char *const letters)
592
{
593
    char buf[2];
594
    char *const str = gettext(letters);
595
    if ((str == nullptr) || strlen(str) != 3)
596
        return letters;
597
598
    buf[0] = str[1];
599
    buf[1] = 0;
600
    return std::string(buf);
601
}
602
603
std::string StatusWindow::translateLetter2(const std::string &letters)
604
{
605
    if (letters.size() < 5)
606
        return "";
607
608
    return std::string(gettext(letters.substr(1, 1).c_str()));
609
}
610
611
void StatusWindow::updateStatusBar(ProgressBar *const bar,
612
                                   const bool percent A_UNUSED) const
613
{
614
    if (bar == nullptr)
615
        return;
616
    bar->setText(translateLetter2(GameModifiers::getMoveTypeString())
617
        .append(translateLetter2(GameModifiers::getCrazyMoveTypeString()))
618
        .append(translateLetter2(GameModifiers::getMoveToTargetTypeString()))
619
        .append(translateLetter2(GameModifiers::getFollowModeString()))
620
        .append(" ").append(translateLetter2(
621
        GameModifiers::getAttackWeaponTypeString()))
622
        .append(translateLetter2(GameModifiers::getAttackTypeString()))
623
        .append(translateLetter2(GameModifiers::getMagicAttackTypeString()))
624
        .append(translateLetter2(GameModifiers::getPvpAttackTypeString()))
625
        .append(" ").append(translateLetter2(
626
        GameModifiers::getQuickDropCounterString()))
627
        .append(translateLetter2(GameModifiers::getPickUpTypeString()))
628
        .append(" ").append(translateLetter2(
629
        GameModifiers::getMapDrawTypeString()))
630
        .append(" ").append(translateLetter2(
631
        GameModifiers::getImitationModeString()))
632
        .append(translateLetter2(GameModifiers::getCameraModeString()))
633
        .append(translateLetter2(GameModifiers::getAwayModeString()))
634
        .append(translateLetter2(GameModifiers::getTargetingTypeString())));
635
636
    bar->setProgress(50);
637
    if (settings.disableGameModifiers)
638
        bar->setBackgroundColor(getThemeColor(ThemeColorId::STATUSBAR_ON));
639
    else
640
        bar->setBackgroundColor(getThemeColor(ThemeColorId::STATUSBAR_OFF));
641
}
642
643
void StatusWindow::action(const ActionEvent &event)
644
{
645
    if (chatWindow == nullptr)
646
        return;
647
648
    if (event.getId() == "copy")
649
    {
650
        chatWindow->addInputText(mBasicStatsPage->getStatsStr());
651
    }
652

6
}