Skip to content

Commit

Permalink
Small fixes pt. 3 (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImUrX committed Aug 19, 2023
1 parent 942f64a commit a92dec8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
4 changes: 2 additions & 2 deletions gui/public/i18n/en/translation.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ onboarding-assignment_tutorial = How to prepare a Slime Tracker before putting i
onboarding-assignment_tutorial-first_step = 1. Place a body part sticker (if you have one) on the tracker according to your choosing
# This text has a character limit of around 11 characters, so please keep it short
onboarding-assignment_tutorial-sticker = Sticker
onboarding-assignment_tutorial-second_step = 2. Attach the strap to your tracker, keeping the hook and loop side of the strap face in the following orientation:
onboarding-assignment_tutorial-second_step-continuation = The hook and loop side for the extension should be in this orientation:
onboarding-assignment_tutorial-second_step-v2 = 2. Attach the strap to your tracker, keeping the velcro side of the strap facing the same direction as the slime face of your tracker:
onboarding-assignment_tutorial-second_step-continuation-v2 = The velcro side for the extension should be facing up like the following image:
onboarding-assignment_tutorial-done = I put stickers and straps!
## Tracker assignment setup
Expand Down
2 changes: 1 addition & 1 deletion gui/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ fn main() -> Result<()> {
};
app_handle
.emit_all("server-status", emit_me)
.expect("Failed to emit");
.expect("Check server log files. \nFailed to emit");
}
log::error!("Java server receiver died");
app_handle
Expand Down
25 changes: 22 additions & 3 deletions gui/src/components/ClearMountingButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,30 @@ import { ClearMountingResetRequestT, RpcMessage } from 'solarxr-protocol';
import { useWebsocketAPI } from '../hooks/websocket-api';
import { BigButton } from './commons/BigButton';
import { TrashIcon } from './commons/icon/TrashIcon';
import { useTrackers } from '../hooks/tracker';
import { Quaternion } from 'three';
import { QuaternionFromQuatT, similarQuaternions } from '../maths/quaternion';
import { useMemo } from 'react';

const _q = new Quaternion();

export function ClearMountingButton() {
const { l10n } = useLocalization();
const { sendRPCPacket } = useWebsocketAPI();
const { useAssignedTrackers } = useTrackers();
const assignedTrackers = useAssignedTrackers();

const trackerWithMounting = useMemo(
() =>
assignedTrackers.some(
(d) =>
!similarQuaternions(
QuaternionFromQuatT(d?.tracker.info?.mountingResetOrientation),
_q
)
),
[assignedTrackers]
);

const clearMounting = () => {
const record = new ClearMountingResetRequestT();
Expand All @@ -18,8 +38,7 @@ export function ClearMountingButton() {
text={l10n.getString('widget-clear_mounting')}
icon={<TrashIcon width={20} />}
onClick={clearMounting}
>
{}
</BigButton>
disabled={!trackerWithMounting}
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function AssignmentTutorialPage() {
<div>
<Typography variant="section-title">
{l10n.getString(
'onboarding-assignment_tutorial-second_step'
'onboarding-assignment_tutorial-second_step-v2'
)}
</Typography>
</div>
Expand All @@ -54,7 +54,7 @@ export function AssignmentTutorialPage() {
<div>
<Typography variant="section-title">
{l10n.getString(
'onboarding-assignment_tutorial-second_step-continuation'
'onboarding-assignment_tutorial-second_step-continuation-v2'
)}
</Typography>
</div>
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a92dec8

Please sign in to comment.