Actionbar per character
#3
edit game_actionbar\actionbar.lua.
- Add new function
- Find functions online()/refresh() and modify code as required.
Just replace
settingsFile = modules.client_profiles.getSettingsFilePath("actionbar_v2.json")
with
settingsFile = copyUserActionBars()
--[[
Script made by Lee (Discord: l33_) - www.trainorcreations.com
If you want to support my work, feel free to donate at https://trainorcreations.com/donate
PS. Stop ripping off my work and selling it as your own.
]]--
-- New function (will copy old file it it)
local function copyUserActionBars()
local currentProfile = g_settings.getNumber('profile')
local oldFilePath = string.format("/settings/profile_%d/actionbar_v2.json", currentProfile)
local newFolderPath = string.format("/settings/profile_%d/actionbars/", currentProfile)
local newFilePath = string.format("%s%s_actionbar_v2.json", newFolderPath, g_game.getLocalPlayer():getName())
if not g_resources.directoryExists(newFolderPath) then
g_resources.makeDir(newFolderPath)
end
if g_resources.fileExists(oldFilePath) and not g_resources.fileExists(newFilePath) then
g_resources.writeFileContents(newFilePath, g_resources.readFileContents(oldFilePath))
end
return newFilePath
end
function online()
settingsFile = copyUserActionBars()
-- load settings
load()
-- create actionbars
createActionBars()
-- show & setup actionbars
show()
destroyAssignWindows()
end
function refresh()
-- first save
save()
-- recheck file
settingsFile = copyUserActionBars()
-- load settings
load()
-- setup actionbars
show()
destroyAssignWindows()
end
+ add | - remove
--[[
Script made by Lee (Discord: l33_) - www.trainorcreations.com
If you want to support my work, feel free to donate at https://trainorcreations.com/donate
PS. Stop ripping off my work and selling it as your own.
]]--
function online()
+ if not g_resources.directoryExists("/actionbars/") then
+ g_resources.makeDir("/actionbars/")
+ end
+ actionConfig = g_configs.create("/actionbars/" .. g_game.getLocalPlayer():getName():lower().. ".otml")
setupActionPanel(1, actionPanel1)
setupActionPanel(2, actionPanel2)
show()
end
+ add | - remove
24 Jun 2024