Skip to content

Commit

Permalink
Replace checked-by-def/unchecked-by-def with default field
Browse files Browse the repository at this point in the history
  • Loading branch information
FrogTheFrog authored and ReenigneArcher committed Jan 5, 2025
1 parent 5554f39 commit 2577af3
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 37 deletions.
15 changes: 5 additions & 10 deletions src_assets/common/assets/web/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ const props = defineProps({
type: String,
default: "missing-prefix"
},
checkedByDef: {
type: Boolean,
default: false
},
uncheckedByDef: {
type: Boolean,
default: false
default: {
type: [Boolean, null],
default: null
}
});
Expand Down Expand Up @@ -81,9 +77,8 @@ const checkboxValues = (() => {
const labelField = props.label ?? `${props.localePrefix}.${props.id}`;
const descField = props.desc ?? `${props.localePrefix}.${props.id}_desc`;
const showDesc = props.desc !== "" || Object.entries(slots).length > 0;
const showDefValue = props.checkedByDef || props.uncheckedByDef;
const defValue = props.checkedByDef === props.uncheckedByDef ? "INVALID" :
props.checkedByDef ? "_common.enabled_def_cbox" : "_common.disabled_def_cbox";
const showDefValue = props.default !== null;
const defValue = props.default ? "_common.enabled_def_cbox" : "_common.disabled_def_cbox";
</script>
<template>
Expand Down
8 changes: 4 additions & 4 deletions src_assets/common/assets/web/apps.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h1>{{ $t('apps.applications_title') }}</h1>
label="apps.global_prep_name"
desc="apps.global_prep_desc"
v-model="editForm['exclude-global-prep-cmd']"
checked-by-def
default="true"
></Checkbox>
<div class="mb-3">
<label for="appName" class="form-label">{{ $t('apps.cmd_prep_name') }}</label>
Expand Down Expand Up @@ -212,23 +212,23 @@ <h1>{{ $t('apps.applications_title') }}</h1>
label="_common.run_as"
desc="apps.run_as_desc"
v-model="editForm.elevated"
unchecked-by-def
default="false"
></Checkbox>
<!-- auto-detach -->
<Checkbox class="mb-3"
id="autoDetach"
label="apps.auto_detach"
desc="apps.auto_detach_desc"
v-model="editForm['auto-detach']"
checked-by-def
default="true"
></Checkbox>
<!-- wait for all processes -->
<Checkbox class="mb-3"
id="waitAll"
label="apps.wait_all"
desc="apps.wait_all_desc"
v-model="editForm['wait-all']"
checked-by-def
default="true"
></Checkbox>
<!-- exit timeout -->
<div class="mb-3">
Expand Down
2 changes: 1 addition & 1 deletion src_assets/common/assets/web/configs/tabs/AudioVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const config = ref(props.config)
id="install_steam_audio_drivers"
locale-prefix="config"
v-model="config.install_steam_audio_drivers"
checked-by-def
default="true"
></Checkbox>
</template>
</PlatformLayout>
Expand Down
2 changes: 1 addition & 1 deletion src_assets/common/assets/web/configs/tabs/General.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function removeCmd(index) {
id="notify_pre_releases"
locale-prefix="config"
v-model="config.notify_pre_releases"
unchecked-by-def
default="false"
></Checkbox>
</div>
</template>
Expand Down
20 changes: 10 additions & 10 deletions src_assets/common/assets/web/configs/tabs/Inputs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const config = ref(props.config)
id="controller"
locale-prefix="config"
v-model="config.controller"
checked-by-def
default="true"
></Checkbox>

<!-- Emulated Gamepad Type -->
Expand Down Expand Up @@ -64,14 +64,14 @@ const config = ref(props.config)
id="motion_as_ds4"
locale-prefix="config"
v-model="config.motion_as_ds4"
checked-by-def
default="true"
></Checkbox>
<!-- DS4 touchpad -->
<Checkbox class="mb-3"
id="touchpad_as_ds4"
locale-prefix="config"
v-model="config.touchpad_as_ds4"
checked-by-def
default="true"
></Checkbox>
</template>
<!-- DS4 options (all platforms) -->
Expand All @@ -81,7 +81,7 @@ const config = ref(props.config)
id="ds4_back_as_touchpad_click"
locale-prefix="config"
v-model="config.ds4_back_as_touchpad_click"
checked-by-def
default="true"
></Checkbox>
</template>
</div>
Expand All @@ -105,7 +105,7 @@ const config = ref(props.config)
id="keyboard"
locale-prefix="config"
v-model="config.keyboard"
checked-by-def
default="true"
></Checkbox>

<!-- Key Repeat Delay-->
Expand All @@ -130,7 +130,7 @@ const config = ref(props.config)
id="always_send_scancodes"
locale-prefix="config"
v-model="config.always_send_scancodes"
checked-by-def
default="true"
></Checkbox>

<!-- Mapping Key AltRight to Key Windows -->
Expand All @@ -139,7 +139,7 @@ const config = ref(props.config)
id="key_rightalt_to_key_win"
locale-prefix="config"
v-model="config.key_rightalt_to_key_win"
unchecked-by-def
default="false"
></Checkbox>

<!-- Enable Mouse Input -->
Expand All @@ -148,7 +148,7 @@ const config = ref(props.config)
id="mouse"
locale-prefix="config"
v-model="config.mouse"
checked-by-def
default="true"
></Checkbox>

<!-- High resolution scrolling support -->
Expand All @@ -157,7 +157,7 @@ const config = ref(props.config)
id="high_resolution_scrolling"
locale-prefix="config"
v-model="config.high_resolution_scrolling"
checked-by-def
default="true"
></Checkbox>

<!-- Native pen/touch support -->
Expand All @@ -166,7 +166,7 @@ const config = ref(props.config)
id="native_pen_touch"
locale-prefix="config"
v-model="config.native_pen_touch"
checked-by-def
default="true"
></Checkbox>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src_assets/common/assets/web/configs/tabs/Network.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const effectivePort = computed(() => +config.value?.port ?? defaultMoonlightPort
id="upnp"
locale-prefix="config"
v-model="config.upnp"
unchecked-by-def
default="false"
></Checkbox>
<!-- Address family -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const config = ref(props.config)
id="amd_enforce_hrd"
locale-prefix="config"
v-model="config.amd_enforce_hrd"
unchecked-by-def
default="false"
></Checkbox>
</div>
</div>
Expand Down Expand Up @@ -89,15 +89,15 @@ const config = ref(props.config)
id="amd_preanalysis"
locale-prefix="config"
v-model="config.amd_preanalysis"
unchecked-by-def
default="false"
></Checkbox>

<!-- AMD VBAQ -->
<Checkbox class="mb-3"
id="amd_vbaq"
locale-prefix="config"
v-model="config.amd_vbaq"
checked-by-def
default="true"
></Checkbox>

<!-- AMF Coder (H264) -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const config = ref(props.config)
id="qsv_slow_hevc"
locale-prefix="config"
v-model="config.qsv_slow_hevc"
unchecked-by-def
default="false"
></Checkbox>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const config = ref(props.config)
id="nvenc_realtime_hags"
locale-prefix="config"
v-model="config.nvenc_realtime_hags"
checked-by-def
default="true"
>
<br>
<br>
Expand All @@ -91,7 +91,7 @@ const config = ref(props.config)
id="nvenc_latency_over_power"
locale-prefix="config"
v-model="config.nvenc_latency_over_power"
checked-by-def
default="true"
></Checkbox>

<!-- Present OpenGL/Vulkan on top of DXGI -->
Expand All @@ -100,15 +100,15 @@ const config = ref(props.config)
id="nvenc_opengl_vulkan_on_dxgi"
locale-prefix="config"
v-model="config.nvenc_opengl_vulkan_on_dxgi"
checked-by-def
default="true"
></Checkbox>

<!-- NVENC H264 CAVLC -->
<Checkbox class="mb-3"
id="nvenc_h264_cavlc"
locale-prefix="config"
v-model="config.nvenc_h264_cavlc"
unchecked-by-def
default="false"
></Checkbox>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const config = ref(props.config)
id="vaapi_strict_rc_buffer"
locale-prefix="config"
v-model="config.vaapi_strict_rc_buffer"
unchecked-by-def
default="false"
></Checkbox>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const config = ref(props.config)
desc=""
locale-prefix="config"
v-model="config.vt_realtime"
checked-by-def
default="true"
></Checkbox>
</div>
</template>
Expand Down

0 comments on commit 2577af3

Please sign in to comment.