Skip to content

Commit

Permalink
Merge pull request #95 from Rollphes/develop
Browse files Browse the repository at this point in the history
v1.1.4
  • Loading branch information
Rollphes committed Apr 22, 2024
2 parents 7bd64ff + 3e3ea74 commit 9ee788e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/classes/ProfilePicture.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/APIPlayerInfo.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>APIPlayerInfo | genshin-manager</title><meta name="description" content="Documentation for genshin-manager"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">genshin-manager</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">genshin-manager</a></li><li><a href="APIPlayerInfo.html">APIPlayerInfo</a></li></ul><h1>Interface APIPlayerInfo</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Enka API PlayerInfo type</p>
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">APIPlayerInfo</span> <span class="tsd-signature-symbol">{ </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#finishAchievementNum">finishAchievementNum</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#level">level</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#nameCardId">nameCardId</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#nickname">nickname</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#profilePicture">profilePicture</a><span class="tsd-signature-symbol">?: </span><a href="APIProfilePicture.html" class="tsd-signature-type tsd-kind-interface">APIProfilePicture</a><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#showAvatarInfoList">showAvatarInfoList</a><span class="tsd-signature-symbol">?: </span><a href="APIShowAvatarInfo.html" class="tsd-signature-type tsd-kind-interface">APIShowAvatarInfo</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#showNameCardIdList">showNameCardIdList</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#signature">signature</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#towerFloorIndex">towerFloorIndex</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#towerLevelIndex">towerLevelIndex</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#worldLevel">worldLevel</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="APIPlayerInfo.html#finishAchievementNum" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>finish<wbr/>Achievement<wbr/>Num?</span></a>
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">APIPlayerInfo</span> <span class="tsd-signature-symbol">{ </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#finishAchievementNum">finishAchievementNum</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#level">level</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#nameCardId">nameCardId</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#nickname">nickname</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#profilePicture">profilePicture</a><span class="tsd-signature-symbol">?: </span><a href="APIProfilePicture.html" class="tsd-signature-type tsd-kind-interface">APIProfilePicture</a><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#showAvatarInfoList">showAvatarInfoList</a><span class="tsd-signature-symbol">?: </span><a href="APIShowAvatarInfo.html" class="tsd-signature-type tsd-kind-interface">APIShowAvatarInfo</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#showNameCardIdList">showNameCardIdList</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#signature">signature</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#towerFloorIndex">towerFloorIndex</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#towerLevelIndex">towerLevelIndex</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><a class="tsd-kind-property" href="APIPlayerInfo.html#worldLevel">worldLevel</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="APIPlayerInfo.html#finishAchievementNum" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>finish<wbr/>Achievement<wbr/>Num?</span></a>
<a href="APIPlayerInfo.html#level" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>level</span></a>
<a href="APIPlayerInfo.html#nameCardId" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>name<wbr/>Card<wbr/>Id</span></a>
<a href="APIPlayerInfo.html#nickname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>nickname</span></a>
<a href="APIPlayerInfo.html#nickname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>nickname?</span></a>
<a href="APIPlayerInfo.html#profilePicture" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>profile<wbr/>Picture?</span></a>
<a href="APIPlayerInfo.html#showAvatarInfoList" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>show<wbr/>Avatar<wbr/>Info<wbr/>List?</span></a>
<a href="APIPlayerInfo.html#showNameCardIdList" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>show<wbr/>Name<wbr/>Card<wbr/>Id<wbr/>List?</span></a>
Expand All @@ -13,7 +13,7 @@
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Properties</h2><section class="tsd-panel tsd-member"><a id="finishAchievementNum" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>finish<wbr/>Achievement<wbr/>Num</span><a href="#finishAchievementNum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">finish<wbr/>Achievement<wbr/>Num</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Number of Completed Achievements</p>
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel tsd-member"><a id="level" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>level</span><a href="#level" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">level</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Player Adventure Level</p>
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel tsd-member"><a id="nameCardId" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>name<wbr/>Card<wbr/>Id</span><a href="#nameCardId" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">name<wbr/>Card<wbr/>Id</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Profile NameCard ID</p>
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel tsd-member"><a id="nickname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>nickname</span><a href="#nickname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">nickname</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Player Nickname</p>
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel tsd-member"><a id="nickname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>nickname</span><a href="#nickname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">nickname</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Player Nickname</p>
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel tsd-member"><a id="profilePicture" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>profile<wbr/>Picture</span><a href="#profilePicture" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">profile<wbr/>Picture</span><span class="tsd-signature-symbol">?:</span> <a href="APIProfilePicture.html" class="tsd-signature-type tsd-kind-interface">APIProfilePicture</a></div><div class="tsd-comment tsd-typography"><p>Profile Picture</p>
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel tsd-member"><a id="showAvatarInfoList" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>show<wbr/>Avatar<wbr/>Info<wbr/>List</span><a href="#showAvatarInfoList" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">show<wbr/>Avatar<wbr/>Info<wbr/>List</span><span class="tsd-signature-symbol">?:</span> <a href="APIShowAvatarInfo.html" class="tsd-signature-type tsd-kind-interface">APIShowAvatarInfo</a><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>List of Character IDs and Levels</p>
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel tsd-member"><a id="showNameCardIdList" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>show<wbr/>Name<wbr/>Card<wbr/>Id<wbr/>List</span><a href="#showNameCardIdList" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">show<wbr/>Name<wbr/>Card<wbr/>Id<wbr/>List</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>List of NameCard IDs</p>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "genshin-manager",
"version": "1.1.3",
"version": "1.1.4",
"homepage": "https://rollphes.github.io/genshin-manager/",
"bugs": "https://github.com/Rollphes/genshin-manager/issues",
"main": "dist/index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/models/ProfilePicture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ export class ProfilePicture {

/**
* Find profile picture ID by info ID
* @param infoId Costume ID or Character ID or Material ID
* @param unlockParam Costume ID or Character ID or Material ID or Quest ID
* @returns Profile picture ID
*/
public static findProfilePictureIdByInfoId(
infoId: number,
public static findProfilePictureIdByUnlockParam(
unlockParam: number,
): number | undefined {
const profilePictureDatas = Object.values(
Client._getCachedExcelBinOutputByName('ProfilePictureExcelConfigData'),
)
const profilePictureData = profilePictureDatas.find(
(data) => data.infoId === infoId,
(data) => data.unlockParam === unlockParam,
)
if (!profilePictureData) return
return profilePictureData.id as number
Expand Down
4 changes: 2 additions & 2 deletions src/models/enka/PlayerDetail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ export class PlayerDetail {
if (data.profilePicture && data.profilePicture.id) {
profilePictureId = data.profilePicture.id
} else {
profilePictureId = ProfilePicture.findProfilePictureIdByInfoId(
profilePictureId = ProfilePicture.findProfilePictureIdByUnlockParam(
data.profilePicture?.costumeId ??
data.profilePicture?.avatarId ??
10000005,
) as number
}
this.profilePicture = new ProfilePicture(profilePictureId || 10000005)
this.profilePicture = new ProfilePicture(profilePictureId || 1)
this.data = data
}
}

0 comments on commit 9ee788e

Please sign in to comment.