GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/gui/widgets/tabs/setup_quick.cpp Lines: 0 26 0.0 %
Date: 2021-03-17 Branches: 0 142 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2009  The Mana World Development Team
4
 *  Copyright (C) 2011-2019  The ManaPlus Developers
5
 *  Copyright (C) 2009-2021  Andrei Karas
6
 *
7
 *  This file is part of The ManaPlus Client.
8
 *
9
 *  This program is free software; you can redistribute it and/or modify
10
 *  it under the terms of the GNU General Public License as published by
11
 *  the Free Software Foundation; either version 2 of the License, or
12
 *  any later version.
13
 *
14
 *  This program is distributed in the hope that it will be useful,
15
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 *  GNU General Public License for more details.
18
 *
19
 *  You should have received a copy of the GNU General Public License
20
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 */
22
23
#include "gui/widgets/tabs/setup_quick.h"
24
25
#include "gamemodifiers.h"
26
27
#include "gui/models/namesmodel.h"
28
29
#include "gui/widgets/containerplacer.h"
30
#include "gui/widgets/layouthelper.h"
31
#include "gui/widgets/setupquickitem.h"
32
#include "gui/widgets/scrollarea.h"
33
34
#include "utils/delete2.h"
35
#include "utils/gettext.h"
36
37
#include "debug.h"
38
39
Setup_Quick::Setup_Quick(const Widget2 *const widget) :
40
    SetupTabScroll(widget),
41
    mMoveTypeList(new NamesModel),
42
    mCrazyMoveTypeList(new NamesModel)
43
{
44
    // TRANSLATORS: quick tab in settings
45
    setName(_("Quick"));
46
47
    LayoutHelper h(this);
48
    ContainerPlacer place = h.getPlacer(0, 0);
49
    place(0, 0, mScroll, 10, 10);
50
51
    new SetupQuickItem("", this, "moveTypeEvent",
52
        &GameModifiers::getMoveTypeString,
53
        &GameModifiers::changeMoveType);
54
55
    new SetupQuickItem("", this, "crazyMoveTypeEvent",
56
        &GameModifiers::getCrazyMoveTypeString,
57
        &GameModifiers::changeCrazyMoveType);
58
59
    new SetupQuickItem("", this, "moveToTargetTypeEvent",
60
        &GameModifiers::getMoveToTargetTypeString,
61
        &GameModifiers::changeMoveToTargetType);
62
63
    new SetupQuickItem("", this, "followModeEvent",
64
        &GameModifiers::getFollowModeString,
65
        &GameModifiers::changeFollowMode);
66
67
    new SetupQuickItem("", this, "attackWeaponTypeEvent",
68
        &GameModifiers::getAttackWeaponTypeString,
69
        &GameModifiers::changeAttackWeaponType);
70
71
    new SetupQuickItem("", this, "attackTypeEvent",
72
        &GameModifiers::getAttackTypeString,
73
        &GameModifiers::changeAttackType);
74
75
    new SetupQuickItem("", this, "magicAttackTypeEvent",
76
        &GameModifiers::getMagicAttackTypeString,
77
        &GameModifiers::changeMagicAttackType);
78
79
    new SetupQuickItem("", this, "pvpAttackTypeEvent",
80
        &GameModifiers::getPvpAttackTypeString,
81
        &GameModifiers::changePvpAttackType);
82
83
    new SetupQuickItem("", this, "quickDropCounterEvent",
84
        &GameModifiers::getQuickDropCounterString,
85
        &GameModifiers::changeQuickDropCounter);
86
87
    new SetupQuickItem("", this, "pickUpTypeEvent",
88
        &GameModifiers::getPickUpTypeString,
89
        &GameModifiers::changePickUpType);
90
91
    new SetupQuickItem("", this, "mapDrawTypeEvent",
92
        &GameModifiers::getMapDrawTypeString,
93
        &GameModifiers::changeMapDrawType);
94
95
    new SetupQuickItem("", this, "imitationModeEvent",
96
        &GameModifiers::getImitationModeString,
97
        &GameModifiers::changeImitationMode);
98
99
    new SetupQuickItem("", this, "CameraModeEvent",
100
        &GameModifiers::getCameraModeString,
101
        &GameModifiers::changeCameraMode);
102
103
    new SetupQuickItem("", this, "awayModeEvent",
104
        &GameModifiers::getAwayModeString,
105
        &GameModifiers::changeAwayMode);
106
107
    new SetupQuickItem("", this, "targetingTypeEvent",
108
        &GameModifiers::getTargetingTypeString,
109
        &GameModifiers::changeTargetingType);
110
111
    setDimension(Rect(0, 0, 550, 350));
112
}
113
114
Setup_Quick::~Setup_Quick()
115
{
116
    delete2(mMoveTypeList)
117
    delete2(mCrazyMoveTypeList)
118
}