ManaPlus
src
resources
cursors.cpp
Go to the documentation of this file.
1
/*
2
* The ManaPlus Client
3
* Copyright (C) 2012-2019 The ManaPlus Developers
4
* Copyright (C) 2019-2021 Andrei Karas
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 "
resources/cursors.h
"
23
24
#include "
debug.h
"
25
26
namespace
Cursors
27
{
28
static
const
StrToCursor
hoverCursors
[] =
29
{
30
{
"select"
,
Cursor::CURSOR_POINTER
},
31
{
"pointer"
,
Cursor::CURSOR_POINTER
},
32
{
"lr"
,
Cursor::CURSOR_RESIZE_ACROSS
},
33
{
"rl"
,
Cursor::CURSOR_RESIZE_ACROSS
},
34
{
"resizeAcross"
,
Cursor::CURSOR_RESIZE_ACROSS
},
35
{
"ud"
,
Cursor::CURSOR_RESIZE_DOWN
},
36
{
"du"
,
Cursor::CURSOR_RESIZE_DOWN
},
37
{
"resizeDown"
,
Cursor::CURSOR_RESIZE_DOWN
},
38
{
"ldru"
,
Cursor::CURSOR_RESIZE_DOWN_LEFT
},
39
{
"ruld"
,
Cursor::CURSOR_RESIZE_DOWN_LEFT
},
40
{
"ld"
,
Cursor::CURSOR_RESIZE_DOWN_LEFT
},
41
{
"ru"
,
Cursor::CURSOR_RESIZE_DOWN_LEFT
},
42
{
"resizeDownLeft"
,
Cursor::CURSOR_RESIZE_DOWN_LEFT
},
43
{
"lurd"
,
Cursor::CURSOR_RESIZE_DOWN_RIGHT
},
44
{
"rdlu"
,
Cursor::CURSOR_RESIZE_DOWN_RIGHT
},
45
{
"rd"
,
Cursor::CURSOR_RESIZE_DOWN_RIGHT
},
46
{
"lu"
,
Cursor::CURSOR_RESIZE_DOWN_RIGHT
},
47
{
"resizeDownRight"
,
Cursor::CURSOR_RESIZE_DOWN_RIGHT
},
48
{
"attack"
,
Cursor::CURSOR_FIGHT
},
49
{
"fight"
,
Cursor::CURSOR_FIGHT
},
50
{
"take"
,
Cursor::CURSOR_PICKUP
},
51
{
"pickup"
,
Cursor::CURSOR_PICKUP
},
52
{
"talk"
,
Cursor::CURSOR_TALK
},
53
{
"action"
,
Cursor::CURSOR_ACTION
},
54
{
"left"
,
Cursor::CURSOR_LEFT
},
55
{
"up"
,
Cursor::CURSOR_UP
},
56
{
"right"
,
Cursor::CURSOR_RIGHT
},
57
{
"down"
,
Cursor::CURSOR_DOWN
}
58
};
59
60
CursorT
stringToCursor
(
const
std::string &name)
61
{
62
for
(
size_t
f = 0; f <
sizeof
(
hoverCursors
) /
sizeof
(
StrToCursor
);
63
f ++)
64
{
65
if
(
hoverCursors
[f].str == name)
66
return
hoverCursors
[f].
cursor
;
67
}
68
return
Cursor::CURSOR_POINTER
;
69
}
70
}
// namespace Cursors
CursorT
Cursor ::T CursorT
Definition:
cursor.h:44
cursors.h
debug.h
Cursor::CURSOR_FIGHT
@ CURSOR_FIGHT
Definition:
cursor.h:34
Cursor::CURSOR_RESIZE_DOWN_RIGHT
@ CURSOR_RESIZE_DOWN_RIGHT
Definition:
cursor.h:33
Cursor::CURSOR_PICKUP
@ CURSOR_PICKUP
Definition:
cursor.h:35
Cursor::CURSOR_RESIZE_DOWN
@ CURSOR_RESIZE_DOWN
Definition:
cursor.h:31
Cursor::CURSOR_RIGHT
@ CURSOR_RIGHT
Definition:
cursor.h:40
Cursor::CURSOR_POINTER
@ CURSOR_POINTER
Definition:
cursor.h:29
Cursor::CURSOR_LEFT
@ CURSOR_LEFT
Definition:
cursor.h:38
Cursor::CURSOR_RESIZE_DOWN_LEFT
@ CURSOR_RESIZE_DOWN_LEFT
Definition:
cursor.h:32
Cursor::CURSOR_RESIZE_ACROSS
@ CURSOR_RESIZE_ACROSS
Definition:
cursor.h:30
Cursor::CURSOR_UP
@ CURSOR_UP
Definition:
cursor.h:39
Cursor::CURSOR_TALK
@ CURSOR_TALK
Definition:
cursor.h:36
Cursor::CURSOR_DOWN
@ CURSOR_DOWN
Definition:
cursor.h:41
Cursor::CURSOR_ACTION
@ CURSOR_ACTION
Definition:
cursor.h:37
Cursors
Definition:
cursors.cpp:27
Cursors::hoverCursors
static const StrToCursor hoverCursors[]
Definition:
cursors.cpp:28
Cursors::stringToCursor
CursorT stringToCursor(const std::string &name)
Definition:
cursors.cpp:60
Cursors::StrToCursor
Definition:
cursors.h:34
Cursors::StrToCursor::cursor
CursorT cursor
Definition:
cursors.h:38
Generated on Wed Mar 17 2021 19:19:09 for ManaPlus by
1.9.1