Skip to content

Commit

Permalink
Mods UI fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tzhf committed Apr 16, 2024
1 parent 63272d2 commit ef61a0d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/main/GameHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ export default class GameHandler {
const map = await fetchMap(this.#game.seed.map)
if (map) {
await this.#backend?.sendMessage(
`🌎 Now playing '${map.name}' by ${map.creator.nick}, played ${map.numFinishedGames} times with ${map.likes} likes${map.description?`: ${map.description}`:''}`
`🌎 Now playing '${map.name}' by ${map.creator.nick}, played ${map.numFinishedGames} times with ${map.likes} likes${map.description ? `: ${map.description}` : ''}`
)
}

Expand Down
14 changes: 7 additions & 7 deletions src/renderer/mods/blinkMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ import { getLocalStorage, setLocalStorage } from '../useLocalStorage'

const classicGameGuiHTML: string = `
<div class="section_sizeMedium__yPqLK">
<div class="bars_root__Z20mU bars_center__Kq6kA">
<div class="bars_before__bo63I"></div>
<span class="bars_content__F_LTP"><h3>Blink Mode settings</h3></span>
<div class="bars_after__VCYQM"></div>
<div class="bars_root__tryg2 bars_center__kXp6T">
<div class="bars_before__S32L5"></div>
<span class="bars_content__Nw_TD"><h3>Blink Mode settings</h3></span>
<div class="bars_after__50_BW"></div>
</div>
</div>
<div class="start-standard-game_settings__x94PU">
<div class="game-options_optionGroup__qNKx1">
<div style="display: flex; justify-content: space-between">
<div style="display: flex; align-items: center">
<span class="game-options_optionLabel__dJ_Cy" style="margin: 0; padding-right: 6px">Enabled</span>
<input type="checkbox" id="enableScript" onclick="toggleBlinkMode(this)" class="toggle_toggle__hwnyw" />
<input type="checkbox" id="enableScript" onclick="toggleBlinkMode(this)" class="toggle_toggle__qfXpL" />
</div>
<div style="display: flex; align-items: center">
<label class="game-options_option__eCz9o game-options_editableOption__Mpvar">
Expand Down Expand Up @@ -85,11 +85,11 @@ import { getLocalStorage, setLocalStorage } from '../useLocalStorage'

const checkInsertGui = () => {
if (
document.querySelector('.radio-box_root__ka_9S') &&
document.querySelector('[class^="radio-box_root__"]') &&
document.getElementById('enableScript') === null
) {
document
.querySelector('.section_sectionMedium__yXgE6')
.querySelector('[class^="section_sectionMedium__"]')
?.insertAdjacentHTML('beforeend', classicGameGuiHTML)

if (settings.enabled) {
Expand Down
12 changes: 6 additions & 6 deletions src/renderer/mods/noCarNoCompass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ import { getLocalStorage, setLocalStorage } from '../useLocalStorage'

const classicGameGuiHTML = `
<div class="section_sizeMedium__yPqLK">
<div class="bars_root__Z20mU bars_center__Kq6kA">
<div class="bars_before__bo63I"></div>
<span class="bars_content__F_LTP"><h3>NCNC settings</h3></span>
<div class="bars_after__VCYQM"></div>
<div class="bars_root__tryg2 bars_center__kXp6T">
<div class="bars_before__S32L5"></div>
<span class="bars_content__Nw_TD"><h3>NCNC settings</h3></span>
<div class="bars_after__50_BW"></div>
</div>
</div>
<div class="start-standard-game_settings__x94PU">
<div style="display: flex; justify-content: space-between">
<div style="display: flex; align-items: center">
<span class="game-options_optionLabel__dJ_Cy" style="margin: 0; padding-right: 6px;">No car</span>
<input type="checkbox" id="enableNoCar" onclick="toggleNoCarMode(this)" class="toggle_toggle__hwnyw">
<input type="checkbox" id="enableNoCar" onclick="toggleNoCarMode(this)" class="toggle_toggle__qfXpL">
</div>
<div style="display: flex; align-items: center;">
<span class="game-options_optionLabel__dJ_Cy" style="margin: 0; padding-right: 6px;">No compass</span>
<input type="checkbox" id="enableNoCompass" onclick="toggleNoCompassMode(this)" class="toggle_toggle__hwnyw">
<input type="checkbox" id="enableNoCompass" onclick="toggleNoCompassMode(this)" class="toggle_toggle__qfXpL">
</div>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/mods/satelliteMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import { getLocalStorage, setLocalStorage } from '../useLocalStorage'

const classicGameGuiHTML = `
<div class="section_sizeMedium__yPqLK">
<div class="bars_root__Z20mU bars_center__Kq6kA">
<div class="bars_before__bo63I"></div>
<span class="bars_content__F_LTP"><h3>Satellite Mode settings</h3></span>
<div class="bars_after__VCYQM"></div>
<div class="bars_root__tryg2 bars_center__kXp6T">
<div class="bars_before__S32L5"></div>
<span class="bars_content__Nw_TD"><h3>Satellite Mode settings</h3></span>
<div class="bars_after__50_BW"></div>
</div>
</div>
<div class="start-standard-game_settings__x94PU">
Expand All @@ -34,7 +34,7 @@ import { getLocalStorage, setLocalStorage } from '../useLocalStorage'
type="checkbox"
id="enableSatelliteMode"
onclick="toggleSatelliteMode(this)"
class="toggle_toggle__hwnyw"
class="toggle_toggle__qfXpL"
/>
</div>
<div style="display: flex; align-items: center">
Expand Down

0 comments on commit ef61a0d

Please sign in to comment.