mirror of
https://github.com/brues-code/nampower.git
synced 2026-10-12 08:30:01 +00:00
rename GetItemTexture and GetSpellTexture to GetItemIconTexture/GetSpellIconTexture to avoid conflict
This commit is contained in:
@@ -120,14 +120,14 @@ Name and spellId lookups are cached internally and validated against current spe
|
||||
|
||||
See examples below for differences in how BOOKTYPE works.
|
||||
|
||||
Functions: `GetSpellTexture`, `GetSpellName`, `GetSpellCooldown`, `GetSpellAutocast`, `ToggleSpellAutocast`, `PickupSpell`, `CastSpell`, `IsCurrentCast`, `IsSpellPassive`.
|
||||
Functions: `GetSpellIconTexture`, `GetSpellName`, `GetSpellCooldown`, `GetSpellAutocast`, `ToggleSpellAutocast`, `PickupSpell`, `CastSpell`, `IsCurrentCast`, `IsSpellPassive`.
|
||||
|
||||
Examples:
|
||||
```
|
||||
/run print(GetSpellTexture(1, "spell")) -- booktype required
|
||||
/run print(GetSpellTexture("spellId:25978")) -- defaults to BOOKTYPE_SPELL
|
||||
/run print(GetSpellTexture("spellId:6268", "pet")) -- "pet" needed for pet spells
|
||||
/run print(GetSpellTexture("Fireball")) -- name search
|
||||
/run print(GetSpellIconTexture(1, "spell")) -- booktype required
|
||||
/run print(GetSpellIconTexture("spellId:25978")) -- defaults to BOOKTYPE_SPELL
|
||||
/run print(GetSpellIconTexture("spellId:6268", "pet")) -- "pet" needed for pet spells
|
||||
/run print(GetSpellIconTexture("Fireball")) -- name search
|
||||
```
|
||||
|
||||
|
||||
|
||||
+6
-6
@@ -26,8 +26,8 @@ For installation, configuration, and general usage information, see the main [RE
|
||||
- [GetSpellSlotTypeIdForName](#getspellslottypeidfornamenspellname)
|
||||
- [GetNampowerVersion](#getnampowerversion)
|
||||
- [GetItemLevel](#getitemlevelitemid)
|
||||
- [GetItemTexture](#getitemtexturedisplayinfoid)
|
||||
- [GetSpellTexture](#getspelltexturespelliconid)
|
||||
- [GetItemIconTexture](#getitemicontexturedisplayinfoid)
|
||||
- [GetSpellIconTexture](#getspellicontexturespelliconid)
|
||||
- [Spell Casting and Queuing](#spell-casting-and-queuing)
|
||||
- [QueueSpellByName](#queuespellbynamespellname)
|
||||
- [CastSpellByNameNoQueue](#castspellbynamenoqueuespellname)
|
||||
@@ -931,7 +931,7 @@ Examples:
|
||||
should print 90 for atiesh
|
||||
```
|
||||
|
||||
#### GetItemTexture(displayInfoId)
|
||||
#### GetItemIconTexture(displayInfoId)
|
||||
Returns the texture path for an item given its display info ID. Returns nil if the texture is not found or is the question mark placeholder texture.
|
||||
|
||||
**Parameters:**
|
||||
@@ -944,7 +944,7 @@ Returns the texture path for an item given its display info ID. Returns nil if t
|
||||
```lua
|
||||
-- Get texture for an item
|
||||
local displayInfoId = GetItemStatsField(19019, "displayInfoID")
|
||||
local texture = GetItemTexture(displayInfoId)
|
||||
local texture = GetItemIconTexture(displayInfoId)
|
||||
if texture then
|
||||
print("Texture: " .. texture)
|
||||
else
|
||||
@@ -952,7 +952,7 @@ else
|
||||
end
|
||||
```
|
||||
|
||||
#### GetSpellTexture(spellIconId)
|
||||
#### GetSpellIconTexture(spellIconId)
|
||||
Returns the texture path for a spell given its spell icon ID. Returns nil if the texture is not found or is the question mark placeholder texture.
|
||||
|
||||
**Parameters:**
|
||||
@@ -965,7 +965,7 @@ Returns the texture path for a spell given its spell icon ID. Returns nil if the
|
||||
```lua
|
||||
-- Get texture for Frostbolt
|
||||
local spellIconId = GetSpellRecField(116, "spellIconID")
|
||||
local texture = GetSpellTexture(spellIconId)
|
||||
local texture = GetSpellIconTexture(spellIconId)
|
||||
if texture then
|
||||
print("Texture: " .. texture)
|
||||
else
|
||||
|
||||
+3281
-3281
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -1647,11 +1647,11 @@ namespace Nampower {
|
||||
char disenchantAll[] = "DisenchantAll";
|
||||
RegisterLuaFunction(disenchantAll, reinterpret_cast<uintptr_t *>(Script_DisenchantAll));
|
||||
|
||||
char getItemTexture[] = "GetItemTexture";
|
||||
RegisterLuaFunction(getItemTexture, reinterpret_cast<uintptr_t *>(Script_GetItemTexture));
|
||||
char getItemIconTexture[] = "GetItemIconTexture";
|
||||
RegisterLuaFunction(getItemIconTexture, reinterpret_cast<uintptr_t *>(Script_GetItemIconTexture));
|
||||
|
||||
char getSpellTexture[] = "GetSpellTexture";
|
||||
RegisterLuaFunction(getSpellTexture, reinterpret_cast<uintptr_t *>(Script_GetSpellTexture));
|
||||
char getSpellIconTexture[] = "GetSpellIconTexture";
|
||||
RegisterLuaFunction(getSpellIconTexture, reinterpret_cast<uintptr_t *>(Script_GetSpellIconTexture));
|
||||
}
|
||||
|
||||
void load() {
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ namespace Nampower {
|
||||
|
||||
constexpr uint32_t MAJOR_VERSION = 2;
|
||||
constexpr uint32_t MINOR_VERSION = 27;
|
||||
constexpr uint32_t PATCH_VERSION = 0;
|
||||
constexpr uint32_t PATCH_VERSION = 1;
|
||||
|
||||
constexpr int32_t LUA_REGISTRYINDEX = -10000;
|
||||
constexpr int32_t LUA_GLOBALSINDEX = -10001;
|
||||
|
||||
@@ -785,11 +785,11 @@ namespace Nampower {
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32_t Script_GetItemTexture(uintptr_t *luaState) {
|
||||
uint32_t Script_GetItemIconTexture(uintptr_t *luaState) {
|
||||
luaState = GetLuaStatePtr(); // pcall leads to corrupted lua state pointer on added scripts, not sure why
|
||||
|
||||
if (!lua_isnumber(luaState, 1)) {
|
||||
lua_error(luaState, "Usage: GetItemTexture(displayInfoId)");
|
||||
lua_error(luaState, "Usage: GetItemIconTexture(displayInfoId)");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -807,11 +807,11 @@ namespace Nampower {
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32_t Script_GetSpellTexture(uintptr_t *luaState) {
|
||||
uint32_t Script_GetSpellIconTexture(uintptr_t *luaState) {
|
||||
luaState = GetLuaStatePtr(); // pcall leads to corrupted lua state pointer on added scripts, not sure why
|
||||
|
||||
if (!lua_isnumber(luaState, 1)) {
|
||||
lua_error(luaState, "Usage: GetSpellTexture(spellIconId)");
|
||||
lua_error(luaState, "Usage: GetSpellIconTexture(spellIconId)");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace Nampower {
|
||||
|
||||
uint32_t Script_DisenchantAll(uintptr_t *luaState);
|
||||
|
||||
uint32_t Script_GetItemTexture(uintptr_t *luaState);
|
||||
uint32_t Script_GetItemIconTexture(uintptr_t *luaState);
|
||||
|
||||
uint32_t Script_GetSpellTexture(uintptr_t *luaState);
|
||||
uint32_t Script_GetSpellIconTexture(uintptr_t *luaState);
|
||||
|
||||
bool RunQueuedScript(int priority);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user