mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-08 18:09:45 +01:00
Allow a maximum of 26 lines, with L suffix
This commit is contained in:
parent
299ed90493
commit
1183083355
6 changed files with 38 additions and 6 deletions
|
@ -1347,6 +1347,17 @@ void Graphics::addline( const std::string& t )
|
||||||
textboxes[m].addline(t);
|
textboxes[m].addline(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Graphics::setlarge(bool large)
|
||||||
|
{
|
||||||
|
if (!INBOUNDS_VEC(m, textboxes))
|
||||||
|
{
|
||||||
|
vlog_error("setlarge() out-of-bounds!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
textboxes[m].large = large;
|
||||||
|
}
|
||||||
|
|
||||||
void Graphics::textboxadjust(void)
|
void Graphics::textboxadjust(void)
|
||||||
{
|
{
|
||||||
if (!INBOUNDS_VEC(m, textboxes))
|
if (!INBOUNDS_VEC(m, textboxes))
|
||||||
|
|
|
@ -117,6 +117,8 @@ public:
|
||||||
|
|
||||||
void addline(const std::string& t);
|
void addline(const std::string& t);
|
||||||
|
|
||||||
|
void setlarge(bool large);
|
||||||
|
|
||||||
void textboxtimer(int t);
|
void textboxtimer(int t);
|
||||||
|
|
||||||
void textboxremove(void);
|
void textboxremove(void);
|
||||||
|
|
|
@ -48,6 +48,7 @@ scriptclass::scriptclass(void)
|
||||||
textpad_right = 0;
|
textpad_right = 0;
|
||||||
textpadtowidth = 0;
|
textpadtowidth = 0;
|
||||||
textcase = 1;
|
textcase = 1;
|
||||||
|
textlarge = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void scriptclass::clearcustom(void)
|
void scriptclass::clearcustom(void)
|
||||||
|
@ -519,9 +520,13 @@ void scriptclass::run(void)
|
||||||
textx = ss_toi(words[2]);
|
textx = ss_toi(words[2]);
|
||||||
texty = ss_toi(words[3]);
|
texty = ss_toi(words[3]);
|
||||||
|
|
||||||
|
// If words[4] ends with L, set large to true.
|
||||||
|
textlarge = (words[4].size() > 0 && words[4][words[4].size() - 1] == 'l');
|
||||||
|
int lines = ss_toi(words[4].substr(0, words[4].size() - (textlarge ? 1 : 0)));
|
||||||
|
|
||||||
//Number of lines for the textbox!
|
//Number of lines for the textbox!
|
||||||
txt.clear();
|
txt.clear();
|
||||||
for (int i = 0; i < ss_toi(words[4]); i++)
|
for (int i = 0; i < lines; i++)
|
||||||
{
|
{
|
||||||
position++;
|
position++;
|
||||||
if (INBOUNDS_VEC(position, commands))
|
if (INBOUNDS_VEC(position, commands))
|
||||||
|
@ -714,6 +719,10 @@ void scriptclass::run(void)
|
||||||
}
|
}
|
||||||
graphics.createtextboxreal(txt[0], textx, texty, r, g, b, textflipme);
|
graphics.createtextboxreal(txt[0], textx, texty, r, g, b, textflipme);
|
||||||
textflipme = false;
|
textflipme = false;
|
||||||
|
|
||||||
|
graphics.setlarge(textlarge);
|
||||||
|
textlarge = false;
|
||||||
|
|
||||||
if ((int) txt.size() > 1)
|
if ((int) txt.size() > 1)
|
||||||
{
|
{
|
||||||
for (i = 1; i < (int) txt.size(); i++)
|
for (i = 1; i < (int) txt.size(); i++)
|
||||||
|
@ -3514,11 +3523,13 @@ bool scriptclass::loadcustom(const std::string& t)
|
||||||
add("text(blue,0,0,"+words[1]+")");
|
add("text(blue,0,0,"+words[1]+")");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int ti=help.Int(words[1].c_str());
|
int ti = ss_toi(words[1].c_str());
|
||||||
int nti = ti>=0 ? ti : 1;
|
int nti = ti >= 0 ? ti : 1;
|
||||||
for(int ti2=0; ti2<nti; ti2++){
|
for (int ti2 = 0; ti2 < nti; ti2++)
|
||||||
|
{
|
||||||
i++;
|
i++;
|
||||||
if(INBOUNDS_VEC(i, lines)){
|
if (INBOUNDS_VEC(i, lines))
|
||||||
|
{
|
||||||
add(lines[i]);
|
add(lines[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,6 +111,7 @@ public:
|
||||||
size_t textpad_right;
|
size_t textpad_right;
|
||||||
size_t textpadtowidth;
|
size_t textpadtowidth;
|
||||||
char textcase;
|
char textcase;
|
||||||
|
bool textlarge;
|
||||||
|
|
||||||
//Misc
|
//Misc
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
|
|
|
@ -24,6 +24,8 @@ textboxclass::textboxclass(void)
|
||||||
|
|
||||||
rand = 0;
|
rand = 0;
|
||||||
|
|
||||||
|
large = false;
|
||||||
|
|
||||||
print_flags = PR_FONT_LEVEL;
|
print_flags = PR_FONT_LEVEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +119,10 @@ void textboxclass::addline(const std::string& t)
|
||||||
{
|
{
|
||||||
lines.push_back(t);
|
lines.push_back(t);
|
||||||
resize();
|
resize();
|
||||||
if ((int) lines.size() >= 12) lines.clear();
|
if ((int)lines.size() > (large ? 26 : 11))
|
||||||
|
{
|
||||||
|
lines.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void textboxclass::pad(size_t left_pad, size_t right_pad)
|
void textboxclass::pad(size_t left_pad, size_t right_pad)
|
||||||
|
|
|
@ -49,6 +49,8 @@ public:
|
||||||
|
|
||||||
int rand;
|
int rand;
|
||||||
|
|
||||||
|
bool large;
|
||||||
|
|
||||||
uint32_t print_flags;
|
uint32_t print_flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue