2020-01-01 21:29:24 +01:00
|
|
|
#ifndef TEXTBOX_H
|
|
|
|
#define TEXTBOX_H
|
|
|
|
|
2023-01-13 05:11:39 +01:00
|
|
|
#include <stdint.h>
|
2020-01-01 21:29:24 +01:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2023-08-06 00:34:15 +02:00
|
|
|
struct TextboxSprite
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int col;
|
|
|
|
int tile;
|
|
|
|
};
|
|
|
|
|
2023-08-20 19:11:44 +02:00
|
|
|
enum TextboxImage
|
|
|
|
{
|
|
|
|
TEXTIMAGE_NONE,
|
|
|
|
TEXTIMAGE_LEVELCOMPLETE,
|
|
|
|
TEXTIMAGE_GAMECOMPLETE
|
|
|
|
};
|
|
|
|
|
2020-01-01 21:29:24 +01:00
|
|
|
class textboxclass
|
|
|
|
{
|
|
|
|
public:
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
textboxclass(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2023-08-06 00:34:15 +02:00
|
|
|
void addsprite(int x, int y, int tile, int col);
|
|
|
|
|
2023-08-20 19:11:44 +02:00
|
|
|
void setimage(TextboxImage image);
|
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void centerx(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void centery(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void adjust(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
void initcol(int rr, int gg, int bb);
|
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void update(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void remove(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void removefast(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void resize(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2021-09-07 00:41:49 +02:00
|
|
|
void addline(const std::string& t);
|
2022-12-30 22:57:24 +01:00
|
|
|
|
|
|
|
void pad(size_t left_pad, size_t right_pad);
|
|
|
|
|
|
|
|
void padtowidth(size_t new_w);
|
|
|
|
|
2023-03-18 23:24:14 +01:00
|
|
|
void centertext(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
public:
|
|
|
|
//Fundamentals
|
2021-09-13 06:02:15 +02:00
|
|
|
std::vector<std::string> lines;
|
2021-09-06 08:04:34 +02:00
|
|
|
int xp, yp, w, h;
|
2020-01-01 21:29:24 +01:00
|
|
|
int r,g,b;
|
|
|
|
int timer;
|
|
|
|
|
|
|
|
float tl;
|
2020-04-29 06:49:15 +02:00
|
|
|
float prev_tl;
|
2020-01-01 21:29:24 +01:00
|
|
|
int tm;
|
|
|
|
|
2021-03-20 03:51:36 +01:00
|
|
|
/* Whether to flip text box y-position in Flip Mode. */
|
|
|
|
bool flipme;
|
2021-03-23 22:29:32 +01:00
|
|
|
|
|
|
|
int rand;
|
2023-01-13 05:11:39 +01:00
|
|
|
|
2022-11-30 18:56:44 +01:00
|
|
|
bool large;
|
|
|
|
|
2023-01-13 05:11:39 +01:00
|
|
|
uint32_t print_flags;
|
2023-03-18 22:31:13 +01:00
|
|
|
bool fill_buttons;
|
2023-08-06 00:34:15 +02:00
|
|
|
|
|
|
|
std::vector<TextboxSprite> sprites;
|
2023-08-20 19:11:44 +02:00
|
|
|
TextboxImage image;
|
2020-01-01 21:29:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* TEXTBOX_H */
|