customLen

for formatting text on booster shop, we pass the desired length from
getformatted text with noremove(no removal of {}) enabled, if its not
enabled then default the value to zero(passing zero means use the
default values)
This commit is contained in:
Anthony Calosa
2017-02-25 07:27:57 +08:00
parent ec730a4383
commit ec078b6ccc
3 changed files with 13 additions and 10 deletions

View File

@@ -52,7 +52,7 @@ public:
// Set Base for the character set to use.
virtual void SetBase(int base) = 0;
// Format text.
virtual void FormatText(string &s, vector<string>& output) = 0;
virtual void FormatText(string &s, vector<string>& output, int customLen = 0) = 0;
WFont(int inID) : mFontID(inID) {};
virtual ~WFont() {};
};
@@ -117,7 +117,7 @@ public:
it->SetBase(base);
}
;
void FormatText(string &s, vector<string>& output);
void FormatText(string &s, vector<string>& output, int customLen = 0);
private:
JLBFont * it;
@@ -143,7 +143,7 @@ public:
virtual float GetStringWidth(const char *s) const;
void SetTracking(float) {};
void SetBase(int) {};
void FormatText(string &, vector<string>&) {};
void FormatText(string &, vector<string>&, int customLen = 0) {};
virtual void DrawString(const char *s, float x, float y, int align = JGETEXT_LEFT, float leftOffset = 0, float width = 0);
virtual int GetCode(const u8 *ch, int *charLength) const = 0;
@@ -187,7 +187,7 @@ public:
void DrawString(const char *s, float x, float y, int align = JGETEXT_LEFT, float leftOffset = 0, float width = 0);
int GetCode(const u8 *ch, int *charLength) const;
int GetMana(const u8 *ch) const;
void FormatText(string &s, vector<string>& output);
void FormatText(string &s, vector<string>& output, int customLen = 0);
};
class WUFont: public WFBFont
@@ -198,7 +198,7 @@ public:
int GetCode(const u8 *ch, int *charLength) const;
int GetMana(const u8 *ch) const;
void FormatText(string &s, vector<string>& output);
void FormatText(string &s, vector<string>& output, int customLen = 0);
};
#endif