Quantcast
Download
(2 Kb)
Download
Updated: 07/21/21 04:59 PM
Compatibility:
Waking Flame (7.1.5)
Blackwood (7.0.5)
Updated:07/21/21 04:59 PM
Created:10/13/20 02:06 PM
Monthly downloads:5,474
Total downloads:26,906
Favorites:17
MD5:
7.0.5
LibSimpleSavedVars  Updated this week!  Popular! (More than 5000 hits)
Version: 0.0.3
by: zelenin [More]
Lightweight library providing saved variables functionality.

What we have:
  • installation wide saved variables
  • the most flat structure
  • convenient access to the saved variable of other servers, accounts, characters

What we have not:
  • ZO_SavedVars
  • namespaces
  • profiles
  • wildcards

Usage:

Add dependency:
Code:
## DependsOn: LibSimpleSavedVars
## SavedVariables: MyAddonData
Code:
Code:
-- installation wide saved variables
self.data = LibSimpleSavedVars:NewInstallationWide("MyAddonData", 1, {
    items = {},
})

-- server wide saved variables
self.data = LibSimpleSavedVars:NewServerWide("MyAddonData", 1, {
    items = {},
})

-- account wide saved variables
self.data = LibSimpleSavedVars:NewAccountWide("MyAddonData", 1, {
    items = {},
})

-- character wide saved variables
self.data = LibSimpleSavedVars:NewCharacterWide("MyAddonData", 1, {
    items = {},
})

self.data.items[15] = true
self.data.items[27] = true
Retrieving other saved variables:

Code:
self.data = LibSimpleSavedVars:NewCharacterWide("MyAddonData", 1, {
    items = {},
    characterName = nil
})

self.data.characterName = GetUnitName("player")
self.data.items[15] = true
self.data.items[27] = true

for characterId, characterData in pairs(LibSimpleSavedVars:GetAccountData("MyAddonData")) do
    local characterName = characterData.characterName
    local characterItems = characterData.items
    -- ...
end
API:

Code:
LibSimpleSavedVars:NewInstallationWide(name, version [, defaults])
LibSimpleSavedVars:NewServerWide(name, version [, defaults])
LibSimpleSavedVars:NewAccountWide(name, version [, defaults])
LibSimpleSavedVars:NewCharacterWide(name, version [, defaults])

LibSimpleSavedVars:GetInstallationData(name)
LibSimpleSavedVars:GetServerData(name [, server])
LibSimpleSavedVars:GetAccountData(name [, server [, displayName]])
LibSimpleSavedVars:GetCharacterData(name [, server [, displayName [, characterId]]])

LibSimpleSavedVars.NA
LibSimpleSavedVars.EU
LibSimpleSavedVars.PTS
Defaults:

Code:
server = GetWorldName()
displayName = GetDisplayName()
characterId = GetCurrentCharacterId()
0.0.3:
- API version bump

0.0.2:
- rename displayName to account

0.0.1:
- initial release
Archived Files (2)
File Name
Version
Size
Uploader
Date
0.0.2
2kB
zelenin
10/14/20 05:28 AM
0.0.1
2kB
zelenin
10/13/20 02:06 PM


There have been no comments posted to this file.
Be the first to add one.



Category Jump: