mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-08-03 23:36:59 -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);
|
luaManager->addUIMessage(message, mode);
|
||||||
};
|
};
|
||||||
|
|
||||||
api["showInteractiveMessage"] = [windowManager](std::string_view message, sol::optional<sol::table> options) {
|
api["_showInteractiveMessage"] = [windowManager](std::string_view message, sol::optional<sol::table>) {
|
||||||
std::string buttonText = "#{Interface:OK}";
|
windowManager->interactiveMessageBox(message, { "#{Interface:OK}" });
|
||||||
if (options)
|
|
||||||
{
|
|
||||||
buttonText = options->get_or<std::string>("buttonText", buttonText);
|
|
||||||
}
|
|
||||||
windowManager->interactiveMessageBox(message, { buttonText });
|
|
||||||
};
|
};
|
||||||
api["CONSOLE_COLOR"] = LuaUtil::makeStrictReadOnly(LuaUtil::tableFromPairs<std::string, Misc::Color>(lua,
|
api["CONSOLE_COLOR"] = LuaUtil::makeStrictReadOnly(LuaUtil::tableFromPairs<std::string, Misc::Color>(lua,
|
||||||
{
|
{
|
||||||
|
@ -254,6 +254,13 @@ return {
|
|||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
isWindowVisible = isWindowVisible,
|
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
|
-- TODO
|
||||||
-- registerHudElement = function(name, showFn, hideFn) end,
|
-- registerHudElement = function(name, showFn, hideFn) end,
|
||||||
-- showHudElement = function(name, bool) end,
|
-- showHudElement = function(name, bool) end,
|
||||||
|
@ -35,19 +35,6 @@
|
|||||||
-- @field Flex Aligns widgets in a row or column
|
-- @field Flex Aligns widgets in a row or column
|
||||||
-- @field Container Automatically wraps around its contents
|
-- @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.
|
-- Shows given message at the bottom of the screen.
|
||||||
-- @function [parent=#ui] showMessage
|
-- @function [parent=#ui] showMessage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user