diff --git a/.prettierignore b/.prettierignore index 4998941..9c9499d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,4 +8,5 @@ public/project/maps.js public/_server/**/*.js script/**/*.js public/editor.html -keyCodes.ts \ No newline at end of file +keyCodes.ts +src/core/main/setting.ts \ No newline at end of file diff --git a/components.d.ts b/components.d.ts index ef69510..1b525e2 100644 --- a/components.d.ts +++ b/components.d.ts @@ -10,7 +10,6 @@ declare module '@vue/runtime-core' { AButton: typeof import('ant-design-vue/es')['Button'] ADivider: typeof import('ant-design-vue/es')['Divider'] AInput: typeof import('ant-design-vue/es')['Input'] - AInputNumber: typeof import('ant-design-vue/es')['InputNumber'] AProgress: typeof import('ant-design-vue/es')['Progress'] ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] @@ -18,7 +17,6 @@ declare module '@vue/runtime-core' { ASwitch: typeof import('ant-design-vue/es')['Switch'] Box: typeof import('./src/components/box.vue')['default'] BoxAnimate: typeof import('./src/components/boxAnimate.vue')['default'] - Changable: typeof import('./src/components/changable.vue')['default'] Colomn: typeof import('./src/components/colomn.vue')['default'] EnemyOne: typeof import('./src/components/enemyOne.vue')['default'] Scroll: typeof import('./src/components/scroll.vue')['default'] diff --git a/public/libs/core.js b/public/libs/core.js index ad429a1..9119ca6 100644 --- a/public/libs/core.js +++ b/public/libs/core.js @@ -602,6 +602,7 @@ core.prototype._afterLoadResources = function (callback) { // if (core.plugin._afterLoadResources) core.plugin._afterLoadResources(); core.showStartAnimate(); + Mota.require('var', 'hook').emit('load'); if (callback) callback(); }; diff --git a/public/libs/events.js b/public/libs/events.js index d6a5ed7..526b58e 100644 --- a/public/libs/events.js +++ b/public/libs/events.js @@ -4421,24 +4421,31 @@ events.prototype._checkLvUp_check = function () { }; ////// 尝试使用道具 ////// -events.prototype.tryUseItem = function (itemId) { +events.prototype.tryUseItem = function (itemId, noRoute, callback) { if (itemId == 'book') { core.ui.closePanel(); - return core.openBook(false); + core.openBook(false); + callback(); + return; } if (itemId == 'fly') { core.ui.closePanel(); - return core.useFly(false); + core.useFly(false); + callback(); + return; } if (itemId == 'centerFly') { core.ui.closePanel(); - return core.ui._drawCenterFly(); + core.ui._drawCenterFly(); + callback(); + return; } if (core.canUseItem(itemId)) { core.ui.closePanel(); - core.useItem(itemId); + core.useItem(itemId, noRoute, callback); } else { core.playSound('操作失败'); core.drawTip('当前无法使用' + core.material.items[itemId].name, itemId); } + callback(); }; diff --git a/src/App.vue b/src/App.vue index 7db7cc4..77fcd0a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -48,6 +48,7 @@ function show(index: number) { position: fixed; overflow: visible; display: block; + font-size: 80%; font-family: 'normal'; } @@ -61,7 +62,6 @@ function show(index: number) { top: 0; position: fixed; background-color: #000b; - backdrop-filter: blur(5px); z-index: 1; } diff --git a/src/components/box.vue b/src/components/box.vue index 565b7df..01844f6 100644 --- a/src/components/box.vue +++ b/src/components/box.vue @@ -43,7 +43,7 @@ @@ -241,14 +263,16 @@ onMounted(() => { width: 100%; height: 100%; padding: 1vh 0; + font-size: v-bind(fontSize); } .status-item { - position: relative; + display: flex; + flex-direction: row; max-width: 17.5vw; font-size: 200%; width: 100%; - margin-bottom: 1vh; + margin-bottom: 14px; text-shadow: 3px 2px 3px #000, 0px 0px 3px #111; display: flex; flex-direction: row; @@ -266,6 +290,10 @@ onMounted(() => { margin-left: 10%; } +.status-value { + transform: translateY(2px); +} + #status-header { width: 100%; display: flex; diff --git a/src/ui/toolEditor.vue b/src/ui/toolEditor.vue index 2030876..03364b3 100644 --- a/src/ui/toolEditor.vue +++ b/src/ui/toolEditor.vue @@ -3,41 +3,64 @@ 返回
- -
-
- {{ item.id }} - 删除 -
-
+
+ +
-    - 新增工具栏 + {{ item.id }} + 删除
-
- +
+
+    + 新增工具栏 +
+
+ +
+
+
+ + +
+
+
+
- +
- -
+ +
(); +const scale = mainSetting.getValue('ui.toolbarScale', 100) / 100; + const list = CustomToolbar.list; const selected = ref(0); @@ -331,7 +357,13 @@ onUnmounted(() => { .tool-list-scroll { height: 100%; - width: 30%; + width: 100%; +} + +#tool-left { + flex-basis: 30%; + display: flex; + height: 100%; } #tool-list { @@ -478,7 +510,7 @@ onUnmounted(() => { height: 40%; display: flex; justify-content: center; - align-items: start; + align-items: flex-start; #tool-preview-container { width: 90%; @@ -491,9 +523,9 @@ onUnmounted(() => { .tool-preview-item { display: flex; - margin: 5px; - min-width: 50px; - height: 50px; + margin: v-bind('5 * scale + "px"'); + min-width: v-bind('50 * scale + "px"'); + height: v-bind('50 * scale + "px"'); background-color: #222; border: 1.5px solid #ddd8; justify-content: center; @@ -509,4 +541,45 @@ onUnmounted(() => { .divider { height: 100%; } + +@media screen and (max-width: 600px) { + #tool-editor { + padding-top: 15%; + flex-direction: column; + width: 100%; + height: 100%; + } + + #tool-left { + width: 100%; + flex-basis: 40%; + max-height: 40vh; + display: flex; + flex-direction: row; + + .tool-list-scroll { + height: 100%; + flex-basis: 50%; + } + + #tool-preview { + flex-basis: 50%; + height: 100%; + } + } + + #tool-info { + width: 100%; + flex-basis: 60%; + + #tool-detail { + height: 100%; + } + } + + .divider { + height: auto; + width: 100%; + } +} diff --git a/src/ui/toolbar.vue b/src/ui/toolbar.vue index 184e46a..eee84b9 100644 --- a/src/ui/toolbar.vue +++ b/src/ui/toolbar.vue @@ -28,6 +28,7 @@ import Box from '@/components/box.vue'; import { CustomToolbar } from '@/core/main/custom/toolbar'; import { GameUi } from '@/core/main/custom/ui'; +import { mainSetting } from '@/core/main/setting'; import { onUnmounted, reactive, watch } from 'vue'; interface BoxData { @@ -44,6 +45,7 @@ const props = defineProps<{ }>(); const bar = props.bar; +const scale = mainSetting.getValue('ui.toolbarScale', 100) / 100; const box = reactive({ x: bar.x, @@ -80,7 +82,7 @@ onUnmounted(() => {