diff --git a/[editor]/editor_gui/client/buttonclicked.lua b/[editor]/editor_gui/client/buttonclicked.lua
index 5a6d6e81c..c02c832a5 100644
--- a/[editor]/editor_gui/client/buttonclicked.lua
+++ b/[editor]/editor_gui/client/buttonclicked.lua
@@ -59,7 +59,7 @@ end
function topMenuClicked.new ()
editor_main.dropElement ()
guiSetInputEnabled(true)
- local yes,no = guiShowMessageBox ( "Are you sure you want to create a new map?\nAny unsaved data will be lost.", "info", "New", true, "Yes", "No" )
+ local yes,no = guiShowMessageBox ( "New", "Are you sure you want to create a new map?\nAny unsaved data will be lost.", "question", "yesno" )
addEventHandler ( "onClientGUIClick",yes,function()
editor_main.newResource()
guiSetInputEnabled(false)
diff --git a/[editor]/editor_gui/client/load.lua b/[editor]/editor_gui/client/load.lua
index 5898a29fd..9bb5415fe 100644
--- a/[editor]/editor_gui/client/load.lua
+++ b/[editor]/editor_gui/client/load.lua
@@ -34,7 +34,7 @@ function openMap()
local row = guiGridListGetSelectedItem ( loadDialog.mapsList )
if row == -1 then return end
mapName = guiGridListGetItemText ( loadDialog.mapsList, row, 1 )
- open = guiShowMessageBox ( "Are you sure you want to load map \""..mapName.."\"?\nAny unsaved changes will be lost.", "info", "Are you sure?", true, "Open", "Cancel" )
+ open = guiShowMessageBox("Are you sure?", "Are you sure you want to load map \""..mapName.."\"?\nAny unsaved changes will be lost.", "question", "yesno")
addEventHandler ( "onClientGUIClick", open, openButton, false )
end
diff --git a/[editor]/editor_gui/client/locations.lua b/[editor]/editor_gui/client/locations.lua
index 4061b407d..6c35b0c04 100644
--- a/[editor]/editor_gui/client/locations.lua
+++ b/[editor]/editor_gui/client/locations.lua
@@ -102,11 +102,11 @@ function addBookmark ()
local z = locations.z:getValue()
local world = locations.world:getValue()
if name == "" then
- guiShowMessageBox ( 'No location name was specified!', "error", "Bad value", true )
+ guiShowMessageBox("Bad value", "No location name was specified!", "error", "ok")
return
end
if bookmarksTable[name] then
- guiShowMessageBox ( 'A location of name "'..name..'" already exists!', "error", "Conflict", true )
+ guiShowMessageBox("Conflict", 'A location of name "'..name..'" already exists!', "error", "ok")
return
end
bookmarksTable[name] = {}
@@ -192,15 +192,15 @@ end
function setLocation ( x,y,z,world )
if not x then
- local button = guiShowMessageBox ( "Invalid \"x position\" specified", "error", "Bad Value", true )
+ local button = guiShowMessageBox("Bad Value", "Invalid \"x position\" specified", "error", "ok")
return
end
if not y then
- local button = guiShowMessageBox ( "Invalid \"y position\" specified", "error", "Bad Value", true )
+ local button = guiShowMessageBox("Bad Value", "Invalid \"y position\" specified", "error", "ok")
return
end
if not z then
- local button = guiShowMessageBox ( "Invalid \"z position\" specified", "error", "Bad Value", true )
+ local button = guiShowMessageBox("Bad Value", "Invalid \"z position\" specified", "error", "ok")
return
end
if not world then
diff --git a/[editor]/editor_gui/client/mapsettings_gui.lua b/[editor]/editor_gui/client/mapsettings_gui.lua
index 8d520e1a9..6fd979a5d 100644
--- a/[editor]/editor_gui/client/mapsettings_gui.lua
+++ b/[editor]/editor_gui/client/mapsettings_gui.lua
@@ -170,29 +170,29 @@ end
function confirmMapSettings ()
local versionText = mapsettings.metaVersion:getValue()
if not versionText or not (( string.match (versionText, "^%d+$") ) or ( string.match (versionText, "^%d+%.%d+$") ) or ( string.match (versionText, "^%d+%.%d+%.%d+$") )) then
- guiShowMessageBox ( "Invalid META \"Version\" specified", "error", "Bad Value", true )
+ guiShowMessageBox("Bad Value", "Invalid META \"Version\" specified", "error", "ok")
return
end
if not mapsettings.timeHour:getValue() or not mapsettings.timeMinute:getValue()
or mapsettings.timeHour:getValue() > 23 or mapsettings.timeMinute:getValue() > 59 then
- guiShowMessageBox ( "Invalid Time specified", "error", "Bad Value", true )
+ guiShowMessageBox("Bad value", "Invalid Time specified", "error", "ok" )
return
end
-- if mapsettings.metaAuthor:getValue() == "" then
- -- guiShowMessageBox ( "Invalid META \"Author\" specified", "error", "Bad Value", true )
+ -- guiShowMessageBox("Bad Value", "Invalid META \"Author\" specified", "error", true)
-- return
-- end
if not tonumber(mapsettings.maxplayers:getValue()) then
- guiShowMessageBox ( 'Invalid "Maximum Players" specified', "error", "Bad Value", true )
+ guiShowMessageBox("Bad Value", 'Invalid "Maximum Players" specified', "error", "ok")
return
end
if not tonumber(mapsettings.minplayers:getValue()) then
- guiShowMessageBox ( 'Invalid "Minimum Players" specified', "error", "Bad Value", true )
+ guiShowMessageBox("Bad Value", 'Invalid "Minimum Players" specified', "error", "ok")
return
end
if mapsettings.minplayers:getValue() >= mapsettings.maxplayers:getValue() then
- guiShowMessageBox ( 'Invalid "Minimum Players" specified', "error", "Bad Value", true )
+ guiShowMessageBox("Bad Value", 'Invalid "Minimum Players" specified', "error", "ok")
return
end
if not tonumber(mapsettings.gamespeed:getValue()) then
diff --git a/[editor]/editor_gui/client/me_gui.lua b/[editor]/editor_gui/client/me_gui.lua
index e7477c8f3..5dbbf1f78 100644
--- a/[editor]/editor_gui/client/me_gui.lua
+++ b/[editor]/editor_gui/client/me_gui.lua
@@ -370,9 +370,8 @@ function playSoundFrontEnd ( sound )
return returnValue
end
-function guiShowMessageBox ( message, boxType, title, forced, button1, button2, button3 )
- playSoundFrontEnd ( 5 )
- local a1,a2,a3 = msgbox.guiShowMessageBox ( message, boxType, title, forced, button1, button2, button3 )
+function guiShowMessageBox ( title, msg, type, buttons )
+ local a1,a2,a3 = msgbox.createMessageBox( title, msg, type, buttons )
return a1,a2,a3
end
diff --git a/[editor]/editor_gui/client/save.lua b/[editor]/editor_gui/client/save.lua
index b82508a9d..3978a896c 100644
--- a/[editor]/editor_gui/client/save.lua
+++ b/[editor]/editor_gui/client/save.lua
@@ -54,19 +54,14 @@ function saveMap()
mapName = guiGetText ( saveDialog.mapName )
if mapName == "" then return end
if mapsInfo[string.lower(mapName)] then
- local save,cancel = guiShowMessageBox ( "Are you sure you want to overwrite map \""..mapName.."\"?\n" ..
- "This will cause original map data to be lost.",
- "info", "Are you sure?", true, "Save", "Cancel" )
+ local save,cancel = guiShowMessageBox ( "Are you sure?", "Are you sure you want to overwrite map \""..mapName.."\"?\n" .. "This will cause original map data to be lost.", "question", "yesno" )
addEventHandler ( "onClientGUIClick", save, saveButton, false )
addEventHandler ( "onClientGUIClick", cancel, restoreSaveDialog, false )
guiSetProperty(saveDialog.window, "Disabled", "True")
elseif resourcesInfo[string.lower(mapName)] then
- guiShowMessageBox ( "Unable to save to \""..mapName.."\". \n" ..
- "You cannot overwrite non-map resources.",
- "error", "Cannot save", true )
+ guiShowMessageBox ( "Cannot save", "Unable to save to \""..mapName.."\". \n" .. "You cannot overwrite non-map resources.", "error", "ok" )
else
- local save,cancel = guiShowMessageBox ( "Are you sure you want to save to \""..mapName.."\"?",
- "info", "Are you sure?", true, "Save", "Cancel" )
+ local save,cancel = guiShowMessageBox ( "Are you sure?", "Are you sure you want to save to \""..mapName.."\"?", "question", "yesno")
addEventHandler ( "onClientGUIClick", save, saveButton, false )
addEventHandler ( "onClientGUIClick", cancel, restoreSaveDialog, false )
guiSetProperty(saveDialog.window, "Disabled", "True")
diff --git a/[editor]/editor_main/client/saveloadtest_client.lua b/[editor]/editor_main/client/saveloadtest_client.lua
index 028c158da..7ad94606b 100644
--- a/[editor]/editor_main/client/saveloadtest_client.lua
+++ b/[editor]/editor_main/client/saveloadtest_client.lua
@@ -17,22 +17,22 @@ addEventHandler ( "saveloadtest_return", root,
end
editor_gui.closeLoadDialog()
else
- editor_gui.guiShowMessageBox ( "Map resource could not be started!", "error", "Error", true )
+ editor_gui.guiShowMessageBox ( "Error", "Map resource could not be started!", "error", "ok" )
end
elseif ( command ) == "save" then
if ( returnValue ) then
editor_gui.closeSaveDialog()
else
- editor_gui.guiShowMessageBox ( "Map resource could not be saved! "..reason, "error", "Error", true )
+ editor_gui.guiShowMessageBox ( "Error", "Map resource could not be saved! "..reason, "error", "ok" )
editor_gui.restoreSaveDialog()
end
elseif ( command ) == "quickSave" then
reason = reason or "The target resource may be in .zip format or corrupted."
- editor_gui.guiShowMessageBox ( "Map resource could not be saved! "..reason, "error", "Error", true )
+ editor_gui.guiShowMessageBox ( "Error", "Map resource could not be saved! "..reason, "error", "ok" )
editor_gui.restoreSaveDialog()
elseif ( command ) == "test" then
reason = reason or ""
- editor_gui.guiShowMessageBox ( "Test could not be started! "..reason, "error", "Error", true )
+ editor_gui.guiShowMessageBox ( "Error", "Test could not be started! "..reason, "error", "ok" )
editor_gui.stopTest()
elseif ( command == "close" ) then
editor_gui.closeSaveDialog()
diff --git a/[editor]/msgbox/images/error.png b/[editor]/msgbox/images/error.png
deleted file mode 100644
index 7d188fd13..000000000
Binary files a/[editor]/msgbox/images/error.png and /dev/null differ
diff --git a/[editor]/msgbox/images/info.png b/[editor]/msgbox/images/info.png
deleted file mode 100644
index 3e1256adb..000000000
Binary files a/[editor]/msgbox/images/info.png and /dev/null differ
diff --git a/[editor]/msgbox/images/question.png b/[editor]/msgbox/images/question.png
deleted file mode 100644
index a3f863e61..000000000
Binary files a/[editor]/msgbox/images/question.png and /dev/null differ
diff --git a/[editor]/msgbox/images/warning.png b/[editor]/msgbox/images/warning.png
deleted file mode 100644
index d04fdcf93..000000000
Binary files a/[editor]/msgbox/images/warning.png and /dev/null differ
diff --git a/[editor]/msgbox/meta.xml b/[editor]/msgbox/meta.xml
deleted file mode 100644
index a8a364d7e..000000000
--- a/[editor]/msgbox/meta.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/[editor]/msgbox/script.lua b/[editor]/msgbox/script.lua
deleted file mode 100644
index 72f364870..000000000
--- a/[editor]/msgbox/script.lua
+++ /dev/null
@@ -1,132 +0,0 @@
---[[-----------DOCUMENTATION---------------
-SYNTAX:
-guibutton,guibutton,guibutton = guiShowMessageBox ( string message, string boxType, string title [, string button1, string button2, stringbutton3] )
-REQUIRED ARGUMENTS
-* message - The message you want in the message box
-* boxType - Either "warning","question","error","info". Displays different icons accordingly
-OPTIONAL ARGUMENTS
-guiShowMessageBox allows for up to 3 buttons in the message box
-* forceShowing - Ensures that nothing else but the message box can be clicked, besides gui elements created afterwards.
-* button1 - A string of the first button that appears
-* button2 - A string of the second button that appears
-* button3 - A string of the third button that appears
-Not specifying forceShowing will default to false.
-Not specifying all buttons will only create that many buttons. For example, specifying 2 buttons will only display 2 buttons.
-Not specifying any buttons at all will default to one "OK" button.
-All buttons hide the message box by default
-
-
-RETURNS:
-Returns 3 gui elements of the each button the gui window. If these dont exist nil is returned instead. You can attach these to a
-onClientGUIClick event to do whatever you want.
---------------------------------------------------------]]
-
-local validTypes = { ["warning"]=true, ["question"]=true, ["error"]=true, ["info"]=true }
-local screenX, screenY = guiGetScreenSize()
-local guiAttached = {}
----Msg box position/size config
-local msgBox = {}
-msgBox.sizeX = 280
-msgBox.sizeY = 135
----
-
-function guiShowMessageBox ( message, boxType, title, forceShowing, button1, button2, button3 )
- local aMessage = {}
- local buttons = { button1,button2,button3 }
- --add checks to ensure everything is valid
- if type(message) ~= "string" then
- outputDebugString ( "guiShowMessageBox - Invalid 'message' specified.", 0 )
- return false
- end
- if not validTypes[boxType] then
- outputDebugString ( "guiShowMessageBox - Invalid 'type' specified.", 0 )
- return false
- end
- if type(title) ~= "string" then
- outputDebugString ( "guiShowMessageBox - Invalid 'title' specified.", 0 )
- return false
- end
- ---work out the number of buttons
- local buttonCount = 0
- while type(buttons[buttonCount+1]) == "string" do
- buttonCount = buttonCount + 1
- end
- if buttonCount == 0 then
- button1 = "OK"
- buttonCount = 1
- end
- local cover
- if ( forceShowing ) then
- cover = guiCreateButton ( 0, 0, 1, 1, "", true )
- guiSetAlpha ( cover, 0 )
- addEventHandler ( "onClientGUIClick", cover, bringMsgBoxToFront )
- end
-
- local formPosX = screenX / 2 - msgBox.sizeX/2
- local formPosY = screenY / 2 - msgBox.sizeY/2
- aMessage.Form = guiCreateWindow ( formPosX,formPosY, msgBox.sizeX, msgBox.sizeY, title, false )
- guiWindowSetSizable ( aMessage.Form, false )
- aMessage.Image = guiCreateStaticImage ( 15, 28, 42, 42, "images/"..boxType..".png", false, aMessage.Form )
- aMessage.Label = guiCreateLabel ( 76, 35, 190, 65, message, false, aMessage.Form )
- guiLabelSetHorizontalAlign ( aMessage.Label,"left",true)
- --create gui buttons
- --130
- local guiButton1, guiButton2, guiButton3
- if buttonCount == 1 then
- guiButton1 = guiCreateButton ( 99, 104, 84, 23, button1, false, aMessage.Form )
- addEventHandler ( "onClientGUIClick", guiButton1, aMessageBoxClick )
- guiAttached[guiButton1] = {}
- guiAttached[guiButton1].parent = aMessage.Form
- guiAttached[guiButton1].forcedButton = cover
- elseif buttonCount == 2 then
- guiButton1 = guiCreateButton ( 48.5, 104, 84, 23, button1, false, aMessage.Form )
- guiButton2 = guiCreateButton ( 149.5, 104, 84, 23, button2, false, aMessage.Form )
- addEventHandler ( "onClientGUIClick", guiButton1, aMessageBoxClick )
- addEventHandler ( "onClientGUIClick", guiButton2, aMessageBoxClick )
- guiAttached[guiButton1] = {}
- guiAttached[guiButton2] = {}
- guiAttached[guiButton1].parent = aMessage.Form
- guiAttached[guiButton2].parent = aMessage.Form
- guiAttached[guiButton1].forcedButton = cover
- guiAttached[guiButton2].forcedButton = cover
- elseif buttonCount == 3 then
- guiButton1 = guiCreateButton ( 10, 104, 84, 23, button1, false, aMessage.Form )
- guiButton2 = guiCreateButton ( 100, 104, 84, 23, button2, false, aMessage.Form )
- guiButton3 = guiCreateButton ( 190, 104, 84, 23, button3, false, aMessage.Form )
- addEventHandler ( "onClientGUIClick", guiButton1, aMessageBoxClick )
- addEventHandler ( "onClientGUIClick", guiButton2, aMessageBoxClick )
- addEventHandler ( "onClientGUIClick", guiButton3, aMessageBoxClick )
- guiAttached[guiButton1] = {}
- guiAttached[guiButton2] = {}
- guiAttached[guiButton3] = {}
- guiAttached[guiButton1].parent = aMessage.Form
- guiAttached[guiButton2].parent = aMessage.Form
- guiAttached[guiButton3].parent = aMessage.Form
- guiAttached[guiButton1].forcedButton = cover
- guiAttached[guiButton2].forcedButton = cover
- guiAttached[guiButton3].forcedButton = cover
- end
- --260
- --
- if ( forceShowing ) then
- guiAttached[cover] = aMessage.Form
- end
- return guiButton1, guiButton2, guiButton3
-end
-
-function aMessageBoxClick ()
- if source ~= this then return end
- guiSetVisible ( guiAttached[source].parent, false )
- destroyElement ( guiAttached[source].parent )
- local forcedButton = guiAttached[source].forcedButton
- if ( forcedButton ) then
- guiSetVisible ( forcedButton, false )
- destroyElement ( forcedButton )
- guiAttached[forcedButton] = nil
- end
- guiAttached[source] = nil
-end
-
-function bringMsgBoxToFront()
- guiBringToFront ( guiAttached[source] )
-end
diff --git a/[gameplay]/msgbox/files/error.png b/[gameplay]/msgbox/files/error.png
new file mode 100644
index 000000000..18e838824
Binary files /dev/null and b/[gameplay]/msgbox/files/error.png differ
diff --git a/[gameplay]/msgbox/files/info.png b/[gameplay]/msgbox/files/info.png
new file mode 100644
index 000000000..6524cba60
Binary files /dev/null and b/[gameplay]/msgbox/files/info.png differ
diff --git a/[gameplay]/msgbox/files/question.png b/[gameplay]/msgbox/files/question.png
new file mode 100644
index 000000000..85c6f44cb
Binary files /dev/null and b/[gameplay]/msgbox/files/question.png differ
diff --git a/[gameplay]/msgbox/files/warning.png b/[gameplay]/msgbox/files/warning.png
new file mode 100644
index 000000000..46aaa5384
Binary files /dev/null and b/[gameplay]/msgbox/files/warning.png differ
diff --git a/[gameplay]/msgbox/meta.xml b/[gameplay]/msgbox/meta.xml
new file mode 100644
index 000000000..b7dd8f50e
--- /dev/null
+++ b/[gameplay]/msgbox/meta.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/[gameplay]/msgbox/sourceC.lua b/[gameplay]/msgbox/sourceC.lua
new file mode 100644
index 000000000..d432f4c28
--- /dev/null
+++ b/[gameplay]/msgbox/sourceC.lua
@@ -0,0 +1,149 @@
+local screenX, screenY = guiGetScreenSize()
+
+local boxWidth = 350
+local boxHeight = 175
+
+local boxButtonsWidth = 75
+local boxButtonsHeight = 30
+
+local messageBoxElements = {}
+local messageBoxTypes = {
+ ["info"] = {
+ boxCaption = "Information",
+ boxSound = 11,
+ boxIcon = "info.png"
+ },
+ ["question"] = {
+ boxCaption = "Question",
+ boxSound = 10,
+ boxIcon = "question.png"
+ },
+ ["warning"] = {
+ boxCaption = "Warning",
+ boxSound = 40,
+ boxIcon = "warning.png"
+ },
+ ["error"] = {
+ boxCaption = "Error",
+ boxSound = 101,
+ boxIcon = "error.png"
+ }
+}
+
+local messageBoxButtons = {
+ ["ok"] = {
+ [1] = "OK"
+ },
+ ["okcancel"] = {
+ [1] = "OK",
+ [2] = "Cancel"
+ },
+ ["retrycancel"] = {
+ [1] = "Retry",
+ [2] = "Cancel"
+ },
+ ["yesno"] = {
+ [1] = "Yes",
+ [2] = "No"
+ },
+ ["yesnocancel"] = {
+ [1] = "Yes",
+ [2] = "No",
+ [3] = "Cancel"
+ }
+}
+
+function createMessageBox(boxTitle, boxMessage, boxType, boxButtons)
+ if not boxTitle or type(boxTitle) ~= "string" then
+ error("Bad argument @ 'createMessageBox' [Expected string at argument 1, got " .. type(boxTitle) .. "]", 2)
+ return
+ end
+
+ if not boxMessage or type(boxMessage) ~= "string" then
+ error("Bad argument @ 'createMessageBox' [Expected string at argument 2, got " .. type(boxMessage) .. "]", 2)
+ return
+ end
+
+ if not boxType or type(boxType) ~= "string" then
+ error("Bad argument @ 'createMessageBox' [Expected string at argument 3, got " .. type(boxType) .. "]", 2)
+ return
+ end
+
+ if not boxButtons or type(boxButtons) ~= "string" then
+ boxButtons = "ok"
+ end
+
+ if not messageBoxTypes[boxType] then
+ error("Bad argument @ 'createMessageBox' [Unknown messageBoxType at argument 3", 2)
+ return
+ end
+
+ if not messageBoxButtons[boxButtons] then
+ error("Bad argument @ 'createMessageBox' [Unknown messageBoxButtons at argument 4", 2)
+ return
+ end
+
+ if messageBoxTypes[boxType].boxSound then
+ playSoundFrontEnd(messageBoxTypes[boxType].boxSound)
+ end
+
+ local boxPosX = (screenX - boxWidth) / 2
+ local boxPosY = (screenY - boxHeight) / 2
+ local boxElement = guiCreateWindow(boxPosX, boxPosY, boxWidth, boxHeight, utf8.upper(boxTitle), false)
+ guiWindowSetSizable(boxElement, false)
+
+ local boxImageWidth = 42
+ local boxImageHeight = 42
+
+ local boxImagePosX = 30
+ local boxImagePosY = 65
+
+ local boxImageCenterX = boxImagePosX + boxImageWidth / 2
+ local boxImageCenterY = boxImagePosY + boxImageHeight / 2
+ local boxImage = guiCreateStaticImage(boxImagePosX, boxImagePosY, boxImageWidth, boxImageHeight, "files/" .. messageBoxTypes[boxType].boxIcon, false, boxElement)
+
+ local boxCaptionWidth = boxWidth - (boxImagePosX + boxImageWidth)
+ local boxCaptionHeight = 16
+
+ local boxCaptionPosX = 10 + (boxImagePosX + boxImageWidth)
+ local boxCaptionPosY = boxImageCenterY - dxGetFontHeight(1, "default-bold-small")
+ local boxCaption = guiCreateLabel(boxCaptionPosX, boxCaptionPosY, boxCaptionWidth, boxCaptionHeight, messageBoxTypes[boxType].boxCaption, false, boxElement)
+ guiSetFont(boxCaption, "default-bold-small")
+
+ local boxLabelWidth = boxWidth - (boxImagePosX + boxImageWidth)
+ local boxLabelHeight = 48
+
+ local boxLabelPosX = 10 + (boxImagePosX + boxImageWidth)
+ local boxLabelPosY = boxImageCenterY - 2.5
+ local boxLabel = guiCreateLabel(boxLabelPosX, boxLabelPosY, boxLabelWidth, boxLabelHeight, boxMessage, false, boxElement)
+ guiSetFont(boxCaption, "default")
+
+ local boxButtonsPosX = boxWidth - (boxButtonsWidth + 5) * #messageBoxButtons[boxButtons]
+ local boxButtonsPosY = boxHeight - boxButtonsHeight - 5
+ local boxButtonsElements = {}
+
+ for i = 1, #messageBoxButtons[boxButtons] do
+ boxButtonsElements[i] = guiCreateButton(boxButtonsPosX, boxButtonsPosY, boxButtonsWidth, boxButtonsHeight, messageBoxButtons[boxButtons][i], false, boxElement)
+ boxButtonsPosX = boxButtonsPosX + boxButtonsWidth + 5
+
+ messageBoxElements[boxButtonsElements[i]] = boxElement
+ addEventHandler("onClientGUIClick", boxButtonsElements[i], onButtonClick)
+ end
+
+ return boxButtonsElements[1], boxButtonsElements[2], boxButtonsElements[3]
+end
+
+function guiShowMessageBox(boxMessage, boxType, boxTitle, _, boxButtons)
+ outputDebugString("Note that guiShowMessageBox is a deprecated function of msgbox. Please use the createMessageBox function in the future.", 2)
+ createMessageBox(boxTitle, boxMessage, boxType, boxButtons)
+end
+
+function onButtonClick()
+ if source ~= this then
+ return
+ end
+
+ if messageBoxElements[source] then
+ destroyElement(messageBoxElements[source])
+ end
+end
\ No newline at end of file
diff --git a/[gameplay]/webbrowser/WebBrowserGUI.lua b/[gameplay]/webbrowser/WebBrowserGUI.lua
index 6e82888a3..35f3bc5cd 100644
--- a/[gameplay]/webbrowser/WebBrowserGUI.lua
+++ b/[gameplay]/webbrowser/WebBrowserGUI.lua
@@ -107,7 +107,7 @@ end
function WebBrowserGUI:DevButton_Click(button, state)
if button == "left" and state == "up" then
if not getDevelopmentMode() then
- exports.msgbox:guiShowMessageBox("You have to enable the development using setDevelopmentMode", "error", "Development mode required", false)
+ exports.msgbox:createMessageBox("Development mode required", "You have to enable the development\nusing setDevelopmentMode", "error", "ok")
return
end