SoftbearStudios / mk48

Mk48.io ship combat game
https://mk48.io
GNU Affero General Public License v3.0
331 stars 58 forks source link

Update strings.json #205

Closed sheumais closed 2 years ago

sheumais commented 2 years ago

Adds key bind hints to the active sensor and submerge hovers in all languages.

Resolves #204

finnbear commented 2 years ago

Thanks for the PR! This would work, but is a bit repetitive. It looks as if all languages get the same treatment.

As such, I'd prefer if the GUI just appended/prepended the string (R) and (Z): https://github.com/SoftbearStudios/mk48/blob/5342e65133e8442f375c6eb80e5610f4f78a7e06/js/src/overlay/ShipControls.svelte#L94-L100

I should note that we are in the process of replacing all Javascript+Svelte code with Rust+Yew code, which also involves switch from crowdl.io JSON translations (like what you edited) to Rust code, but I can add this change during the port. Kiomet.com already uses the new system, but is unfortunately not open source (yet).

finnbear commented 2 years ago

...however, I'm not against merging it as a reminder while porting and to make sure GitHub credits you as a contributor to the repository! Lemme make sure the CI/CD system is still working (not that your changes have any chance of breaking it).

sheumais commented 2 years ago

I see. Understood. I have never used Svelte actually haha. Would this work?

{/each}
    {#if entityData[alive.type].subkind === 'submarine'}
        <div class='button' class:selected={altitudeTarget === 0} on:click={toggleAltitudeTarget} title={"(R) " + $t(`panel.ship.action.surface.hint`)}>{$t('panel.ship.action.surface.label')}</div>
    {/if}
    {#if getActiveSensorHint($t, alive.type, alive.altitude)}
        <div class='button' class:selected={active} on:click={toggleActive} title={"(Z) " + getActiveSensorHint($t, alive.type, alive.altitude)}>{$t(`panel.ship.action.active.label`)}</div>
    {/if}
finnbear commented 2 years ago

I see. Understood. I have never used Svelte actually haha. Would this work?

{/each}
  {#if entityData[alive.type].subkind === 'submarine'}
      <div class='button' class:selected={altitudeTarget === 0} on:click={toggleAltitudeTarget} title={"(R) " + $t(`panel.ship.action.surface.hint`)}>{$t('panel.ship.action.surface.label')}</div>
  {/if}
  {#if getActiveSensorHint($t, alive.type, alive.altitude)}
      <div class='button' class:selected={active} on:click={toggleActive} title={"(Z) " + getActiveSensorHint($t, alive.type, alive.altitude)}>{$t(`panel.ship.action.active.label`)}</div>
  {/if}

Yeah, that's exactly what the fix should look like in Svelte. As we are porting to Rust/Yew, it might look more like title={format!("({}) {}", Game::ACTIVE_SENSOR_KEY, t().active_sensor_hint(...))} :smile: