-
Notifications
You must be signed in to change notification settings - Fork 2
/
anviltooltip.cpp
205 lines (178 loc) · 7.16 KB
/
anviltooltip.cpp
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#include "stdafx.h"
#include "anviltooltip.h"
#include "stdafx.h"
#include "steelworktooltip.h"
void anviltooltip::render(HDC hdc, int num, RECT rc,string _item_name)
{
_item = DATABASE->GetItem_Make(_item_name);
_item_Kind = DATABASE->GetItem(_item_name);
int t_width = IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth();
IMAGEMANAGER->render("img_UI_construction_Tooltip", hdc, rc.left - t_width, rc.top);
switch (num)
{
case 0:
IMAGEMANAGER->render(_item.materials_one, hdc, rc.left - t_width + 20, rc.top + 10);
POINT pos;
pos.x = rc.left - t_width + 100;
pos.y = rc.top + 20;
TEXTMANAGER->ShowText(hdc, false, to_string(ITEMMANAGER->item_count(_item.materials_one)), pos, 20, 0);
pos.x = rc.left - t_width + 140;
pos.y = rc.top + 20;
TEXTMANAGER->ShowText(hdc, false, "/ "+to_string( _item.one), pos, 20, 0);
break;
case 1:
pos.x = rc.left - t_width + 100;
pos.y = rc.top + 40;
TEXTMANAGER->ShowText(hdc, false, "미개봉", pos, 20, 0);
break;
case 2:
IMAGEMANAGER->render(_item.materials_one, hdc, rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 10, rc.top );
IMAGEMANAGER->render(_item.materials_two, hdc, rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 20, rc.top + 50);
pos.x = rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 100;
pos.y = rc.top + 20;
TEXTMANAGER->ShowText(hdc, false, to_string(ITEMMANAGER->item_count(_item.materials_one)), pos, 20, 0);
pos.x = rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 140;
pos.y = rc.top + 20;
TEXTMANAGER->ShowText(hdc, false, "/ " + to_string(_item.one), pos, 20, 0);
pos.x = rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 100;
pos.y = rc.top + 60;
TEXTMANAGER->ShowText(hdc, false, to_string(ITEMMANAGER->item_count(_item.materials_two)), pos, 20, 0);
pos.x = rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 140;
pos.y = rc.top + 60;
TEXTMANAGER->ShowText(hdc, false, "/ " + to_string(_item.two), pos, 20, 0);
break;
case 3:
IMAGEMANAGER->render(_item.materials_one, hdc, rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 10, rc.top);
IMAGEMANAGER->render(_item.materials_two, hdc, rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 20, rc.top + 50);
pos.x = rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 100;
pos.y = rc.top + 20;
TEXTMANAGER->ShowText(hdc, false, to_string(ITEMMANAGER->item_count(_item.materials_one)), pos, 20, 0);
pos.x = rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 140;
pos.y = rc.top + 20;
TEXTMANAGER->ShowText(hdc, false, "/ " + to_string(_item.one), pos, 20, 0);
pos.x = rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 100;
pos.y = rc.top + 60;
TEXTMANAGER->ShowText(hdc, false, to_string(ITEMMANAGER->item_count(_item.materials_two)), pos, 20, 0);
pos.x = rc.left - IMAGEMANAGER->findImage("img_UI_construction_Tooltip")->getWidth() + 140;
pos.y = rc.top + 60;
TEXTMANAGER->ShowText(hdc, false, "/ " + to_string(_item.two), pos, 20, 0);
break;
case 4:
pos.x = rc.left - t_width + 100;
pos.y = rc.top + 40;
TEXTMANAGER->ShowText(hdc, false, "미개봉", pos, 20, 0);
break;
case 5:
IMAGEMANAGER->render(_item.materials_one, hdc, rc.left - t_width + 20, rc.top + 10);
IMAGEMANAGER->render(_item.materials_two, hdc, rc.left - t_width + 20, rc.top + 50);
pos.x = rc.left - t_width + 100;
pos.y = rc.top + 20;
TEXTMANAGER->ShowText(hdc, false, to_string(ITEMMANAGER->item_count(_item.materials_one)), pos, 20, 0);
pos.x = rc.left - t_width + 140;
pos.y = rc.top + 20;
TEXTMANAGER->ShowText(hdc, false, "/ " + to_string(_item.one), pos, 20, 0);
pos.x = rc.left - t_width + 100;
pos.y = rc.top + 60;
TEXTMANAGER->ShowText(hdc, false, to_string(ITEMMANAGER->item_count(_item.materials_two)), pos, 20, 0);
pos.x = rc.left - t_width + 140;
pos.y = rc.top + 60;
TEXTMANAGER->ShowText(hdc, false, "/ " + to_string(_item.two), pos, 20, 0);
break;
case 6:
IMAGEMANAGER->render(_item.materials_one, hdc, rc.left - t_width + 20, rc.top + 10);
IMAGEMANAGER->render(_item.materials_two, hdc, rc.left - t_width + 20, rc.top + 50);
pos.x = rc.left - t_width + 100;
pos.y = rc.top + 20;
TEXTMANAGER->ShowText(hdc, false, to_string(ITEMMANAGER->item_count(_item.materials_one)), pos, 20, 0);
pos.x = rc.left - t_width + 140;
pos.y = rc.top + 20;
TEXTMANAGER->ShowText(hdc, false, "/ " + to_string(_item.one), pos, 20, 0);
pos.x = rc.left - t_width + 100;
pos.y = rc.top + 60;
TEXTMANAGER->ShowText(hdc, false, to_string(ITEMMANAGER->item_count(_item.materials_two)), pos, 20, 0);
pos.x = rc.left - t_width + 140;
pos.y = rc.top + 60;
TEXTMANAGER->ShowText(hdc, false, "/ " + to_string(_item.two), pos, 20, 0);
break;
case 7:
pos.x = rc.left - t_width + 100;
pos.y = rc.top + 40;
TEXTMANAGER->ShowText(hdc, false, "미개봉", pos, 20, 0);
break;
case 8:
pos.x = rc.left - t_width + 100;
pos.y = rc.top + 40;
TEXTMANAGER->ShowText(hdc, false, "미개봉", pos, 20, 0);
break;
}
if (cilck()) {
click_item_event(_item_name);
}
}
void anviltooltip::click_item_event(string item_key)
{
if (item_key != "") {
switch (_item.materials_count)
{
case 1:
if (PRODUCTIONMANAGER->is_Item_Cilck(_item.itemKey)) {
if (ITEMMANAGER->Item_count_Minus(_item.materials_one, _item.one)) {
PRODUCTIONMANAGER->isCount(_item.itemKey);
WeaponeUpgrad();
}
}
break;
case 2:
if (PRODUCTIONMANAGER->is_Item_Cilck(_item.itemKey)) {
if (ITEMMANAGER->Item_count_Minus(_item.materials_one, _item.one, _item.materials_two, _item.two)) {
PRODUCTIONMANAGER->isCount(_item.itemKey);
WeaponeUpgrad();
}
}
break;
case 3:
if (PRODUCTIONMANAGER->is_Item_Cilck(_item.itemKey)) {
if (ITEMMANAGER->Item_count_Minus(_item.materials_one, _item.one, _item.materials_two, _item.two, _item.materials_Three, _item.three)) {
PRODUCTIONMANAGER->isCount(_item.itemKey);
WeaponeUpgrad();
}
}
break;
case 4:
if (PRODUCTIONMANAGER->is_Item_Cilck(_item.itemKey)) {
if (ITEMMANAGER->Item_count_Minus(_item.materials_one, _item.one, _item.materials_two, _item.two, _item.materials_Three, _item.three, _item.materials_Four, _item.four)) {
PRODUCTIONMANAGER->isCount(_item.itemKey);
WeaponeUpgrad();
}
}
break;
}
}
}
bool anviltooltip::cilck()
{
if (INPUT->GetKeyDown(VK_LBUTTON)) {
SOUNDMANAGER->play("생산시작");
return true;
}
return false;
}
void anviltooltip::WeaponeUpgrad()
{
string name;
switch (_item_Kind.weaponType)
{
case WeaponType::BOW:
UPGRADEMANAGER->_upgradeBow++;
UPGRADEMANAGER->SetWeaponeBowName("bowDrop" + to_string(UPGRADEMANAGER->_upgradeBow));
break;
case WeaponType::PICKAXE:
UPGRADEMANAGER->_upgradePickaxe++;
UPGRADEMANAGER->SetWeaponePickaxName("pickaxe" + to_string(UPGRADEMANAGER->_upgradePickaxe));
break;
case WeaponType::SWORD:
UPGRADEMANAGER->_upgradeSword++;
UPGRADEMANAGER->SetWeaponeSwordName("swordDrop" + to_string(UPGRADEMANAGER->_upgradeSword));
break;
}
}