Skip to content

Commit 6a65518

Browse files
committed
display planet name instead of Id
1 parent 48d6009 commit 6a65518

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

-1.9 KB
Loading

content/productivity/upgrade-planet/upgrade_planet.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ import {
2020
import {
2121
PlanetType,
2222
SpaceType
23-
} from "https://cdn.skypack.dev/@darkforest_eth/types"
23+
} from "https://cdn.skypack.dev/@darkforest_eth/types";
24+
25+
const { getPlanetName } = df.getProcgenUtils();
2426

2527
const minSilverPercent = 95;
2628
const minEnergyPercent = 95;
@@ -188,7 +190,6 @@ function App() {
188190

189191
function select() {
190192
setTarget(selectedPlanet);
191-
rankSpan.innerHTML = 'rank: ' + getPlanetRank(selectedPlanet);
192193
}
193194

194195
function stop() {
@@ -245,8 +246,8 @@ function App() {
245246
<button id=selectBtn onClick=${select}>Select a planet to upgrade</button>
246247
</div>
247248
${allowUpgrade(target) ? html`
248-
<span style=${{ marginLeft: '5px' }}>${planetShort(target.locationId)}</span>
249-
<button onClick=${locate}>locate</button><br />
249+
<br /><span style=${{ marginLeft: '5px' }}>${getPlanetName(target)}</span>
250+
<button onClick=${locate} style=${{ marginLeft: '25px' }}>locate</button><br />
250251
<br /><span style=${{ marginLeft: '5px' }} id=patternSpan>upgrade pattern:
251252
<input type="text" value="rrrrs" id="patternInput" style="color:black;font-size:20px;width:70px;height:25px;marginLeft: 3px" title='For example, if the pattern is "rrrsd", a rank 3 planet that can upgrade will choose to upgrade the speed branch' ></input>
252253
</span>
@@ -278,7 +279,7 @@ class Plugin {
278279

279280
async render(container) {
280281
container.parentElement.style.minHeight = 'unset';
281-
container.style.width = '380px';
282+
container.style.width = '300px';
282283
container.style.minHeight = 'unset';
283284

284285
this.container = container;

0 commit comments

Comments
 (0)