mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-08-03 15:27:13 -04:00
Rewrite showInteractiveMessage to be more future proof, and hide it behind the UI interface.
This commit is contained in:
parent
525aac7a15
commit
7943d1147f
@ -109,13 +109,8 @@ namespace MWLua
|
||||
luaManager->addUIMessage(message, mode);
|
||||
};
|
||||
|
||||
api["showInteractiveMessage"] = [windowManager](std::string_view message, sol::optional<sol::table> options) {
|
||||
std::string buttonText = "#{Interface:OK}";
|
||||
if (options)
|
||||
{
|
||||
buttonText = options->get_or<std::string>("buttonText", buttonText);
|
||||
}
|
||||
windowManager->interactiveMessageBox(message, { buttonText });
|
||||
api["_showInteractiveMessage"] = [windowManager](std::string_view message, sol::optional<sol::table>) {
|
||||
windowManager->interactiveMessageBox(message, { "#{Interface:OK}" });
|
||||
};
|
||||
api["CONSOLE_COLOR"] = LuaUtil::makeStrictReadOnly(LuaUtil::tableFromPairs<std::string, Misc::Color>(lua,
|
||||
{
|
||||
|
@ -254,6 +254,13 @@ return {
|
||||
-- @return #boolean
|
||||
isWindowVisible = isWindowVisible,
|
||||
|
||||
---
|
||||
-- Shows a message as an interactive message box pausing the game, with a single button with the localized text OK.
|
||||
-- @function [parent=#UI] showInteractiveMessage
|
||||
-- @param #string message Message to display
|
||||
-- @param #table options Options (none yet)
|
||||
showInteractiveMessage = ui._showInteractiveMessage
|
||||
|
||||
-- TODO
|
||||
-- registerHudElement = function(name, showFn, hideFn) end,
|
||||
-- showHudElement = function(name, bool) end,
|
||||
|
@ -35,19 +35,6 @@
|
||||
-- @field Flex Aligns widgets in a row or column
|
||||
-- @field Container Automatically wraps around its contents
|
||||
|
||||
---
|
||||
-- Shows given message as a message box
|
||||
-- @function [parent=#ui] showInteractiveMessage
|
||||
-- @param #string msg
|
||||
-- @param #table options An optional table with additional optional arguments. Can contain:
|
||||
--
|
||||
-- * `buttonText` - Changes the text of the button (default: OK (localized))
|
||||
|
||||
-- @usage local params = {
|
||||
-- buttonText="Bene"
|
||||
-- };
|
||||
-- ui.showInteractiveMessage("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque quis justo in orci pharetra semper in lobortis tortor. Suspendisse et sapien sapien.", params)
|
||||
|
||||
---
|
||||
-- Shows given message at the bottom of the screen.
|
||||
-- @function [parent=#ui] showMessage
|
||||
|
Loading…
x
Reference in New Issue
Block a user