feat: extended tribe profile
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Dawid Wysokiński 2023-02-19 07:35:39 +01:00
parent b3b23edd17
commit 0059f560b7
Signed by: Kichiyaki
GPG Key ID: B5445E357FB8B892
3 changed files with 22 additions and 1 deletions

View File

@ -20,6 +20,22 @@ javascript:
$.getScript('https://scripts.tribalwarshelp.com/extended-player-profile.quickbar.js')
```
### Extended tribe profile
This script adds additional info and actions on a tribe overview.
![img.png](docs/extended-tribe-profile.png)
#### Installation
[User script](https://scripts.tribalwarshelp.com/extended-tribe-profile.user.js)
Quick bar:
```javascript
javascript:
$.getScript('https://scripts.tribalwarshelp.com/extended-tribe-profile.quickbar.js')
```
### Extended map popup
This script extends the map popup with additional info.

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 KiB

View File

@ -168,6 +168,7 @@ class UI {
{
header: t('Dominance'),
value: this.tribe.dominance - (this.latestSnapshot?.dominance ?? 0),
customFormat: (v: number) => `${v.toFixed(4)}%`,
},
{
header: t('Members'),
@ -229,7 +230,11 @@ class UI {
<td style="color: #000; background-color: ${this.getStatBgColor(
r.value,
r.rank
)}">${Math.abs(r.value).toLocaleString()}</td>
)}">${
r.customFormat
? r.customFormat(r.value)
: Math.abs(r.value).toLocaleString()
}</td>
</tr>
`
)