Verified Commit e934910d authored by RobLoach's avatar RobLoach
Browse files

love.window.showMessageBox: Move to showMessageBox

parent d0040e6b
......@@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `love.console` an in-game console toggled with the tilde key
- Enable the console with `love.console.setEnabled(true)`
- `love.graphics.getColor()` to retrieve the active painting color
- `love.system.message()` to display OSD messages
- `love.window.showMessageBox()` to display on-screen messages
### Fixed
- Cleaned the Makefile dependency chain
......
......@@ -264,8 +264,6 @@ script::script(const std::string& file) {
chai.add(fun(&system::getOS), "getOS");
chai.add(fun(&system::getVersion), "getVersion");
chai.add(fun(&system::getVersionString), "getVersionString");
chai.add(fun<void, system, const std::string&, int>(&system::message), "message");
chai.add(fun<void, system, const std::string&>(&system::message), "message");
// Mouse
chai.add(fun(&mouse::getX), "getX");
......@@ -286,6 +284,8 @@ script::script(const std::string& file) {
// Window
chai.add(fun(&window::setTitle), "setTitle");
chai.add(fun(&window::getTitle), "getTitle");
chai.add(fun<void, window, const std::string&, int>(&window::showMessageBox), "showMessageBox");
chai.add(fun<void, window, const std::string&>(&window::showMessageBox), "showMessageBox");
// Timer
chai.add(fun(&timer::getDelta), "getDelta");
......
......@@ -53,15 +53,4 @@ std::string system::getVersionString() {
return CHAILOVE_VERSION_STRING;
}
void system::message(const std::string& msg, int frames) {
retro_message retroMessage;
retroMessage.msg = msg.c_str();
retroMessage.frames = frames;
ChaiLove::environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, &retroMessage);
}
void system::message(const std::string& msg) {
message(msg, 3000);
}
} // namespace love
......@@ -34,15 +34,6 @@ class system {
* @see love.system.getVersion
*/
std::string getVersionString();
/**
* @brief Display a message for a certain amount of frames.
*
* @param msg The message text to be displayed.
* @param frames (3000) The amount of frames to display the message.
*/
void message(const std::string& msg, int frames);
void message(const std::string& msg);
};
} // namespace love
......
......@@ -73,4 +73,15 @@ window& window::setTitle(string title) {
return *this;
}
void window::showMessageBox(const std::string& msg, int frames) {
retro_message retroMessage;
retroMessage.msg = msg.c_str();
retroMessage.frames = frames;
ChaiLove::environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, &retroMessage);
}
void window::showMessageBox(const std::string& msg) {
showMessageBox(msg, 4000);
}
} // namespace love
......@@ -31,6 +31,15 @@ class window {
* @see love.window.getTitle
*/
window& setTitle(std::string title);
/**
* @brief Display a simple message for a certain amount of frames.
*
* @param msg The message text to be displayed.
* @param frames (4000) The amount of frames to display the message.
*/
void showMessageBox(const std::string& msg, int frames);
void showMessageBox(const std::string& msg);
};
} // namespace love
......
......@@ -30,7 +30,7 @@ def load() {
test.load();
}
love.system.message("Hello World!")
love.window.showMessageBox("Hello World!")
}
def draw() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment