aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Player/CUFProfile.h
blob: 601255e58a39fc16c7fff8f56a700ce2fd96cf7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef CUFProfile_h__
#define CUFProfile_h__

#include "Define.h"
#include <bitset>
#include <string>

/// Maximum number of CompactUnitFrames profiles
#define MAX_CUF_PROFILES 5

/// Bit index used in the many bool options of CompactUnitFrames
enum CUFBoolOptions
{
    CUF_KEEP_GROUPS_TOGETHER,
    CUF_DISPLAY_PETS,
    CUF_DISPLAY_MAIN_TANK_AND_ASSIST,
    CUF_DISPLAY_HEAL_PREDICTION,
    CUF_DISPLAY_AGGRO_HIGHLIGHT,
    CUF_DISPLAY_ONLY_DISPELLABLE_DEBUFFS,
    CUF_DISPLAY_POWER_BAR,
    CUF_DISPLAY_BORDER,
    CUF_USE_CLASS_COLORS,
    CUF_DISPLAY_HORIZONTAL_GROUPS,
    CUF_DISPLAY_NON_BOSS_DEBUFFS,
    CUF_DYNAMIC_POSITION,
    CUF_LOCKED,
    CUF_SHOWN,
    CUF_AUTO_ACTIVATE_2_PLAYERS,
    CUF_AUTO_ACTIVATE_3_PLAYERS,
    CUF_AUTO_ACTIVATE_5_PLAYERS,
    CUF_AUTO_ACTIVATE_10_PLAYERS,
    CUF_AUTO_ACTIVATE_15_PLAYERS,
    CUF_AUTO_ACTIVATE_25_PLAYERS,
    CUF_AUTO_ACTIVATE_40_PLAYERS,
    CUF_AUTO_ACTIVATE_SPEC_1,
    CUF_AUTO_ACTIVATE_SPEC_2,
    CUF_AUTO_ACTIVATE_SPEC_3,
    CUF_AUTO_ACTIVATE_SPEC_4,
    CUF_AUTO_ACTIVATE_PVP,
    CUF_AUTO_ACTIVATE_PVE,

    CUF_BOOL_OPTIONS_COUNT,
};

/// Represents a CompactUnitFrame profile
struct CUFProfile
{
    CUFProfile() : ProfileName(), BoolOptions() // might want to change default value for options
    {
        FrameHeight = 0;
        FrameWidth = 0;
        SortBy = 0;
        HealthText = 0;
        TopPoint = 0;
        BottomPoint = 0;
        LeftPoint = 0;
        TopOffset = 0;
        BottomOffset = 0;
        LeftOffset = 0;
    }

    CUFProfile(std::string const& name, uint16 frameHeight, uint16 frameWidth, uint8 sortBy, uint8 healthText, uint32 boolOptions,
        uint8 topPoint, uint8 bottomPoint, uint8 leftPoint, uint16 topOffset, uint16 bottomOffset, uint16 leftOffset)
        : ProfileName(name), BoolOptions(int(boolOptions))
    {
        FrameHeight = frameHeight;
        FrameWidth = frameWidth;
        SortBy = sortBy;
        HealthText = healthText;
        TopPoint = topPoint;
        BottomPoint = bottomPoint;
        LeftPoint = leftPoint;
        TopOffset = topOffset;
        BottomOffset = bottomOffset;
        LeftOffset = leftOffset;
    }

    std::string ProfileName;
    uint16 FrameHeight;
    uint16 FrameWidth;
    uint8 SortBy;
    uint8 HealthText;

    // LeftAlign, TopAlight, BottomAlign
    uint8 TopPoint;
    uint8 BottomPoint;
    uint8 LeftPoint;

    // LeftOffset, TopOffset and BottomOffset
    uint16 TopOffset;
    uint16 BottomOffset;
    uint16 LeftOffset;

    std::bitset<CUF_BOOL_OPTIONS_COUNT> BoolOptions;

    // More fields can be added to BoolOptions without changing DB schema (up to 32, currently 27)
};

#endif // CUFProfile_h__