Fix : prevent render retrigger when color changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
const settingsStore = useSettingsStore()
|
||||
import { off } from 'process';
|
||||
|
||||
import ShaderWorker from '~/assets/workers/ShaderWorker?worker'
|
||||
const worker = new ShaderWorker()
|
||||
|
||||
@@ -49,6 +49,8 @@ function resizeShader() {
|
||||
command: 'changeBounds',
|
||||
bounds: { left: bounds.left, bottom: bounds.bottom },
|
||||
screen: { height: window.screen.height, width: window.screen.width, devicePixelRatio },
|
||||
colorStart: props.colorStart,
|
||||
colorEnd: props.colorEnd
|
||||
})
|
||||
}
|
||||
|
||||
@@ -58,11 +60,22 @@ function endShader() {
|
||||
})
|
||||
}
|
||||
|
||||
watch(() => [settingsStore.shaderQuality, settingsStore.shaderFramerate, props.colorEnd, props.colorStart], () => {
|
||||
watch(() => [settingsStore.shaderQuality, settingsStore.shaderFramerate], () => {
|
||||
safeReloadShader()
|
||||
})
|
||||
|
||||
|
||||
let has_resized = false
|
||||
watch(() => [props.colorEnd, props.colorStart], () => {
|
||||
if (!has_resized) {
|
||||
has_resized = true
|
||||
nextTick(() => {
|
||||
resizeShader()
|
||||
has_resized = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
nextTick(() => {
|
||||
initShader()
|
||||
|
||||
@@ -60,7 +60,6 @@ function can_buy_fire_gem(): boolean {
|
||||
|
||||
function checkEndTurn() {
|
||||
// TODO: Add a confirmation dialog if resources are left
|
||||
console.log("Checking end turn")
|
||||
if (
|
||||
(!warning.value)
|
||||
&& has_actions_remaining()) {
|
||||
|
||||
Reference in New Issue
Block a user