Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
libretro-chailove
Commits
e934910d
Verified
Commit
e934910d
authored
Mar 17, 2018
by
RobLoach
Browse files
love.window.showMessageBox: Move to showMessageBox
parent
d0040e6b
Changes
7
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
e934910d
...
...
@@ -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.m
essage()`
to display
OSD
messages
-
`love.
window.showM
essage
Box
()`
to display
on-screen
messages
### Fixed
-
Cleaned the Makefile dependency chain
...
...
src/love/script.cpp
View file @
e934910d
...
...
@@ -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"
);
...
...
src/love/system.cpp
View file @
e934910d
...
...
@@ -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
src/love/system.h
View file @
e934910d
...
...
@@ -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
...
...
src/love/window.cpp
View file @
e934910d
...
...
@@ -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
src/love/window.h
View file @
e934910d
...
...
@@ -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
...
...
test/main.chai
View file @
e934910d
...
...
@@ -30,7 +30,7 @@ def load() {
test.load();
}
love.
system.m
essage("Hello World!")
love.
window.showM
essage
Box
("Hello World!")
}
def draw() {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment