File include/vn.h changed (mode: 100644) (index e33d12b..e1a9c8c) |
... |
... |
bool vnDraw( |
202 |
202 |
float tlines = |
float tlines = |
203 |
203 |
( tw > std::min( vn_width, sw / vnScale ) || hasNewline ) |
( tw > std::min( vn_width, sw / vnScale ) || hasNewline ) |
204 |
204 |
? 2.0f : ( convo.screen.caption.length() > 0 ? 1.0f : 0.0f ); |
? 2.0f : ( convo.screen.caption.length() > 0 ? 1.0f : 0.0f ); |
|
205 |
|
double f = convo.screen.lines.empty() ? 0.95 : 0.7409; |
205 |
206 |
float ypos = |
float ypos = |
206 |
|
( vn_height * 0.7409 - font.size * 1.2 * tlines - font.size * 0.17 ) * vnScale; |
|
|
207 |
|
( vn_height * f - font.size * 1.2 * tlines - font.size * 0.17 ) * vnScale; |
207 |
208 |
|
|
208 |
209 |
// Hide the shade if noshade is non-zero. |
// Hide the shade if noshade is non-zero. |
209 |
210 |
auto noshade_it = convo.numbers.find( "noshade" ); |
auto noshade_it = convo.numbers.find( "noshade" ); |
210 |
211 |
bool noshade = noshade_it != convo.numbers.end() && noshade_it->second; |
bool noshade = noshade_it != convo.numbers.end() && noshade_it->second; |
211 |
|
if( convo.screen.ids.size() > 0 && !darken && !noshade ){ |
|
212 |
|
// There are buttons and something to draw a gradient over. |
|
213 |
|
double y = ypos + ( tlines > 0.0f ? tlines : 8.0f ) * vnScale; |
|
|
212 |
|
if( ( convo.screen.lines.size() > 0 || convo.screen.caption.length() > 0 ) |
|
213 |
|
&& !darken && !noshade ){ |
|
214 |
|
// Draw a shade gradient. |
214 |
215 |
vnDrawImage( |
vnDrawImage( |
215 |
216 |
vn_tex_gradient, |
vn_tex_gradient, |
216 |
217 |
vnOffX, |
vnOffX, |
217 |
|
y, |
|
|
218 |
|
ypos + ( tlines > 0.0f ? tlines : 8.0f ) * vnScale, |
218 |
219 |
0.0f, |
0.0f, |
219 |
220 |
vn_width * vnScale / vn_tex_gradient.width, |
vn_width * vnScale / vn_tex_gradient.width, |
220 |
221 |
( sh - (vn_height * 0.7409 - font.size * 2.57) * vnScale ) / vn_tex_gradient.height |
( sh - (vn_height * 0.7409 - font.size * 2.57) * vnScale ) / vn_tex_gradient.height |
|
... |
... |
bool vnDraw( |
250 |
251 |
} |
} |
251 |
252 |
} |
} |
252 |
253 |
|
|
253 |
|
float buttonHeight = font.size * 1.333f; |
|
254 |
|
|
|
255 |
|
// Draw buttons. |
|
256 |
|
if( convo.screen.lines.size() > 0 |
|
257 |
|
&& convo.screen.lines[0].length() > 4 |
|
|
254 |
|
if( convo.screen.lines.empty() ){ |
|
255 |
|
// Handle button-free screen advance. |
|
256 |
|
choiceIndex = 0; |
|
257 |
|
}else if( convo.screen.lines[0].length() > 4 |
258 |
258 |
&& convo.screen.lines[0].substr( 0, 4 ) == "img-" ){ |
&& convo.screen.lines[0].substr( 0, 4 ) == "img-" ){ |
|
259 |
|
// Draw image buttons. |
259 |
260 |
double total_width = 0.0; |
double total_width = 0.0; |
260 |
261 |
std::vector<fgl::Texture*> img_buttons; |
std::vector<fgl::Texture*> img_buttons; |
261 |
262 |
for( auto &str : convo.screen.lines ){ |
for( auto &str : convo.screen.lines ){ |
|
... |
... |
bool vnDraw( |
315 |
316 |
fgl::setPipeline( fgl::colorModPipeline ); |
fgl::setPipeline( fgl::colorModPipeline ); |
316 |
317 |
fgl::setFog( { 1.0f, 1.0f, 1.0f, 1.0f } ); |
fgl::setFog( { 1.0f, 1.0f, 1.0f, 1.0f } ); |
317 |
318 |
}else{ |
}else{ |
|
319 |
|
// Draw text buttons. |
318 |
320 |
std::string cont; |
std::string cont; |
319 |
321 |
if( language == "el" ){ |
if( language == "el" ){ |
320 |
322 |
cont = u8"Συνέχισε →"; |
cont = u8"Συνέχισε →"; |
|
... |
... |
bool vnDraw( |
323 |
325 |
}else{ |
}else{ |
324 |
326 |
cont = u8"Continue →"; |
cont = u8"Continue →"; |
325 |
327 |
} |
} |
|
328 |
|
float buttonHeight = font.size * 1.333f; |
326 |
329 |
for( size_t i = 0; i < convo.screen.ids.size(); i++ ){ |
for( size_t i = 0; i < convo.screen.ids.size(); i++ ){ |
327 |
330 |
float ypos = ( vn_height * 0.7409 + buttonHeight * (float)i ) * vnScale; |
float ypos = ( vn_height * 0.7409 + buttonHeight * (float)i ) * vnScale; |
328 |
331 |
bool hover = |
bool hover = |