YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
BattleMoveInfoMenu.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Graphics/Gui/Padding.hpp
"
2
#include "
YAPOG/Graphics/Game/Sprite/Sprite.hpp
"
3
#include "
YAPOG/Graphics/Gui/WidgetBackground.hpp
"
4
#include "
YAPOG/Graphics/Gui/WidgetBorder.hpp
"
5
#include "
YAPOG/System/StringHelper.hpp
"
6
7
#include "
Battle/BattleMoveInfoMenu.hpp
"
8
9
namespace
ycl
10
{
11
BattleMoveInfoMenu::BattleMoveInfoMenu
()
12
:
BaseBattleWidget
()
13
, pp_ ()
14
, type_ ()
15
{
16
yap::WidgetBackground
* menuBck =
17
new
yap::WidgetBackground
(
18
"WindowSkins/BasicSkin/Global/WindowBackgroundTexture.png"
,
true
);
19
20
yap::Texture
* t =
new
yap::Texture
();
21
t->
LoadFromFile
(
"WindowSkins/BasicSkin/Global/TopBorder.png"
);
22
yap::Texture
* tr =
new
yap::Texture
();
23
tr->
LoadFromFile
(
"WindowSkins/BasicSkin/Global/TopRightCorner.png"
);
24
yap::Texture
* r =
new
yap::Texture
();
25
r->
LoadFromFile
(
"WindowSkins/BasicSkin/Global/RightBorder.png"
);
26
yap::Texture
* br =
new
yap::Texture
();
27
br->
LoadFromFile
(
"WindowSkins/BasicSkin/Global/BottomRightCorner.png"
);
28
yap::Texture
* b =
new
yap::Texture
();
29
b->
LoadFromFile
(
"WindowSkins/BasicSkin/Global/BottomBorder.png"
);
30
yap::Texture
* bl =
new
yap::Texture
();
31
bl->
LoadFromFile
(
"WindowSkins/BasicSkin/Global/BottomLeftCorner.png"
);
32
yap::Texture
* l =
new
yap::Texture
();
33
l->
LoadFromFile
(
"WindowSkins/BasicSkin/Global/LeftBorder.png"
);
34
yap::Texture
* tl =
new
yap::Texture
();
35
tl->
LoadFromFile
(
"WindowSkins/BasicSkin/Global/TopLeftCorner.png"
);
36
37
yap::WidgetBorder
* menuBorder =
38
new
yap::WidgetBorder
(*t, *tr, *r, *br, *b, *bl, *l, *tl,
true
);
39
40
this->
SetSize
(
yap::Vector2
(231, 129));
41
42
type_
.
SetPicture
(
new
yap::Sprite
(
"Pictures/Types/0.png"
));
43
44
pp_
.
Move
(
yap::Vector2
(85, 20));
45
type_
.
Move
(
yap::Vector2
(70, 70));
46
47
this->
AddChild
(
pp_
);
48
this->
AddChild
(
type_
);
49
50
SetBackground
(*menuBck);
51
SetBorder
(*menuBorder);
52
}
53
54
BattleMoveInfoMenu::~BattleMoveInfoMenu
()
55
{
56
}
57
59
void
BattleMoveInfoMenu::SetPPLabel
(
const
yap::String
& value)
60
{
61
pp_
.
SetText
(value);
62
}
63
64
void
BattleMoveInfoMenu::SetPP
(
const
yap::PokemonMove
& skill)
65
{
66
pp_
.
SetText
(
67
yap::StringHelper::ToString
(skill.
GetCurrentPP
()) +
68
"/"
+
69
yap::StringHelper::ToString
(skill.
GetMaxPP
()));
70
}
71
72
void
BattleMoveInfoMenu::SetType
(
const
yap::TypeInfo
& type)
73
{
74
type_
.
Show
(
true
);
75
76
type_
.
SetPicture
(
new
yap::Sprite
(
"Pictures/Types/"
+
77
yap::StringHelper::ToString
(type.
GetID
().
GetValue
())
78
+
".png"
));
79
}
80
81
void
BattleMoveInfoMenu::HideType
()
82
{
83
type_
.
Show
(
false
);
84
}
85
86
}
// namespace yap
YAPOG.Client
src
Battle
BattleMoveInfoMenu.cpp
Generated on Mon Sep 17 2012 22:24:21 for YAPOG by
1.8.1.1