mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-05 17:14:03 +00:00
Minor improvements
This commit is contained in:
parent
52e05f14c0
commit
8c88d738cc
@ -1,43 +1,41 @@
|
|||||||
import { AnimationFrame } from "./core/animation_frame";
|
import { AnimationFrame } from "./core/animation_frame";
|
||||||
import { performanceNow, Math_min } from "./core/builtins";
|
import { BackgroundResourcesLoader } from "./core/background_resources_loader";
|
||||||
|
import { performanceNow } from "./core/builtins";
|
||||||
|
import { IS_MOBILE } from "./core/config";
|
||||||
import { GameState } from "./core/game_state";
|
import { GameState } from "./core/game_state";
|
||||||
import { GLOBAL_APP, setGlobalApp } from "./core/globals";
|
import { GLOBAL_APP, setGlobalApp } from "./core/globals";
|
||||||
import { InputDistributor } from "./core/input_distributor";
|
import { InputDistributor } from "./core/input_distributor";
|
||||||
|
import { Loader } from "./core/loader";
|
||||||
|
import { createLogger, logSection } from "./core/logging";
|
||||||
import { StateManager } from "./core/state_manager";
|
import { StateManager } from "./core/state_manager";
|
||||||
|
import { TrackedState } from "./core/tracked_state";
|
||||||
import { getPlatformName, waitNextFrame } from "./core/utils";
|
import { getPlatformName, waitNextFrame } from "./core/utils";
|
||||||
import { SavegameManager } from "./savegame/savegame_manager";
|
import { Vector } from "./core/vector";
|
||||||
import { AdProviderInterface } from "./platform/ad_provider";
|
import { AdProviderInterface } from "./platform/ad_provider";
|
||||||
import { NoAdProvider } from "./platform/ad_providers/no_ad_provider";
|
import { NoAdProvider } from "./platform/ad_providers/no_ad_provider";
|
||||||
|
import { AnalyticsInterface } from "./platform/analytics";
|
||||||
|
import { ShapezGameAnalytics } from "./platform/browser/game_analytics";
|
||||||
|
import { GoogleAnalyticsImpl } from "./platform/browser/google_analytics";
|
||||||
import { SoundImplBrowser } from "./platform/browser/sound";
|
import { SoundImplBrowser } from "./platform/browser/sound";
|
||||||
import { StorageImplBrowser } from "./platform/browser/storage";
|
import { StorageImplBrowser } from "./platform/browser/storage";
|
||||||
|
import { StorageImplBrowserIndexedDB } from "./platform/browser/storage_indexed_db";
|
||||||
import { PlatformWrapperImplBrowser } from "./platform/browser/wrapper";
|
import { PlatformWrapperImplBrowser } from "./platform/browser/wrapper";
|
||||||
|
import { StorageImplElectron } from "./platform/electron/storage";
|
||||||
|
import { PlatformWrapperImplElectron } from "./platform/electron/wrapper";
|
||||||
|
import { GameAnalyticsInterface } from "./platform/game_analytics";
|
||||||
import { SoundInterface } from "./platform/sound";
|
import { SoundInterface } from "./platform/sound";
|
||||||
import { StorageInterface } from "./platform/storage";
|
import { StorageInterface } from "./platform/storage";
|
||||||
import { PlatformWrapperInterface } from "./platform/wrapper";
|
import { PlatformWrapperInterface } from "./platform/wrapper";
|
||||||
import { ApplicationSettings } from "./profile/application_settings";
|
import { ApplicationSettings } from "./profile/application_settings";
|
||||||
import { Vector } from "./core/vector";
|
import { SavegameManager } from "./savegame/savegame_manager";
|
||||||
import { createLogger, logSection } from "./core/logging";
|
|
||||||
import { TrackedState } from "./core/tracked_state";
|
|
||||||
import { IS_MOBILE } from "./core/config";
|
|
||||||
import { BackgroundResourcesLoader } from "./core/background_resources_loader";
|
|
||||||
import { PreloadState } from "./states/preload";
|
|
||||||
import { MainMenuState } from "./states/main_menu";
|
|
||||||
import { InGameState } from "./states/ingame";
|
|
||||||
import { AnalyticsInterface } from "./platform/analytics";
|
|
||||||
import { GoogleAnalyticsImpl } from "./platform/browser/google_analytics";
|
|
||||||
import { Loader } from "./core/loader";
|
|
||||||
import { GameAnalyticsInterface } from "./platform/game_analytics";
|
|
||||||
import { ShapezGameAnalytics } from "./platform/browser/game_analytics";
|
|
||||||
import { queryParamOptions } from "./core/query_parameters";
|
|
||||||
import { NoGameAnalytics } from "./platform/browser/no_game_analytics";
|
|
||||||
import { StorageImplBrowserIndexedDB } from "./platform/browser/storage_indexed_db";
|
|
||||||
import { SettingsState } from "./states/settings";
|
|
||||||
import { KeybindingsState } from "./states/keybindings";
|
|
||||||
import { AboutState } from "./states/about";
|
import { AboutState } from "./states/about";
|
||||||
import { PlatformWrapperImplElectron } from "./platform/electron/wrapper";
|
|
||||||
import { StorageImplElectron } from "./platform/electron/storage";
|
|
||||||
import { MobileWarningState } from "./states/mobile_warning";
|
|
||||||
import { ChangelogState } from "./states/changelog";
|
import { ChangelogState } from "./states/changelog";
|
||||||
|
import { InGameState } from "./states/ingame";
|
||||||
|
import { KeybindingsState } from "./states/keybindings";
|
||||||
|
import { MainMenuState } from "./states/main_menu";
|
||||||
|
import { MobileWarningState } from "./states/mobile_warning";
|
||||||
|
import { PreloadState } from "./states/preload";
|
||||||
|
import { SettingsState } from "./states/settings";
|
||||||
|
|
||||||
const logger = createLogger("application");
|
const logger = createLogger("application");
|
||||||
|
|
||||||
|
@ -3,12 +3,13 @@ export const CHANGELOG = [
|
|||||||
version: "1.1.0",
|
version: "1.1.0",
|
||||||
date: "unreleased",
|
date: "unreleased",
|
||||||
entries: [
|
entries: [
|
||||||
"Allow changing all keybindings, including CTRL, ALT and SHIFT",
|
|
||||||
"Allow holding SHIFT to rotate counter clockwise",
|
"Allow holding SHIFT to rotate counter clockwise",
|
||||||
|
"Allow changing all keybindings, including CTRL, ALT and SHIFT (by Dimava)",
|
||||||
"Added confirmation when deleting more than 500 buildings at a time",
|
"Added confirmation when deleting more than 500 buildings at a time",
|
||||||
"Added background to toolbar to increase contrast",
|
"Added background to toolbar to increase contrast",
|
||||||
"Allow placing extractors anywhere again, but they don't work at all if not placed on a resource",
|
"Allow placing extractors anywhere again, but they don't work at all if not placed on a resource",
|
||||||
"Fix cycling through keybindings selecting locked buildings as well",
|
"Fix cycling through keybindings selecting locked buildings as well (by Dimava)",
|
||||||
|
"There is now a github action, checking all pull requests with eslint. (by mrHedgehog)",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -131,21 +131,21 @@ export class ReadWriteProxy {
|
|||||||
}
|
}
|
||||||
const jsonString = JSON_stringify(compressObject(this.currentData));
|
const jsonString = JSON_stringify(compressObject(this.currentData));
|
||||||
|
|
||||||
if (!this.app.pageVisible || this.app.unloaded) {
|
// if (!this.app.pageVisible || this.app.unloaded) {
|
||||||
logger.log("Saving file sync because in unload handler");
|
// logger.log("Saving file sync because in unload handler");
|
||||||
const checksum = sha1(jsonString + salt);
|
// const checksum = sha1(jsonString + salt);
|
||||||
let compressed = compressionPrefix + compressX64(checksum + jsonString);
|
// let compressed = compressionPrefix + compressX64(checksum + jsonString);
|
||||||
if (G_IS_DEV && IS_DEBUG) {
|
// if (G_IS_DEV && IS_DEBUG) {
|
||||||
compressed = jsonString;
|
// compressed = jsonString;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!this.app.storage.writeFileSyncIfSupported(this.filename, compressed)) {
|
// if (!this.app.storage.writeFileSyncIfSupported(this.filename, compressed)) {
|
||||||
return Promise.reject("Failed to write " + this.filename + " sync!");
|
// return Promise.reject("Failed to write " + this.filename + " sync!");
|
||||||
} else {
|
// } else {
|
||||||
logger.log("📄 Wrote (sync!)", this.filename);
|
// logger.log("📄 Wrote (sync!)", this.filename);
|
||||||
return Promise.resolve(compressed);
|
// return Promise.resolve(compressed);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
return asyncCompressor
|
return asyncCompressor
|
||||||
.compressFileAsync(jsonString)
|
.compressFileAsync(jsonString)
|
||||||
|
@ -10,14 +10,13 @@ import {
|
|||||||
import { clickDetectorGlobals } from "../core/click_detector";
|
import { clickDetectorGlobals } from "../core/click_detector";
|
||||||
import { globalConfig } from "../core/config";
|
import { globalConfig } from "../core/config";
|
||||||
import { createLogger } from "../core/logging";
|
import { createLogger } from "../core/logging";
|
||||||
import { queryParamOptions } from "../core/query_parameters";
|
|
||||||
import { Rectangle } from "../core/rectangle";
|
import { Rectangle } from "../core/rectangle";
|
||||||
import { Signal, STOP_PROPAGATION } from "../core/signal";
|
import { Signal, STOP_PROPAGATION } from "../core/signal";
|
||||||
import { clamp } from "../core/utils";
|
import { clamp } from "../core/utils";
|
||||||
import { mixVector, Vector } from "../core/vector";
|
import { mixVector, Vector } from "../core/vector";
|
||||||
import { BasicSerializableObject, types } from "../savegame/serialization";
|
import { BasicSerializableObject, types } from "../savegame/serialization";
|
||||||
import { GameRoot } from "./root";
|
|
||||||
import { KEYMAPPINGS } from "./key_action_mapper";
|
import { KEYMAPPINGS } from "./key_action_mapper";
|
||||||
|
import { GameRoot } from "./root";
|
||||||
|
|
||||||
const logger = createLogger("camera");
|
const logger = createLogger("camera");
|
||||||
|
|
||||||
|
@ -95,18 +95,18 @@ export class InGameState extends GameState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onBeforeExit() {
|
onBeforeExit() {
|
||||||
logger.log("Saving before quitting");
|
// logger.log("Saving before quitting");
|
||||||
return this.doSave().then(() => {
|
// return this.doSave().then(() => {
|
||||||
logger.log(this, "Successfully saved");
|
// logger.log(this, "Successfully saved");
|
||||||
// this.stageDestroyed();
|
// // this.stageDestroyed();
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
onAppPause() {
|
onAppPause() {
|
||||||
if (this.stage === stages.s10_gameRunning) {
|
// if (this.stage === stages.s10_gameRunning) {
|
||||||
logger.log("Saving because app got paused");
|
// logger.log("Saving because app got paused");
|
||||||
this.doSave();
|
// this.doSave();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
getHasFadeIn() {
|
getHasFadeIn() {
|
||||||
|
@ -522,7 +522,7 @@ keybindings:
|
|||||||
general: Application
|
general: Application
|
||||||
ingame: Game
|
ingame: Game
|
||||||
placement: Placement
|
placement: Placement
|
||||||
massSelect: Mass Delete
|
massSelect: Mass Select
|
||||||
buildings: Building Shortcuts
|
buildings: Building Shortcuts
|
||||||
placementModifiers: Placement Modifiers
|
placementModifiers: Placement Modifiers
|
||||||
|
|
||||||
@ -565,6 +565,7 @@ keybindings:
|
|||||||
|
|
||||||
massSelectStart: Hold and drag to start
|
massSelectStart: Hold and drag to start
|
||||||
massSelectSelectMultiple: Select multiple areas
|
massSelectSelectMultiple: Select multiple areas
|
||||||
|
massSelectCopy: Copy area
|
||||||
|
|
||||||
placementDisableAutoOrientation: Disable automatic orientation
|
placementDisableAutoOrientation: Disable automatic orientation
|
||||||
placeMultiple: Stay in placement mode
|
placeMultiple: Stay in placement mode
|
||||||
|
Loading…
Reference in New Issue
Block a user