Skip to content

Commit

Permalink
MAIN: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tewlwolow committed Apr 5, 2023
1 parent 072ccec commit 650b595
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion 00 Core/MWSE/mods/tew/AURA/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function this.debugLog(message)
if debugLogOn then
local info = debug.getinfo(2, "Sl")
local module = info.short_src:match("^.+\\(.+).lua$")
local prepend = ("[AURA.%s.%s:%s]:"):format(version, module, info.currentline)
local prepend = ("[%s.%s.%s:%s]:"):format(metadata.package.name, version, module, info.currentline)
local aligned = ("%-36s"):format(prepend)
mwse.log(aligned .. " -- " .. string.format("%s", message))
end
Expand Down
35 changes: 18 additions & 17 deletions 00 Core/MWSE/mods/tew/AURA/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local function warning(e)
if not e.newlyCreated then
return
end
tes3.messageBox(string.format("[AURA]: %s", messages.audioWarning))
tes3.messageBox(string.format("[%s]: %s", metadata.package.name, messages.audioWarning))
end

local function init()
Expand All @@ -20,10 +20,11 @@ local function init()
util.metadataMissing()
end
local version = metadata.package.version
local modName = metadata.package.name

local soundBuilder = require("tew\\AURA\\soundBuilder")
local soundBuilder = require("tew.AURA.soundBuilder")

mwse.log(string.format("[AURA] %s %s %s", messages.version, version, messages.initialised))
mwse.log(string.format("[%s] %s %s %s", modName, messages.version, version, messages.initialised))

local moduleAmbientOutdoor = config.moduleAmbientOutdoor
local moduleAmbientInterior = config.moduleAmbientInterior
Expand All @@ -37,67 +38,67 @@ local function init()

event.register("uiActivated", warning, { filter = "MenuAudio" })

mwse.log(string.format("[AURA %s] %s", version, messages.buildingSoundsStarted))
mwse.log(string.format("[%s %s] %s", modName, version, messages.buildingSoundsStarted))
soundBuilder.build()
mwse.log(string.format("[AURA %s] %s", version, messages.buildingSoundsFinished))
mwse.log(string.format("[%s %s] %s", modName, version, messages.buildingSoundsFinished))

mwse.log(string.format("[AURA %s] %s outputKey.lua.", version, messages.loadingFile))
mwse.log(string.format("[%s %s] %s outputKey.lua.", modName, version, messages.loadingFile))
dofile("Data Files\\MWSE\\mods\\tew\\AURA\\outputKey.lua")

if moduleAmbientOutdoor then
mwse.log(string.format("[AURA %s] %s outdoorMain.lua.", version, messages.loadingFile))
mwse.log(string.format("[%s %s] %s outdoorMain.lua.", modName, version, messages.loadingFile))
dofile("Data Files\\MWSE\\mods\\tew\\AURA\\Ambient\\Outdoor\\outdoorMain.lua")
end

if moduleAmbientInterior then
mwse.log(string.format("[AURA %s] %s interiorMain.lua.", version, messages.loadingFile))
mwse.log(string.format("[%s %s] %s interiorMain.lua.", modName, version, messages.loadingFile))
dofile("Data Files\\MWSE\\mods\\tew\\AURA\\Ambient\\Interior\\interiorMain.lua")
end

if moduleAmbientPopulated then
mwse.log(string.format("[AURA %s] %s populatedMain.lua.", version, messages.loadingFile))
mwse.log(string.format("[%s %s] %s populatedMain.lua.", modName, version, messages.loadingFile))
dofile("Data Files\\MWSE\\mods\\tew\\AURA\\Ambient\\Populated\\populatedMain.lua")
end

if moduleInteriorWeather then
mwse.log(string.format("[AURA %s] %s interiorWeatherMain.lua.", version, messages.loadingFile))
mwse.log(string.format("[%s %s] %s interiorWeatherMain.lua.", modName, version, messages.loadingFile))
dofile("Data Files\\MWSE\\mods\\tew\\AURA\\Interior Weather\\interiorWeatherMain.lua")
end

if moduleServiceVoices then
mwse.log(string.format("[AURA %s] %s serviceVoicesMain.lua.", version, messages.loadingFile))
mwse.log(string.format("[%s %s] %s serviceVoicesMain.lua.", modName, version, messages.loadingFile))

dofile("Data Files\\MWSE\\mods\\tew\\AURA\\Service Voices\\serviceVoicesMain.lua")
end

if moduleMisc then
mwse.log(string.format("[AURA %s] %s miscMain.lua", version, messages.loadingFile))
mwse.log(string.format("[%s %s] %s miscMain.lua", modName, version, messages.loadingFile))
dofile("Data Files\\MWSE\\mods\\tew\\AURA\\Misc\\miscMain.lua")
end

if moduleUI then
mwse.log(string.format("[AURA %s] %s UIMain.lua", version, messages.loadingFile))
mwse.log(string.format("[%s %s] %s UIMain.lua", modName, version, messages.loadingFile))
dofile("Data Files\\MWSE\\mods\\tew\\AURA\\UI\\UIMain.lua")
end

if moduleContainers then
mwse.log(string.format("[AURA %s] %s containersMain.lua", version, messages.loadingFile))
mwse.log(string.format("[%s %s] %s containersMain.lua", modName, version, messages.loadingFile))
dofile("Data Files\\MWSE\\mods\\tew\\AURA\\Containers\\containersMain.lua")
end

if modulePC then
mwse.log(string.format("[AURA %s] %s PCMain.lua", version, messages.loadingFile))
mwse.log(string.format("[%s %s] %s PCMain.lua", modName, version, messages.loadingFile))
dofile("Data Files\\MWSE\\mods\\tew\\AURA\\PC\\PCMain.lua")
end

-- Old version deleter --
if lfs.directoryexists("Data Files\\MWSE\\mods\\AURA") then
lfs.rmdir("Data Files\\MWSE\\mods\\AURA", true)
mwse.log(string.format("[AURA %s] %s", version, messages.oldFolderDeleted))
mwse.log(string.format("[%s %s] %s", modName, version, messages.oldFolderDeleted))
end
if lfs.directoryexists("Data Files\\MWSE\\mods\\tew\\AURA\\Misc\\travelFee.lua") then
os.remove("Data Files\\MWSE\\mods\\tew\\AURA\\Misc\\travelFee.lua")
mwse.log(string.format("[AURA %s] %s: travelFee.lua.", version, messages.oldFileDeleted))
mwse.log(string.format("[%s %s] %s: travelFee.lua.", modName, version, messages.oldFileDeleted))
end
end

Expand Down
10 changes: 5 additions & 5 deletions 00 Core/MWSE/mods/tew/AURA/mcm.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
local configPath = "AURA"
local metadata = toml.loadMetadata("AURA")
local configPath = metadata.package.name
local config = require("tew.AURA.config")
local defaults = require("tew.AURA.defaults")
local util = require("tew.AURA.util")
local metadata = toml.loadMetadata("AURA")
local version = metadata.package.version
local soundBuilder = require("tew\\AURA\\soundBuilder")
local soundBuilder = require("tew.AURA.soundBuilder")
local messages = require(config.language).messages

local function registerVariable(id)
Expand All @@ -15,12 +15,12 @@ local function registerVariable(id)
end

local template = mwse.mcm.createTemplate {
name = "AURA",
name = metadata.package.name,
headerImagePath = "\\Textures\\tew\\AURA\\AURA_logo.tga" }

local page = template:createPage { label = messages.mainSettings, noScroll = true }
page:createCategory {
label = string.format("AURA %s %s %s.\n%s \n\n%s:", version, messages.by, util.getAuthors(metadata.package.authors), messages.mainLabel, messages.settings)
label = string.format("%s %s %s %s.\n%s \n\n%s:", metadata.package.name, version, messages.by, util.getAuthors(metadata.package.authors), messages.mainLabel, messages.settings)
}
page:createDropdown {
label = messages.modLanguage,
Expand Down

0 comments on commit 650b595

Please sign in to comment.
  翻译: