Download
(198 Kb)
Download
Updated: 03/18/24 04:00 AM
Pictures
File Info
Compatibility:
Scions of Ithelia (9.3.0)
Endless Archive (9.2.5)
base-game patch (9.1.5)
Necrom (9.0.0)
Scribes of Fate (8.3.5)
Firesong (8.2.5)
Lost Depths (8.1.5)
High Isle (8.0.0)
Updated:03/18/24 04:00 AM
Created:10/15/18 11:41 AM
Monthly downloads:84,299
Total downloads:1,371,590
Favorites:348
MD5:
9.3.0
LibZone  Popular! (More than 5000 hits)
Version: 8.8
by: Baertram [More]
LibZone
A library to help with zone information.
It contains:
-Localized zone names for the languages DE, EN, FR, RU
and partially translated zoneNames of the languages: JP, PL
-ZoneId, ZoneIndex, ZoneParentId
-Geographical zone parents: Provide the real geo parents of zones, where ZOs API returns 0 or incorrect values.
API functions as of changelog 2022-07-11.
Used for addons like -> Code and data provided by IsJustaGhost (thank you)


Optional dependencies:
And to help with translations of zone names between different languages:
This library needs the library LibSlashCommander installed seperately if you want to use the zone name translations with chat commands!

Use one of the following slash commands in your chat (only if 'LibSlashCommander' is active!):
Code:
-Added: Slash commans /lzt or /transz:
Enter a zone name afterwards (in your client language) or choose it from the autocompletion list.
Press tab or space to chose the zonename, and you'll see another auto completion which will provide you the translations of this zone to other languages.
Chosing an entry will put the translated zone name into the chat.

-Added slash commands to search in your desired language:
/lztde or /transzde: German
/lzten or /transzen: English
/lztfr or /transzfr: French
/lztjp or /transzjp: Japanese
/lztru or /transzru: Russian
/lztpl or /transzpl: Polish
/lztes or /transzes: Spanish
Usage
-Download, use as standalone library or keep (otherwise the SavedVariables are lost!) the manifest txt file and just use the library file within your addon.
-Load the library within your addon code using the global variable LibZone
LibStub support was removed with version 6.3 so make sure to ONLY load the library via it's global variable "LibZone"
Lua Code:
  1. local libZone = LibZone

Please add the dependency to your addon's manifest txt file using the addonversion 069 to make sure the users install at least this version to be access via the global variable:
Code:
## DependsOn: LibZone>=077
-> This will make your addon stop loading if the library is missing or installed with a version < then 6.9.
Code:
## OptionalDependsOn: LibZone>=077
-> This will make your addon load if the library is missing or installed with a version < then 6.9, but it WILL throw error messages if you try to load it via LibStub and might throw other error messages.



Where is the data?
Your instance of LibZone contains 2 tables.
1. for the localized data:
Code:
LibZone.preloadedZoneNames[language][zoneId] = "Localized name of the zone"
-> Do NOT access this table directly but use the API function LibZone:GetAllZoneData() instead!

-> Language = String, length 2. Example: "en", "de", "fr", "ru"
-> ZoneId = The zone's unique id which you are able to get via some API function like these ones:
Code:
* GetMapInfo(*luaindex* _index_)
** _Returns:_ *string* _name_, *[UIMapType|#UIMapType]* _mapType_, *[MapContentType|#MapContentType]* _mapContentType_, *integer* _zoneId_, *string* _description_

* GetGuildMemberCharacterInfo(*integer* _guildId_, *luaindex* _memberIndex_)
** _Returns:_ *bool* _hasCharacter_, *string* _characterName_, *string* _zoneName_, *integer* _classType_, *integer* _alliance_, *integer* _level_, *integer* _championRank_, *integer* _zoneId_

* GetFriendCharacterInfo(*luaindex* _friendIndex_)
** _Returns:_ *bool* _hasCharacter_, *string* _characterName_, *string* _zoneName_, *integer* _classType_, *integer* _alliance_, *integer* _level_, *integer* _championRank_, *integer* _zoneId_
2. for the non localized data:
Code:
LibZone.zoneData[zoneId] = {
  ["zoneIndex"]      = zoneIndex,
  ["parentZone"]    = zoneId of the parent Zone
}
->zoneIndex = The zoneIndex which can be determined via some API functions like these ones:
Code:
* GetCurrentMapZoneIndex()
** _Returns:_ *luaindex* _zoneIndex_

* GetZoneIndex(*integer* _zoneId_)
** _Returns:_ *luaindex* _zoneIndex_
->zoneId = see above

Data:
The file LibZone_Data.lua contains the localized zone names of the supported languages.

LibZone API functions
Please check this file for the given API functions:
The file LibZone.lua contains functions to read this, and the other information, for your addons.
e.g.
Code:
--Returns: Returns the preloaded zoneData with all available languages as table.
function lib:GetAllZoneData()

Building new zoneData on PTS e.g. -> SavedVariables
This function will build new zone data and save them to the savedvariables. It will use the current client's language and will be run once as the library loads. So if you are playing on a non-official client language the data will be read and added to your savedvariables.
Code:
--Check and get all zone's data and save them to the SavedVariables
--Parameters:
-->reBuildNew: Boolean [true=Rebuild the zoneData for all zones, even if they already exist / false=Skip already existing zoneIds]
-->doReloadUI: Boolean [true=If at least one zoneId was added/updated, do a ReloadUI() at the end to update the SavedVariables now / false=No automatic ReloadUI()]
function lib:GetAllZoneDataById(reBuildNew, doReloadUI)

GitHub
LibZone on Github
8.8 2024-03-18
-Fixed Chinese zone lua error (sorry, and thanks for the fix bevisbear)


8.7 2024-03-11
-Updated API version for Scions of Ithelia
-Added new zones

8.6 2023-08-04
Updated APIversion
Updated GeoPArentData for Apocrypha public dungeons & delves which showed their parent = Telvanni Peninsula (thanks to DeadSoon)

8.5 2023-05-02
-Updated API version for Necrom
-Added new zones for Necrom
-Added 2 new public dungeons

8.4 2023-03-14
-Updated API version for Scribes of Fate
-Added new zones for Scribes of Fate

8.3 2022-12-27
-Updated API version for Firesong
-Added new zones for Firesong

8.2 2022-08-26
-Updated API version
-Added new zones for geoParent -> IsJustaGhost

8.1 2022-07-30
-Updated for API101035 Lost Depths
-Added new zoneIds and names
-Added support for Spanish zone names (language: ES)

8.0 2022-07-11
-Added on request:
Geographical parent data - by IsJustaGhost
Used so far in addon: AccurateWorldMap by Thal-J

[New API functions]
--Get the zoneData of the zoneId and read it's pinInfo, and return the parentZoneId and,
--if exists, poiIndex of the map pin associated with the zoneId.
--parameters number: zoneId, number:nilable parentZoneId
-->return: number:nilable parentZoneId, number:nilable parentZoneIndex, table:nilable poiIndex
function lib:GetZoneMapPinInfo(zoneId, parentZoneId)

--Get the geographical parentZoneId of a zoneId. This will not use the games API function GetParenZoneId(zoneId) as this
--might return any other zoneId which is not the geographical parent zoneId.
--If you need to get the normal parent zoneId use GetParenZoneId(zoneId)
-->return: number:nilable parentZoneId
function lib:GetZoneGeographicalParentZoneId(zoneId)

--Get the geographical parentMapId of a zoneId.
-->return: number:nilable parentMapId
function lib:GetZoneGeographicalParentMapId(zoneId)

--Get the geographical parentMapId of a mapId
-->return: number:nilable parentMapId
function lib:GetGeographicalParentMapId(mapId)

-- Display mapPins of relevant POIs for the selected zone.
--parameters number: zoneId
function lib:InspectZonePoiInfo(zoneId)

----Debugging and adding/updating new geo parent zone data after patches----

--Display mapPins' poiIndex and name of relevant POIs for the selected zone.
--parameters number zoneId
function lib:DebugInspectZonePoiInfo(zoneId)

-- Used after updating geoDataReferenceTable with savedVariable data to clear the geoDebugData savedVariables.
function lib:DebugClearGeoDataSv()

-- Runs a series of functions to check if any zones have not been accounted for in lib.geoDataReferenceTable and lib.geoDebugData savedVariables.
-- For all zones not accounted for, adds to a savedVariable based on if it was matched with a map pin or not.
--
-- use regex to condense the savedVariable output.
-- [1318] = [1318] = {
-- { [1318] = 0, -- High Isle --> High Isle
-- [1318] = 0, },
-- ["1318_target"] = "-- High Isle --> High Isle"
-- },
--
-- Attempt to locate map pins for unverified entries. Use savedVariables zonePoiInfo as reference. Or, attempt to locate online.
-- Minimal requirement is to ensure parentZoneId is correct. If no map pin just leave at 0.
-- Manually append verified and updated unverified entries to lib.geoDataReferenceTable.
-- LibZone:DebugClearGeoDataSv() to clear the geoDebugData savedVariables.
function lib:DebugVerifyGeoData()


7.8 2022-04-22
Updated API
Updated with High Isle data
Added 2 new public dungeons

7.7 2022-03-12
Updated API
Updated with Ascending tide data
Fixed zone detection functions LibZone:GetCurrentZoneAndGroupStatus(), LibZone:IsInDelve, LibZone:IsInPublicDungeon() to not return true for delve/group/public dungeon if you are outside near it so that the POI's name is shown above the compass already

7.6 2021-12-17
Updated API
Updated with Deadlands data

7.5
-Fixed lib:IsInAnyDungeon() -> thanks to Xandaros
-Added table lib.publicDungeonMapIds and excel document for the list
This is used within the lib's API functions to determine if we are in a public dungeon

7.4
-Updated API to Blackwood
-Added new zone info of Blackwood
-Changed API function GetZoneNameByLocalizedSearchString to allow return = search language

7.2
Removed debug message

7.1
-Updated API version for Flames of Ambition
-Added/changed preloaded zone data
-Added automatically check for zoneIds which are not known yet at an APIversion -> Will be removed from the preloaded zonedata as long as the zoneIds do not exist ingame

7.0
-API100032 + 100033 Markarth ready

6.9
-API100031 + 100032 Stonethorn ready

6.8
-API100030 + 100031 Greymoor ready

-Added functions:
--Get the zone and subZone string from the given map's tile texture (or the current's map's tile texture name)
--> Returns: string zoneName, string subZoneName, string mapTileTextureNameLowerCase, string mapTileTextureNameUnchangedComplete
function lib:GetZoneNameByMapTexture(mapTileTextureName, patternToUse, chatOutput)

--Get the current map's zoneIndex and via the index get the zoneId, the parent zoneId, and return them
--+ the current zone's index and parent zone index
--> Returns: number currentZoneId, number currentZoneParentId, number currentZoneIndex, number currentZoneParentIndex
function lib:GetCurrentZoneIds()

6.7
Updated API properly
Removed entries with lastScanned and APIVersion in translated zoneId data

6.6
Rescanned DE, EN, FR translations as some values from PTS contained dummy names (e.g. Unhallowed Grave)

6.5
Updated API to Harrowstorm
Added new zonedata in de, en, fr languages

6.4
Updated preloaded Japanese translations. Thanks to: Calamath

6.3
Fixed: New scanned zoneNames in client language were not added to the preScanned data properly and the API functions did not find them.
Added: Prescanned zonedata for Southern Elsweyr (de, en, fr, ru)
API function GetMaxZoneId which will return as 1st parameter the maximum possible zoneId and as 2nd parameter the maximum possible zoneIndex.
Removed: LibStub support. Please only load this library via it's global variable "LibZone" now!

6.2
API update for Dragonhold.
Added new zone data of Elsweyr south.

6.1
Made LibSlashCommander optional. If the library is not installed/activated you cannot use the slash commands to translate zone names in chat!
But you still got access to the zone data via LibZone's API functions.

6
-Raised API
-Removed table LibZone.givenZoneData -> Please use the API function LibZone:GetAllZoneData() instead!
-Fixed translations for some zones
-Added new zones
-Preloaded the data for each zone in different languages.
-SavedVariables will NOT contain the whole zoneNames anymore! This will speed up the loading.
Only the unknown/non translated zoneNames will be written to the SavedVariables autoamtically now.
If you want to provide me your client's language zoneNames you can provide me your SavedVariables file "LibZone.lua".
The following languages are up 2 date: DE, EN, FR
The following languages need updates: JP, RU, PL
All other languages are missing so far.

5
-Raised API
-Added ##IsLibrary: true manifest TXT tag
-Made the library work without LibStub and with.
You can use the global variable
Code:
LibZone
to access it without LibStub.
-Added Elsweyr zone names for de, en and fr. If you are using the pl, jp or ru clients send me the new zoneIds with their translations from your LibZone.lua SavedVariables please.

0.4
-Removed LibStub from the libs subfolder
-Removed the libs subfolder. This library needs the following libraries installed as standalone versions:
LibStub LibSlashCommander

-Updated Japanese translations
-Added Polish translations and chat commands: /lztpl or /transzpl
Thankls for provided the translations!

0.3
-Fixed localized zone data overwritten (corrected manifest txt)
-Added Japanese translations
-Added Russian translations
-Added ## AddOnVersion tag to manifest txt
-Added function to get localized zoneNames and their zoneIds by help of a search String (zone name) and search language:
--Get the localized zone names matching to a localized search string
-->searchStr: The String with the search value of a zone name (using searchLanguage)
-->searchLanguage: The langauge to search the searchStr variable in Format example: "en". Can be nil (<nilable>)! If the searchLangauge is nil the client language will be taken as searchLanguage.
-->returnLanguage: The language for the translated results. e.g. you search for "Ostmar" with search language "de" and the return language "en". The result will be the "Eastmarch" zone.
--->Returns table containing the zoneId as table key and the localized (in language: returnLanguage) full zone name, matching to the search string, as table value
function lib:GetZoneNameByLocalizedSearchString(searchStr, searchLanguage, returnLanguage)

-Added: Slash commans /lzt or /transz:
Enter a zone name afterwards (in your client language) or choose it from the autocompletion list.
Press tab or space to chose the zonename, and you'll see another auto completion which will provide you the translations of this zone to other languages.
Chosing an entry will put the translated zone name into the chat.

-Added slash commands to search in your desired language:
/lztde or /transzde: German
/lzten or /transzen: English
/lztfr or /transzfr: French
/lztjp or /transzjp: Japanese
/lztru or /transzru: Russian
Archived Files (29)
File Name
Version
Size
Uploader
Date
8.7
198kB
Baertram
03/11/24 08:05 AM
8.6
200kB
Baertram
08/04/23 03:01 AM
8.5
199kB
Baertram
05/02/23 02:23 PM
8.4
196kB
Baertram
03/14/23 08:21 AM
8.3
184kB
Baertram
12/27/22 01:08 PM
8.2
186kB
Baertram
08/26/22 05:11 AM
8.1
186kB
Baertram
07/30/22 12:07 PM
8
175kB
Baertram
07/11/22 05:46 AM
7.8
155kB
Baertram
04/22/22 02:02 PM
7.8
155kB
Baertram
03/12/22 05:49 AM
7.6
155kB
Baertram
12/17/21 07:17 AM
7.5
146kB
Baertram
08/31/21 05:02 AM
7.4
70kB
Baertram
06/01/21 06:10 AM
7.2
69kB
Baertram
03/07/21 01:57 PM
7.1
69kB
Baertram
03/07/21 11:43 AM
7.0
68kB
Baertram
10/11/20 04:34 PM
6.9
67kB
Baertram
08/09/20 07:27 AM
6.8
67kB
Baertram
05/07/20 04:27 PM
6.8
65kB
Baertram
03/14/20 12:58 PM
6.6
65kB
Baertram
03/14/20 12:12 PM
6.5
65kB
Baertram
02/24/20 04:54 AM
6.4
61kB
Baertram
12/23/19 09:33 AM
6.3
60kB
Baertram
11/03/19 11:12 AM
6.2
59kB
Baertram
10/21/19 08:28 AM
6.1
59kB
Baertram
08/23/19 11:08 AM
6
58kB
Baertram
08/23/19 10:16 AM
5
56kB
Baertram
05/05/19 12:41 PM
0.4
48kB
Baertram
01/25/19 09:25 AM
0.2
29kB
Baertram
10/15/18 11:41 AM


Post A Reply Comment Options
Unread 05/03/23, 04:42 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
No problem, but that is the reason why I always ask you guys to disable ALL other addons and test with only the one you named as the problem first.
Every user got so many (or can have so many) different addons and librares, often non-updated since years (as they work -> but the game code changes often, sometimes even during the normal weekly updates) and thus can break stuff the next minute.

For reporting lua bugs and errors also the same applies: If the problem does not happen with the 1 addon alone, it's another addon interfering and we as the devs cannot support those other addons, or make it compatible, if we do not know where the probem comes from.

So he very firstt hing to do is disable all addons and see if the error is gone. Then only enable the 1 addon (and needed dependencies) and see if the error happens. If yes: report in steps from login/reloadui to error message so one can simply rebuild the error and fix it.
If not: Enable the other addons 1 after another and see which one causes it in combination. Often other addons like LibDebugLogger and DebugLogViewer can help here as especially the DebugLogViewer shows addons loaded, their version, and error mesasges that happen before the chat was ready for output (as this is AFTER all the addons have loaded, but errors often occur before already or in between), and you can share that live/SaveVariables/LibDebugLogger.lua file + the date and time the error happend then easily here for us:
https://sir.insidi.at/or/logviewer/

Originally Posted by Angelus8214
Originally Posted by Baertram
Originally Posted by Angelus8214
For some reason after the update today pressing M shows No map. I have to switch to Inventory then manualy click on the Map menu icon in the menu to have the map show up. Not playing on PTS.
Hm, is this happening with LibZone enabled standalone too? No other addons enabled, only LibZone?
Any lua error message at login to the ingame world then?


Or do you need to enable oher addons actually USING LibZone, like BeamMeUp or similar?
Hi thank you for the reply, I am using quite a fe addons. Anyways after enabling them one by one I figured out that VOTAN'S MINIMAP is the culprit. Worked fine yesterday 0,0 Wonder what changed. No more issues with it disabled sofar though.

EDIT:
Further testing showed that BanditUI has re-enable their minimap i DISABLED and it was causing issues with Votan's minimap that was somehow disabing the world map from working as intended. No idea why the setting re-anabled itself. Anyways, sorry for bothering you with this, but it was the only thing that updated and the issue happened immediately after the update lol
Report comment to moderator  
Reply With Quote
Unread 05/03/23, 03:54 AM  
Angelus8214

Forum posts: 2
File comments: 13
Uploads: 0
Originally Posted by Baertram
Originally Posted by Angelus8214
For some reason after the update today pressing M shows No map. I have to switch to Inventory then manualy click on the Map menu icon in the menu to have the map show up. Not playing on PTS.
Hm, is this happening with LibZone enabled standalone too? No other addons enabled, only LibZone?
Any lua error message at login to the ingame world then?


Or do you need to enable oher addons actually USING LibZone, like BeamMeUp or similar?
Hi thank you for the reply, I am using quite a fe addons. Anyways after enabling them one by one I figured out that VOTAN'S MINIMAP is the culprit. Worked fine yesterday 0,0 Wonder what changed. No more issues with it disabled sofar though.

EDIT:
Further testing showed that BanditUI has re-enable their minimap i DISABLED and it was causing issues with Votan's minimap that was somehow disabing the world map from working as intended. No idea why the setting re-anabled itself. Anyways, sorry for bothering you with this, but it was the only thing that updated and the issue happened immediately after the update lol
Last edited by Angelus8214 : 05/03/23 at 03:58 AM.
Report comment to moderator  
Reply With Quote
Unread 05/03/23, 03:15 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
Originally Posted by Angelus8214
For some reason after the update today pressing M shows No map. I have to switch to Inventory then manualy click on the Map menu icon in the menu to have the map show up. Not playing on PTS.
Hm, is this happening with LibZone enabled standalone too? No other addons enabled, only LibZone?
Any lua error message at login to the ingame world then?


Or do you need to enable oher addons actually USING LibZone, like BeamMeUp or similar?
Report comment to moderator  
Reply With Quote
Unread 05/03/23, 02:20 AM  
Angelus8214

Forum posts: 2
File comments: 13
Uploads: 0
For some reason after the update today pressing M shows No map. I have to switch to Inventory then manualy click on the Map menu icon in the menu to have the map show up. Not playing on PTS.
Last edited by Angelus8214 : 05/03/23 at 02:21 AM.
Report comment to moderator  
Reply With Quote
Unread 12/27/22, 12:54 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
Yeah, might have forgotten to update it, will have a look. Thanks
Report comment to moderator  
Reply With Quote
Unread 12/26/22, 09:21 AM  
wambo
AddOn Author - Click to view AddOns

Forum posts: 38
File comments: 456
Uploads: 3
The last post basically indicated it already, but the current version on ESOUI is causing a minor bug to pop up
(at least I could find Addon/LibZone and then some ZOS/Variable? in the message, but the error disappeared from my LibDebugViewer o_OI)

the important thing is: the version from GitHub works on current Firesong DLC on live.
Report comment to moderator  
Reply With Quote
Unread 09/23/22, 10:19 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
LibZone on Github was updated for PTS and should be compatible with live HighIsle and PTS Firesong
Report comment to moderator  
Reply With Quote
Unread 03/18/22, 06:47 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
Thank you for your test and the feedback, very appreciated. I'll add your code and do some further checks about the dungeon difficulty. Hopefully it is consistent with 0 = delve, 1 and 2 = group dungeon.
btw: You should not use >0 here but use the provided ZOs constants as they might chage any time!
So better use if dungeonDifficulty > DUNGEON_DIFFICULTY_NONE then

Originally Posted by Sensei27
So, initially, the new version just reports all Delves, Public Dungeons, and Group Dungeons as Group Dungeons.

So I did some experimenting; the GetMapDungeonDifficulty() reports back 0 for Delves and Public, >0 for any type of Group Dungeon. I'm suspecting there's a problem with the value of the constant DUNGEON_DIFFICULTY_NORMAL.

Fixing that, the next problem is that it can report back that the character is both In a Delve AND In a Public Dungeon if in a Public Dungeon. So I went ahead and changed the logic somewhat.

This code replaces lines 504 - 518 in your new LibZone.lua file.

Code:
	--Check if user is in any dungeon
	if isInAnyDungeon and isNotInRaidChecks then
		-- if Difficulty is anything other than zero; it's a Group Dungeon
		if dungeonDifficulty > 0 then
			isInGroupDungeon = true
		else
		-- if Difficulty is zero; it's either a Delve or a Public Dungeon
		-- check the Public Dungeons list first
			local pubDungeons = lib.publicDungeonMapIds
			local _, _, _, _, mapId, _ = lib:GetCurrentZoneIds()
			isInPublicDungeon = pubDungeons[mapId] or false
		-- if it isn't a Public Dungeon, it's a Delve
			isInDelve = not isInPublicDungeon
		end
	end
I've tested with this and it seems to do the trick. At least travelling between Bonesnap Ruins (Public), Koeglin Mine (Delve) and Wayrest Sewers (Group) - which are really quick to check. Hopefully, it's good across the board.
Last edited by Baertram : 03/18/22 at 06:47 AM.
Report comment to moderator  
Reply With Quote
Unread 03/18/22, 06:33 AM  
Sensei27

Forum posts: 0
File comments: 12
Uploads: 0
So, initially, the new version just reports all Delves, Public Dungeons, and Group Dungeons as Group Dungeons.

So I did some experimenting; the GetMapDungeonDifficulty() reports back 0 for Delves and Public, >0 for any type of Group Dungeon. I'm suspecting there's a problem with the value of the constant DUNGEON_DIFFICULTY_NORMAL.

Fixing that, the next problem is that it can report back that the character is both In a Delve AND In a Public Dungeon if in a Public Dungeon. So I went ahead and changed the logic somewhat.

This code replaces lines 504 - 518 in your new LibZone.lua file.

Code:
	--Check if user is in any dungeon
	if isInAnyDungeon and isNotInRaidChecks then
		-- if Difficulty is anything other than zero; it's a Group Dungeon
		if dungeonDifficulty > 0 then
			isInGroupDungeon = true
		else
		-- if Difficulty is zero; it's either a Delve or a Public Dungeon
		-- check the Public Dungeons list first
			local pubDungeons = lib.publicDungeonMapIds
			local _, _, _, _, mapId, _ = lib:GetCurrentZoneIds()
			isInPublicDungeon = pubDungeons[mapId] or false
		-- if it isn't a Public Dungeon, it's a Delve
			isInDelve = not isInPublicDungeon
		end
	end
I've tested with this and it seems to do the trick. At least travelling between Bonesnap Ruins (Public), Koeglin Mine (Delve) and Wayrest Sewers (Group) - which are really quick to check. Hopefully, it's good across the board.
Report comment to moderator  
Reply With Quote
Unread 03/17/22, 02:57 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
Thanks for the hints, will have a look.

Edit:
Please download and try this version:
https://github.com/Baertram/LibZone/...ads/master.zip

Code:
local isInRaidChecks = (not isInRaid and groupSize <= SMALL_GROUP_SIZE_THRESHOLD and true) or false
The and true just forces to return the true value, else it would return a value defined by the return of and groupSize <= SMALL_GROUP_SIZE_THRESHOLD (which also should be true in that case but I sometimes missed that a return value could be a number or similar so I had added an explicit true there at the 1line if else checks)
Will not be needed here, but well, should do


Originally Posted by Sensei27
Baertram, the library doesn't seem to notice when I enter a group dungeon solo - using GetCurrentZoneAndGroupStatus() - (yes I'm a masochist sometimes!).

In fact all the flags return false. Is that by design?

-------------------------------------------------------------

Okay, did some digging, if the player isn't grouped it doesn't do the isInGroupDungeon test:

Code:
    if not isInGroup then
        isInDelve = (isInAnyDungeon and dungeonDifficulty == DUNGEON_DIFFICULTY_NONE) or false
    else
        groupSize = GetGroupSize() --SMALL_GROUP_SIZE_THRESHOLD (4) / RAID_GROUP_SIZE_THRESHOLD (12) / GROUP_SIZE_MAX (24)
        local isInRaidChecks = (not isInRaid and groupSize <= SMALL_GROUP_SIZE_THRESHOLD and true) or false
        isInGroupDungeon = (isInAnyDungeon and (dungeonDifficulty == DUNGEON_DIFFICULTY_NORMAL or DUNGEON_DIFFICULTY_VETERAN) and isInRaidChecks) or false
        isInDelve = (not isInGroupDungeon and (isInAnyDungeon and dungeonDifficulty == DUNGEON_DIFFICULTY_NONE and isInRaidChecks)) or false
    end
So, it never gets a chance to set that value to true. It would definitely be useful to still know if the player is in a Group Dungeon or not.


* additional note: why "and true" on the 'isInRaidChecks =' line - surely superfluous to the statement!? (sorry I might be missing something obvious there)
Last edited by Baertram : 03/17/22 at 03:09 PM.
Report comment to moderator  
Reply With Quote
Unread 03/17/22, 02:43 PM  
Sensei27

Forum posts: 0
File comments: 12
Uploads: 0
Baertram, the library doesn't seem to notice when I enter a group dungeon solo - using GetCurrentZoneAndGroupStatus() - (yes I'm a masochist sometimes!).

In fact all the flags return false. Is that by design?

-------------------------------------------------------------

Okay, did some digging, if the player isn't grouped it doesn't do the isInGroupDungeon test:

Code:
    if not isInGroup then
        isInDelve = (isInAnyDungeon and dungeonDifficulty == DUNGEON_DIFFICULTY_NONE) or false
    else
        groupSize = GetGroupSize() --SMALL_GROUP_SIZE_THRESHOLD (4) / RAID_GROUP_SIZE_THRESHOLD (12) / GROUP_SIZE_MAX (24)
        local isInRaidChecks = (not isInRaid and groupSize <= SMALL_GROUP_SIZE_THRESHOLD and true) or false
        isInGroupDungeon = (isInAnyDungeon and (dungeonDifficulty == DUNGEON_DIFFICULTY_NORMAL or DUNGEON_DIFFICULTY_VETERAN) and isInRaidChecks) or false
        isInDelve = (not isInGroupDungeon and (isInAnyDungeon and dungeonDifficulty == DUNGEON_DIFFICULTY_NONE and isInRaidChecks)) or false
    end
So, it never gets a chance to set that value to true. It would definitely be useful to still know if the player is in a Group Dungeon or not.


* additional note: why "and true" on the 'isInRaidChecks =' line - surely superfluous to the statement!? (sorry I might be missing something obvious there)
Last edited by Sensei27 : 03/17/22 at 02:57 PM.
Report comment to moderator  
Reply With Quote
Unread 05/17/21, 02:30 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
Thanks, will update it with the Blackwood update then.
Report comment to moderator  
Reply With Quote
Unread 05/16/21, 08:35 AM  
SimonIllyan
 
SimonIllyan's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 238
Uploads: 1
Tried that, nothing bad happened.

Originally Posted by Baertram
Hi SimonIllyan,
it might have had a reason, but as I did not mention it in the comments I'm not sure which one anymore
Perhaps there were created endless loops or whatever in an earlier state.

Could you try to raise the AddOnVersion in LibZoone.txt to a higher value so that your local copy is always loaded, and then remove the assert and test it a bit.
If everything works out well I'll release an update with the assert removed.

Originally Posted by SimonIllyan
Hello,
I have a question regarding function GetZoneNameByLocalizedSearchString: why do you explicitly (using assert) forbid using returnLanguage equal to searchLanguage?
I was going to use this function to find the id and name of a first zone matching the search string, regardless of the current language, like this:
Code:
zoneId, zoneName = next(GetZoneNameByLocalizedSearchString(nameFragment, currentLanguage, currentLanguage))
but this does not work. Of course, workaround is simple, but my curiosity was piqued - why have you even bothered to use this assertion?
Report comment to moderator  
Reply With Quote
Unread 04/15/21, 08:43 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5990
Uploads: 78
Hi SimonIllyan,
it might have had a reason, but as I did not mention it in the comments I'm not sure which one anymore
Perhaps there were created endless loops or whatever in an earlier state.

Could you try to raise the AddOnVersion in LibZoone.txt to a higher value so that your local copy is always loaded, and then remove the assert and test it a bit.
If everything works out well I'll release an update with the assert removed.

Originally Posted by SimonIllyan
Hello,
I have a question regarding function GetZoneNameByLocalizedSearchString: why do you explicitly (using assert) forbid using returnLanguage equal to searchLanguage?
I was going to use this function to find the id and name of a first zone matching the search string, regardless of the current language, like this:
Code:
zoneId, zoneName = next(GetZoneNameByLocalizedSearchString(nameFragment, currentLanguage, currentLanguage))
but this does not work. Of course, workaround is simple, but my curiosity was piqued - why have you even bothered to use this assertion?
Report comment to moderator  
Reply With Quote
Unread 04/14/21, 04:08 PM  
SimonIllyan
 
SimonIllyan's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 238
Uploads: 1
Hello,
I have a question regarding function GetZoneNameByLocalizedSearchString: why do you explicitly (using assert) forbid using returnLanguage equal to searchLanguage?
I was going to use this function to find the id and name of a first zone matching the search string, regardless of the current language, like this:
Code:
zoneId, zoneName = next(GetZoneNameByLocalizedSearchString(nameFragment, currentLanguage, currentLanguage))
but this does not work. Of course, workaround is simple, but my curiosity was piqued - why have you even bothered to use this assertion?
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.