Go to Page... |
Compatibility: | Necrom (9.0.0) |
Updated: | 06/23/23 05:22 PM |
Created: | 11/09/20 03:08 AM |
Monthly downloads: | 3,638 |
Total downloads: | 271,174 |
Favorites: | 183 |
MD5: | |
Categories: | Group, Guild & Friends, Raid Mods |
function OSI.SetMechanicIconForUnit( displayName, -- display name of the affected player texture, -- icon texture path size, -- optional icon size color, -- optional icon color {r,g,b} offset, -- optional icon offset in meters callback -- optional callback function ) function OSI.RemoveMechanicIconForUnit( displayName -- display name of the affected player )
local ADDON_NAME = "MyAddonName" local MY_TEXTURE = "myaddonname/myiconpath/myicontexture.dds" local MECHANIC_ID = 12345 EVENT_MANAGER:RegisterForEvent( ADDON_NAME, EVENT_ADD_ON_LOADED, function( _, addonName ) if addonName ~= ADDON_NAME then return end EVENT_MANAGER:UnregisterForEvent( ADDON_NAME, EVENT_ADD_ON_LOADED ) EVENT_MANAGER:RegisterForEvent( ADDON_NAME, EVENT_EFFECT_CHANGED, function( _, changeType, _, _, unitTag ) -- check if OdySupportIcons is active and the affected unit is a player if OSI and OSI.SetMechanicIconForUnit and IsUnitPlayer( unitTag ) then -- retrieve the displayname of the affected player local displayName = GetUnitDisplayName( unitTag ) -- if the player gained the mechanic effect... if changeType == EFFECT_RESULT_GAINED then -- assign your icon to the affected player and make it bigger than other icons OSI.SetMechanicIconForUnit( displayName, -- display name of the affected player MY_TEXTURE, -- icon texture path OSI.GetIconSize() * 1.5, -- optional icon size { 1, 1, 1 }, -- optional icon color {r,g,b} 0, -- optional icon offset in meters function( data ) -- optional callback function -- simple bounce animation along the y-axis data.offset = 0.5 + 0.5 * math.sin( GetGameTimeMilliseconds() / 1000 * 2 ) -- the data object passed to the callback function contains: -- displayName, unitTag, texture, size, color, offset end ) -- if the player lost the mechanic effect... elseif changeType == EFFECT_RESULT_FADED then -- remove your icon from the formerly affected player OSI.RemoveMechanicIconForUnit( displayName ) end end end ) EVENT_MANAGER:AddFilterForEvent( ADDON_NAME, EVENT_EFFECT_CHANGED, REGISTER_FILTER_ABILITY_ID, MECHANIC_ID ) EVENT_MANAGER:AddFilterForEvent( ADDON_NAME, EVENT_EFFECT_CHANGED, REGISTER_FILTER_UNIT_TAG_PREFIX, "group" ) end )
function OSI.CreatePositionIcon( x, y, z, -- world coordinates texture, -- icon texture path size, -- optional icon size color, -- optional icon color {r,g,b} offset, -- optional icon offset in meters callback -- optional callback function ) function OSI.DiscardPositionIcon( icon -- position icon object )
/script OSI.PrintMyPosition()
local ADDON_NAME = "MyAddonName" local MY_TEXTURE = "myaddonname/myiconpath/myicontexture.dds" local MY_ICON = nil EVENT_MANAGER:RegisterForEvent( ADDON_NAME, EVENT_ADD_ON_LOADED, function( _, addonName ) if addonName ~= ADDON_NAME then return end EVENT_MANAGER:UnregisterForEvent( ADDON_NAME, EVENT_ADD_ON_LOADED ) EVENT_MANAGER:RegisterForEvent( ADDON_NAME, EVENT_BOSSES_CHANGED, function() -- check is OdySupportIcons is active and supports world position icons if OSI and OSI.CreatePositionIcon then -- retrieve name of boss local boss = GetUnitName( "boss1" ) -- if we are in Sharpfangs (Deshaan) lair and... if boss and boss == "Sharpfang" then -- if no icon has been created yet... if not MY_ICON then -- create an icon 2.5m above the stone formation and make it bigger than other icons MY_ICON = OSI.CreatePositionIcon( 274367, 11022, 213871, -- world coordinates MY_TEXTURE, -- icon texture path OSI.GetIconSize() * 1.5, -- optional icon size { 1, 1, 1 }, -- optional icon color {r,g,b} 2.5, -- optional icon offset in meters function( data ) -- optional callback function -- simple bounce animation along the y-axis data.offset = 2.5 + math.sin( GetGameTimeMilliseconds() / 1000 * 2 ) -- the data object passed to the callback function contains: -- texture, size, color, offset end ) end -- if we are somewhere else or Sharpfang is not around and... else -- if an icon has been created before... if MY_ICON then -- discard the icon OSI.DiscardPositionIcon( MY_ICON ) MY_ICON = nil end end end end ) end )
function OSI.AddCustomIconPack( icons )
local ADDON_NAME = "MyAddonName" local MY_TEXTURES = { "myaddonname/myiconpath/myicontexture-1.dds", "myaddonname/myiconpath/myicontexture-2.dds", "myaddonname/myiconpath/myicontexture-3.dds", } EVENT_MANAGER:RegisterForEvent( ADDON_NAME, EVENT_ADD_ON_LOADED, function( _, addonName ) if addonName ~= ADDON_NAME then return end EVENT_MANAGER:UnregisterForEvent( ADDON_NAME, EVENT_ADD_ON_LOADED ) -- check if OdySupportIcons is active and supports custom icon packs if OSI and OSI.AddCustomIconPack then -- add your list of icons OSI.AddCustomIconPack( MY_TEXTURES ) end end )
function OSI.AddUniqueIconPack( icons )
local ADDON_NAME = "MyAddonName" local MY_TEXTURES = { ["@SomePlayer"] = "myaddonname/myiconpath/myiconforsomeplayer.dds", ["@AnotherPlayer"] = "myaddonname/myiconpath/myiconforanotherplayer.dds", } EVENT_MANAGER:RegisterForEvent( ADDON_NAME, EVENT_ADD_ON_LOADED, function( _, addonName ) if addonName ~= ADDON_NAME then return end EVENT_MANAGER:UnregisterForEvent( ADDON_NAME, EVENT_ADD_ON_LOADED ) -- check if OdySupportIcons is active and supports unique icon packs if OSI and OSI.AddUniqueIconPack then -- add your list of icons OSI.AddUniqueIconPack( MY_TEXTURES ) end end )
File Name |
Version |
Size |
Uploader |
Date |
1.8.0 |
247kB |
ExoY |
02/05/23 03:48 AM |
|
1.7.0 |
247kB |
ExoY |
06/15/22 05:34 PM |
|
1.6.5 |
248kB |
ExoY |
07/13/21 12:45 PM |
|
1.6.4 |
248kB |
Odylon |
07/05/21 12:33 PM |
|
1.6.3 |
247kB |
Odylon |
06/29/21 12:19 PM |
|
1.6.2 |
246kB |
Odylon |
06/05/21 11:09 AM |
|
1.6.1 |
245kB |
Odylon |
05/22/21 09:51 AM |
|
1.6.0 |
244kB |
Odylon |
05/13/21 10:20 AM |
|
1.5.6 |
336kB |
Odylon |
04/10/21 01:02 AM |
|
1.5.5 |
312kB |
Odylon |
03/18/21 03:36 AM |
|
1.5.4 |
262kB |
Odylon |
01/03/21 04:06 AM |
|
1.5.3 |
245kB |
Odylon |
11/12/20 01:45 PM |
|
1.5.2 |
245kB |
Odylon |
11/09/20 11:34 AM |
|
1.5.1 |
245kB |
Odylon |
11/09/20 10:55 AM |
|
1.5.0 |
245kB |
11/09/20 03:08 AM |
Comment Options |
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
11/09/20, 11:02 AM | ||
|
Instead I've changed the code similar to what is done in LGM overwriting the OnMouseUp function for the GROUP_LIST. This way it works fine in combination with LGM and hopefully any other addon which uses context menu entries. |
|
|
Odylon |
View Public Profile |
Send a private message to Odylon |
Find More Posts by Odylon |
Add Odylon to Your Buddy List |
11/09/20, 06:44 PM | |
would you mind i change some icons for my personal use ?
|
|
|
Anceane |
View Public Profile |
Send a private message to Anceane |
Send email to Anceane |
Find More Posts by Anceane |
Add Anceane to Your Buddy List |
11/10/20, 08:44 AM | ||
|
|
|
|
Odylon |
View Public Profile |
Send a private message to Odylon |
Send email to Odylon |
Find More Posts by Odylon |
Add Odylon to Your Buddy List |
11/12/20, 03:37 PM | |||
|
|||
|
Anceane |
View Public Profile |
Send a private message to Anceane |
Send email to Anceane |
Find More Posts by Anceane |
Add Anceane to Your Buddy List |
05/14/21, 04:40 AM | |
Forum posts: 0
File comments: 15
Uploads: 0
|
Hiya,
just discovered this great addon but seem to have some trouble getting it to work properly. On startup it already throws me the following LUA error, I've installed the newest version of the LibAddonMenu-2.0 dependency. Lua Code:
After dismissing the error the game resumes normally, however, once opening the friends list, or any other menu where custom icons are used, another LUA error appears: Lua Code:
Here's the advanced version in case it's of any help: Lua Code:
After this error the game is basically dead, nothing can be interacted with, the whole UI is gone, menus can't be opened and the only way to close the game is by using Alt+F4. Any idea what might be causing this? |
|
Kelsier |
View Public Profile |
Send a private message to Kelsier |
Send email to Kelsier |
Find More Posts by Kelsier |
Add Kelsier to Your Buddy List |
05/14/21, 05:58 AM | ||
|
Please send me a list or a screenshot of the addons you have active when the error appears so i can try to reproduce and fix it. I've sent you a private message with a link to a file to test a possible hotfix... |
|
|
Odylon |
View Public Profile |
Send a private message to Odylon |
Send email to Odylon |
Find More Posts by Odylon |
Add Odylon to Your Buddy List |
05/14/21, 06:36 AM | |
Forum posts: 0
File comments: 15
Uploads: 0
|
Thanks, yeah there are a couple of those and unfortunately they hardcoded the libs and don't use proper dependency handling I think.
Never really looked into ESO modding on the dev side, is there any way to force a loadorder or make sure those old libs don't get loaded that I could try on my side? I'll defo give the hotfix a try and report back, thanks for caring and doing this so quickly Edit: Hotfix works perfectly fine
Last edited by Kelsier : 05/14/21 at 06:42 AM.
|
|
Kelsier |
View Public Profile |
Send a private message to Kelsier |
Send email to Kelsier |
Find More Posts by Kelsier |
Add Kelsier to Your Buddy List |
05/14/21, 06:54 AM | ||
|
The only way to avoid addons loading hardcoded old libraries is to manually install LibStub and activating it even if none of your addons require it as dependency. Since the game loads all libraries before it starts to load individual addons, LibAddonMenu will already be registered with LibStub and those addons with hardcoded old libraries won't be able to overwrite the new versions. But requesting LibStub as dependency is kind of a bad practice nowadays so that's why this workaround is not really an acceptable solution |
|
|
Odylon |
View Public Profile |
Send a private message to Odylon |
Send email to Odylon |
Find More Posts by Odylon |
Add Odylon to Your Buddy List |
05/14/21, 07:43 AM | |||
may be also you could simply put the latest library of Libaddonmenu directly into the addon folder, and remove all the others version of this library embedded into addons. You could do a save of your AddOns folder before doing that, so if that does not work you just have to put the save again and delete the other.
|
|||
|
Anceane |
View Public Profile |
Send a private message to Anceane |
Send email to Anceane |
Find More Posts by Anceane |
Add Anceane to Your Buddy List |
05/20/21, 10:40 AM | |
Forum posts: 0
File comments: 29
Uploads: 0
|
Good afternoon, thank you for the addon, it helps a lot!
Tell me, can I add a feature so that the character's death icon appears only over those players over which I have enabled the display of icons. Thank you in advance, and would really appreciate adding this feature. |
|
SIDMAY |
View Public Profile |
Send a private message to SIDMAY |
Send email to SIDMAY |
Find More Posts by SIDMAY |
Add SIDMAY to Your Buddy List |
05/21/21, 06:16 AM | ||
|
Last edited by Odylon : 05/21/21 at 06:19 AM.
|
|
|
Odylon |
View Public Profile |
Send a private message to Odylon |
Send email to Odylon |
Find More Posts by Odylon |
Add Odylon to Your Buddy List |
05/21/21, 07:11 AM | |||
Forum posts: 0
File comments: 29
Uploads: 0
|
|
||
|
SIDMAY |
View Public Profile |
Send a private message to SIDMAY |
Send email to SIDMAY |
Find More Posts by SIDMAY |
Add SIDMAY to Your Buddy List |
05/21/21, 09:46 AM | ||
Forum posts: 0
File comments: 2
Uploads: 0
|
|
|
|
Anandaji |
View Public Profile |
Send a private message to Anandaji |
Send email to Anandaji |
Find More Posts by Anandaji |
Add Anandaji to Your Buddy List |
05/21/21, 10:09 AM | |||
|
|
||
|
Odylon |
View Public Profile |
Send a private message to Odylon |
Send email to Odylon |
Find More Posts by Odylon |
Add Odylon to Your Buddy List |