Skip to content

Commit 4ddc14e

Browse files
authored
Release (#442)
2 parents f07a57f + 9a3667e commit 4ddc14e

File tree

7 files changed

+240
-56
lines changed

7 files changed

+240
-56
lines changed

renderer/rsbuildSharedConfig.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ export const rspackViewerConfig = (config, { appendPlugins, addRules, rspack }:
112112
{
113113
test: /\.log$/,
114114
type: 'asset/source',
115+
},
116+
{
117+
test: /\.gltf$/,
118+
type: 'asset/resource',
115119
}
116120
])
117121
config.ignoreWarnings = [

renderer/viewer/three/documentRenderer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class DocumentRenderer {
5252
initOptions.callbacks.displayCriticalError(new Error(`Failed to create WebGL context, not possible to render (restart browser): ${err.message}`))
5353
throw err
5454
}
55+
this.renderer.useLegacyLights = true
5556
this.renderer.outputColorSpace = THREE.LinearSRGBColorSpace
5657
if (!externalCanvas) {
5758
this.updatePixelRatio()

src/defaultOptions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export const defaultOptions = {
6969
chatVanillaRestrictions: true,
7070
debugResponseTimeIndicator: false,
7171
chatPingExtension: true,
72+
chatSpellCheckEnabled: false,
7273
// antiAliasing: false,
7374
topRightTimeDisplay: 'only-fullscreen' as 'only-fullscreen' | 'always' | 'never',
7475

src/inventoryWindows.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ export const showInventoryPlayer = () => {
5555
height: 70,
5656
scaled: true,
5757
onlyInitialScale: true,
58-
followCursor: true,
58+
},
59+
followCursor: true,
60+
followCursorCenter: {
61+
x: 51,
62+
y: 27,
5963
},
6064
// models: ['https://bucket.mcraft.fun/sitarbuckss.glb'],
6165
// debug: true,

src/react/Chat.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ type Props = {
8383
debugChatScroll?: boolean
8484
getPingComplete?: (value: string) => Promise<string[]>
8585
currentPlayerName?: string
86+
spellCheckEnabled?: boolean
87+
onSpellCheckEnabledChange?: (enabled: boolean) => void
8688
}
8789

8890
export const chatInputValueGlobal = proxy({
@@ -103,7 +105,9 @@ export default ({
103105
chatVanillaRestrictions,
104106
debugChatScroll,
105107
getPingComplete,
106-
currentPlayerName
108+
currentPlayerName,
109+
spellCheckEnabled = false,
110+
onSpellCheckEnabledChange
107111
}: Props) => {
108112
const playerNameValidated = useMemo(() => {
109113
if (!/^[\w\d_]+$/i.test(currentPlayerName ?? '')) return ''
@@ -112,7 +116,6 @@ export default ({
112116

113117
const sendHistoryRef = useRef(JSON.parse(window.sessionStorage.chatHistory || '[]'))
114118
const [isInputFocused, setIsInputFocused] = useState(false)
115-
const [spellCheckEnabled, setSpellCheckEnabled] = useState(false)
116119
const [preservedInputValue, setPreservedInputValue] = useState('')
117120
const [inputKey, setInputKey] = useState(0)
118121
const pingHistoryRef = useRef(JSON.parse(window.localStorage.pingHistory || '[]'))
@@ -458,7 +461,7 @@ export default ({
458461
icon={pixelartIcons['text-wrap']}
459462
onClick={() => {
460463
setPreservedInputValue(chatInput.current?.value || '')
461-
setSpellCheckEnabled(!spellCheckEnabled)
464+
onSpellCheckEnabledChange?.(!spellCheckEnabled)
462465
remountInput()
463466
}}
464467
/>

src/react/ChatProvider.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ export default () => {
1818
const lastMessageId = useRef(0)
1919
const lastPingTime = useRef(0)
2020
const usingTouch = useSnapshot(miscUiState).currentTouch
21-
const { chatSelect, messagesLimit, chatOpacity, chatOpacityOpened, chatVanillaRestrictions, debugChatScroll, chatPingExtension } = useSnapshot(options)
21+
const {
22+
chatSelect,
23+
messagesLimit,
24+
chatOpacity,
25+
chatOpacityOpened,
26+
chatVanillaRestrictions,
27+
debugChatScroll,
28+
chatPingExtension,
29+
chatSpellCheckEnabled
30+
} = useSnapshot(options)
2231
const isUsingMicrosoftAuth = useMemo(() => !!lastConnectOptions.value?.authenticatedAccount, [])
2332
const { forwardChat } = useSnapshot(viewerVersionState)
2433
const { viewerConnection } = useSnapshot(gameAdditionalState)
@@ -62,6 +71,10 @@ export default () => {
6271
opened={isChatActive}
6372
placeholder={forwardChat || !viewerConnection ? undefined : 'Chat forwarding is not enabled in the plugin settings'}
6473
currentPlayerName={chatPingExtension ? bot.username : undefined}
74+
spellCheckEnabled={chatSpellCheckEnabled}
75+
onSpellCheckEnabledChange={(enabled) => {
76+
options.chatSpellCheckEnabled = enabled
77+
}}
6578
getPingComplete={async (value) => {
6679
const players = Object.keys(bot.players)
6780
return players.filter(name => (!value || name.toLowerCase().includes(value.toLowerCase())) && name !== bot.username).map(name => `@${name}`)

0 commit comments

Comments
 (0)