Skip to content

Commit

Permalink
Replace custom messagebox with tes3ui.showMessageMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaakma committed Jun 13, 2022
1 parent 0002d2c commit 2fe4a1a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 168 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ local function createClutterGroupPrompt()
callback = function()
local name = nameTable.name:lower()
if common.mcmConfig.registeredClutterGroups[name] then
common.messageBox {
tes3ui.showMessageMenu{
message = 'Clutter Group already exists.',
buttons = {
{
Expand Down Expand Up @@ -118,7 +118,7 @@ local function registerClutterPrompt()
if currentClutterGroup then
title = string.format('Current Clutter Group: %s', currentClutterGroup)
end
common.messageBox {
tes3ui.showMessageMenu {
message = title,
buttons = {
{
Expand All @@ -143,10 +143,8 @@ local function registerClutterPrompt()
selectClutterGroup()
end
},
{
text = 'Cancel'
}
}
},
cancels = true
}
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ local function registerLocation()
},
callback = function()
if common.mcmConfig.locations[name.name] then
common.messageBox{
tes3ui.showMessageMenu{
message = "Location with this id already exists.",
buttons = {
{
Expand Down Expand Up @@ -92,7 +92,7 @@ end
local function onKeyDown(e)
if common.mcmConfig.registerLocationsEnabled then
if common.isKeyPressed(e, common.mcmConfig.registerLocationsHotKey) then
common.messageBox{
tes3ui.showMessageMenu{
message = "Register current position/orientation/cell as a starting location?",
buttons = {
{
Expand Down
1 change: 0 additions & 1 deletion Data Files/MWSE/mods/mer/chargenScenarios/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function this.modEnabled()
return this.mcmConfig.enabled == true
end

this.messageBox = require("mer.chargenScenarios.util.messageBox")
this.createTooltip = require("mer.chargenScenarios.util.tooltip")

this.isKeyPressed = function(pressed, expected)
Expand Down
158 changes: 0 additions & 158 deletions Data Files/MWSE/mods/mer/chargenScenarios/util/messageBox.lua

This file was deleted.

3 changes: 2 additions & 1 deletion Data Files/MWSE/mods/mer/chargenScenarios/util/validator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ Validator.validate = function(object, schema)
)
end
end
elseif field.default then
elseif field.default ~= nil then
--nil, initialise default
assert(type(object) == "table", string.format("Validation failed: %s is not a table.", object))
object[key] = field.default
end
end
Expand Down

0 comments on commit 2fe4a1a

Please sign in to comment.