feat: cleaned up mouse behaviour and saving
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { inject, type InjectionKey, ref } from 'vue';
|
||||
import { inject, type InjectionKey, ref } from "vue";
|
||||
|
||||
export type UITool =
|
||||
| "track-unit-type"
|
||||
@@ -6,9 +6,10 @@ export type UITool =
|
||||
| "sticking";
|
||||
|
||||
export function createAppStateStore() {
|
||||
const selectedTool = ref<UITool>('track-unit-type');
|
||||
const selectedTool = ref<UITool>("track-unit-type");
|
||||
const activeTrackUnitType = ref(0);
|
||||
const activeStickingType = ref(1);
|
||||
const unitMouseStart = ref<string | null>(null);
|
||||
const selectingUnits = ref(false);
|
||||
const deselectingUnits = ref(false);
|
||||
|
||||
@@ -18,13 +19,14 @@ export function createAppStateStore() {
|
||||
selectedTool,
|
||||
activeTrackUnitType,
|
||||
activeStickingType,
|
||||
unitMouseStart,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export type AppStateStore = ReturnType<typeof createAppStateStore>;
|
||||
|
||||
export const AppStateStoreKey = Symbol('AppStateStore') as InjectionKey<AppStateStore>;
|
||||
export const AppStateStoreKey = Symbol("AppStateStore") as InjectionKey<AppStateStore>;
|
||||
|
||||
export function useAppStateStore(): AppStateStore {
|
||||
return inject(AppStateStoreKey, createAppStateStore, true);
|
||||
|
||||
Reference in New Issue
Block a user