MCPcopy Create free account
hub / github.com/EasyRPG/Player / Refresh

Method Refresh

src/window_shop.cpp:106–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void Window_Shop::Refresh() {
107 contents->Clear();
108
109 int x = 0;
110 if (!Main_Data::game_system->GetMessageFaceName().empty()) {
111 if (!Main_Data::game_system->IsMessageFaceRightPosition()) {
112 x += LeftMargin + FaceSize + RightFaceMargin;
113 DrawFace(Main_Data::game_system->GetMessageFaceName(), Main_Data::game_system->GetMessageFaceIndex(), LeftMargin, TopMargin, Main_Data::game_system->IsMessageFaceFlipped());
114 }
115 else {
116 DrawFace(Main_Data::game_system->GetMessageFaceName(), Main_Data::game_system->GetMessageFaceIndex(), 248, TopMargin, Main_Data::game_system->IsMessageFaceFlipped());
117 }
118 }
119
120 int idx = 0;
121 switch (mode) {
122 case Scene_Shop::BuySellLeave:
123 case Scene_Shop::BuySellLeave2:
124 contents->TextDraw(x, 2, Font::ColorDefault,
125 mode == Scene_Shop::BuySellLeave2
126 ? regreeting
127 : greeting);
128 idx++;
129
130 contents->TextDraw(x + 12, 2 + idx * 16, Font::ColorDefault, buy_msg);
131 buy_index = idx++;
132
133 contents->TextDraw(x + 12, 2 + idx * 16, Font::ColorDefault, sell_msg);
134 sell_index = idx++;
135
136 contents->TextDraw(x + 12, 2 + idx * 16, Font::ColorDefault, leave_msg);
137 leave_index = idx++;
138 break;
139 case Scene_Shop::Buy:
140 contents->TextDraw(x, 2, Font::ColorDefault, buy_select);
141 break;
142 case Scene_Shop::BuyHowMany:
143 contents->TextDraw(x, 2, Font::ColorDefault, buy_number);
144 break;
145 case Scene_Shop::Bought:
146 contents->TextDraw(x, 2, Font::ColorDefault, purchased);
147 break;
148 case Scene_Shop::Sell:
149 contents->TextDraw(x, 2, Font::ColorDefault, sell_select);
150 break;
151 case Scene_Shop::SellHowMany:
152 contents->TextDraw(x, 2, Font::ColorDefault, sell_number);
153 break;
154 case Scene_Shop::Sold:
155 contents->TextDraw(x, 2, Font::ColorDefault, sold_msg);
156 break;
157 }
158
159 UpdateCursorRect();
160}
161
162void Window_Shop::SetMode(int nmode) {
163 mode = nmode;

Callers

nothing calls this directly

Calls 7

GetMessageFaceNameMethod · 0.80
GetMessageFaceIndexMethod · 0.80
IsMessageFaceFlippedMethod · 0.80
TextDrawMethod · 0.80
ClearMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected