mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
Fixed the formatting, removed extra semicolon
This commit is contained in:
parent
54d7ef82f2
commit
9c3d23eab5
@ -438,7 +438,7 @@ canvas {
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
>* {
|
> * {
|
||||||
opacity: 0.5 !important;
|
opacity: 0.5 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -479,7 +479,7 @@ canvas {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
>.bar {
|
> .bar {
|
||||||
display: none;
|
display: none;
|
||||||
@include S(margin-top, 15px);
|
@include S(margin-top, 15px);
|
||||||
width: 80vw;
|
width: 80vw;
|
||||||
@ -610,7 +610,7 @@ canvas {
|
|||||||
@include PlainText;
|
@include PlainText;
|
||||||
@include S(border-radius, $globalBorderRadius);
|
@include S(border-radius, $globalBorderRadius);
|
||||||
&,
|
&,
|
||||||
>span {
|
> span {
|
||||||
@include S(font-size, 9px);
|
@include S(font-size, 9px);
|
||||||
@include S(line-height, 11px);
|
@include S(line-height, 11px);
|
||||||
font-weight: bold !important;
|
font-weight: bold !important;
|
||||||
@ -697,4 +697,4 @@ iframe {
|
|||||||
transform: translateY(2px);
|
transform: translateY(2px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,4 +211,4 @@ export class SoundImplBrowser extends SoundInterface {
|
|||||||
deinitialize() {
|
deinitialize() {
|
||||||
return super.deinitialize().then(() => Howler.unload());
|
return super.deinitialize().then(() => Howler.unload());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ export class SoundInterface {
|
|||||||
* @param {number} volume
|
* @param {number} volume
|
||||||
*/
|
*/
|
||||||
setMusicVolume(volume) {
|
setMusicVolume(volume) {
|
||||||
this.musicVolume = clamp(volume, 0, 1);;
|
this.musicVolume = clamp(volume, 0, 1);
|
||||||
if (this.currentMusic) {
|
if (this.currentMusic) {
|
||||||
this.currentMusic.setVolume(this.musicVolume);
|
this.currentMusic.setVolume(this.musicVolume);
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ export class SoundInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the sound volume
|
* Sets the sound volume
|
||||||
* @param {number} volume
|
* @param {number} volume
|
||||||
*/
|
*/
|
||||||
setSoundVolume(volume) {
|
setSoundVolume(volume) {
|
||||||
this.soundVolume = clamp(volume, 0, 1);
|
this.soundVolume = clamp(volume, 0, 1);
|
||||||
@ -325,4 +325,4 @@ export class SoundInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,8 @@ export const enumCategories = {
|
|||||||
advanced: "advanced",
|
advanced: "advanced",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const uiScales = [{
|
export const uiScales = [
|
||||||
|
{
|
||||||
id: "super_small",
|
id: "super_small",
|
||||||
size: 0.6,
|
size: 0.6,
|
||||||
},
|
},
|
||||||
@ -45,7 +46,8 @@ export const uiScales = [{
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const scrollWheelSensitivities = [{
|
export const scrollWheelSensitivities = [
|
||||||
|
{
|
||||||
id: "super_slow",
|
id: "super_slow",
|
||||||
scale: 0.25,
|
scale: 0.25,
|
||||||
},
|
},
|
||||||
@ -67,7 +69,8 @@ export const scrollWheelSensitivities = [{
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const movementSpeeds = [{
|
export const movementSpeeds = [
|
||||||
|
{
|
||||||
id: "super_slow",
|
id: "super_slow",
|
||||||
multiplier: 0.25,
|
multiplier: 0.25,
|
||||||
},
|
},
|
||||||
@ -93,7 +96,8 @@ export const movementSpeeds = [{
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const autosaveIntervals = [{
|
export const autosaveIntervals = [
|
||||||
|
{
|
||||||
id: "one_minute",
|
id: "one_minute",
|
||||||
seconds: 60,
|
seconds: 60,
|
||||||
},
|
},
|
||||||
@ -150,9 +154,9 @@ export const allApplicationSettings = [
|
|||||||
category: enumCategories.userInterface,
|
category: enumCategories.userInterface,
|
||||||
restartRequired: false,
|
restartRequired: false,
|
||||||
changeCb:
|
changeCb:
|
||||||
/**
|
/**
|
||||||
* @param {Application} app
|
* @param {Application} app
|
||||||
*/
|
*/
|
||||||
(app, id) => app.updateAfterUiScaleChanged(),
|
(app, id) => app.updateAfterUiScaleChanged(),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@ -199,7 +203,8 @@ export const allApplicationSettings = [
|
|||||||
if (app.platformWrapper.getSupportsFullscreen()) {
|
if (app.platformWrapper.getSupportsFullscreen()) {
|
||||||
app.platformWrapper.setFullscreen(value);
|
app.platformWrapper.setFullscreen(value);
|
||||||
}
|
}
|
||||||
}, !IS_DEMO
|
},
|
||||||
|
!IS_DEMO
|
||||||
),
|
),
|
||||||
|
|
||||||
new BoolSetting(
|
new BoolSetting(
|
||||||
@ -220,13 +225,13 @@ export const allApplicationSettings = [
|
|||||||
category: enumCategories.userInterface,
|
category: enumCategories.userInterface,
|
||||||
restartRequired: false,
|
restartRequired: false,
|
||||||
changeCb:
|
changeCb:
|
||||||
/**
|
/**
|
||||||
* @param {Application} app
|
* @param {Application} app
|
||||||
*/
|
*/
|
||||||
(app, id) => {
|
(app, id) => {
|
||||||
applyGameTheme(id);
|
applyGameTheme(id);
|
||||||
document.documentElement.setAttribute("data-theme", id);
|
document.documentElement.setAttribute("data-theme", id);
|
||||||
},
|
},
|
||||||
enabled: !IS_DEMO,
|
enabled: !IS_DEMO,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@ -237,9 +242,9 @@ export const allApplicationSettings = [
|
|||||||
category: enumCategories.advanced,
|
category: enumCategories.advanced,
|
||||||
restartRequired: false,
|
restartRequired: false,
|
||||||
changeCb:
|
changeCb:
|
||||||
/**
|
/**
|
||||||
* @param {Application} app
|
* @param {Application} app
|
||||||
*/
|
*/
|
||||||
(app, id) => null,
|
(app, id) => null,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@ -250,9 +255,9 @@ export const allApplicationSettings = [
|
|||||||
category: enumCategories.advanced,
|
category: enumCategories.advanced,
|
||||||
restartRequired: false,
|
restartRequired: false,
|
||||||
changeCb:
|
changeCb:
|
||||||
/**
|
/**
|
||||||
* @param {Application} app
|
* @param {Application} app
|
||||||
*/
|
*/
|
||||||
(app, id) => app.updateAfterUiScaleChanged(),
|
(app, id) => app.updateAfterUiScaleChanged(),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@ -350,7 +355,7 @@ export class ApplicationSettings extends ReadWriteProxy {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
.then(() => this.writeAsync());
|
.then(() => this.writeAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
@ -486,12 +491,12 @@ export class ApplicationSettings extends ReadWriteProxy {
|
|||||||
* @param {string} id
|
* @param {string} id
|
||||||
*/
|
*/
|
||||||
resetKeybindingOverride(id) {
|
resetKeybindingOverride(id) {
|
||||||
delete this.getAllSettings().keybindingOverrides[id];
|
delete this.getAllSettings().keybindingOverrides[id];
|
||||||
return this.writeAsync();
|
return this.writeAsync();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Resets all keybinding overrides
|
* Resets all keybinding overrides
|
||||||
*/
|
*/
|
||||||
resetKeybindingOverrides() {
|
resetKeybindingOverrides() {
|
||||||
this.getAllSettings().keybindingOverrides = {};
|
this.getAllSettings().keybindingOverrides = {};
|
||||||
return this.writeAsync();
|
return this.writeAsync();
|
||||||
@ -636,4 +641,4 @@ export class ApplicationSettings extends ReadWriteProxy {
|
|||||||
|
|
||||||
return ExplainedResult.good();
|
return ExplainedResult.good();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,8 @@ export class BaseSetting {
|
|||||||
|
|
||||||
export class EnumSetting extends BaseSetting {
|
export class EnumSetting extends BaseSetting {
|
||||||
constructor(
|
constructor(
|
||||||
id, {
|
id,
|
||||||
|
{
|
||||||
options,
|
options,
|
||||||
valueGetter,
|
valueGetter,
|
||||||
textGetter,
|
textGetter,
|
||||||
@ -110,7 +111,7 @@ export class EnumSetting extends BaseSetting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getHtml() {
|
getHtml() {
|
||||||
return `
|
return `
|
||||||
<div class="setting cardbox ${this.enabled ? "enabled" : "disabled"}">
|
<div class="setting cardbox ${this.enabled ? "enabled" : "disabled"}">
|
||||||
${this.enabled ? "" : `<span class="standaloneOnlyHint">${T.demo.settingNotAvailable}</span>`}
|
${this.enabled ? "" : `<span class="standaloneOnlyHint">${T.demo.settingNotAvailable}</span>`}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -221,7 +222,16 @@ export class BoolSetting extends BaseSetting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class RangeSetting extends BaseSetting {
|
export class RangeSetting extends BaseSetting {
|
||||||
constructor(id, category, changeCb = null, enabled = true, defaultValue = 100, minValue = 0, maxValue = 100, stepSize = 1) {
|
constructor(
|
||||||
|
id,
|
||||||
|
category,
|
||||||
|
changeCb = null,
|
||||||
|
enabled = true,
|
||||||
|
defaultValue = 100,
|
||||||
|
minValue = 0,
|
||||||
|
maxValue = 100,
|
||||||
|
stepSize = 1
|
||||||
|
) {
|
||||||
super(id, category, changeCb, enabled);
|
super(id, category, changeCb, enabled);
|
||||||
|
|
||||||
this.defaultValue = defaultValue;
|
this.defaultValue = defaultValue;
|
||||||
@ -239,7 +249,9 @@ export class RangeSetting extends BaseSetting {
|
|||||||
<label>${T.settings.labels[this.id].title}</label>
|
<label>${T.settings.labels[this.id].title}</label>
|
||||||
<div class="value range" data-setting="${this.id}">
|
<div class="value range" data-setting="${this.id}">
|
||||||
<label class="range-label">${this.defaultValue}</label>
|
<label class="range-label">${this.defaultValue}</label>
|
||||||
<input class="range-input" type="range" value="${this.defaultValue}" min="${this.minValue}" max="${this.maxValue}" step="${this.stepSize}">
|
<input class="range-input" type="range" value="${this.defaultValue}" min="${
|
||||||
|
this.minValue
|
||||||
|
}" max="${this.maxValue}" step="${this.stepSize}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="desc">
|
<div class="desc">
|
||||||
@ -277,4 +289,4 @@ export class RangeSetting extends BaseSetting {
|
|||||||
validate(value) {
|
validate(value) {
|
||||||
return typeof value === "number";
|
return typeof value === "number";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user