Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/webgal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"react-redux": "^8.0.1",
"sass": "^1.49.9",
"uuid": "^9.0.0",
"vconsole": "^3.15.1",
"vite-plugin-package-version": "^1.0.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ export const infoFetcher = (url: string) => {
const appId = String(res);
WebGAL.steam.initialize(appId);
}
if (command === 'Show_Console') {
if (res === true) {
WebGAL.vconsole?.show();
} else {
WebGAL.vconsole?.hide();
}
Comment thread
xiaoxustudio marked this conversation as resolved.
}
}
}
});
Expand Down
15 changes: 14 additions & 1 deletion packages/webgal/src/Core/webgalCore.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
import { BacklogManager } from '@/Core/Modules/backlog';
import mitt from 'mitt';
import VConsole from 'vconsole';
import { SceneManager } from '@/Core/Modules/scene';
import { AnimationManager } from '@/Core/Modules/animations';
import { Gameplay } from './Modules/gamePlay';
import { Events } from '@/Core/Modules/events';
import { SteamIntegration } from '@/Core/integration/steamIntegration';
import { WebgalTemplate } from '@/types/template';
import { IWebGALStyleObj } from 'webgal-parser/build/types/styleParser';
import { IVConsole } from '@/types/vconsole';

const vconsole = {
instance: new VConsole({ target: 'body' }),
show() {
(document.querySelector('#__vconsole') as HTMLDivElement).style.display = 'block';
},
hide() {
(document.querySelector('#__vconsole') as HTMLDivElement).style.display = 'none';
},
};
vconsole.hide();
Comment thread
xiaoxustudio marked this conversation as resolved.

export class WebgalCore {
public sceneManager = new SceneManager();
Expand All @@ -19,4 +31,5 @@ export class WebgalCore {
public steam = new SteamIntegration();
public template: WebgalTemplate | null = null;
public styleObjects: Map<string, IWebGALStyleObj> = new Map();
public vconsole: IVConsole = vconsole;
}
7 changes: 7 additions & 0 deletions packages/webgal/src/types/vconsole.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import VConsole from 'vconsole';

export interface IVConsole {
instance: VConsole;
show: () => void;
hide: () => void;
}
30 changes: 30 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@
dependencies:
regenerator-runtime "^0.14.0"

"@babel/runtime@^7.17.2":
version "7.29.2"
resolved "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.29.2.tgz#9a6e2d05f4b6692e1801cd4fb176ad823930ed5e"
integrity sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==

"@babel/template@^7.22.15", "@babel/template@^7.24.0":
version "7.24.0"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.0.tgz#c6a524aa93a4a05d66aaf31654258fae69d87d50"
Expand Down Expand Up @@ -2029,6 +2034,16 @@ cookie@0.6.0:
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051"
integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==

copy-text-to-clipboard@^3.0.1:
version "3.2.2"
resolved "https://registry.npmmirror.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.2.tgz#99bc79db3f2d355ec33a08d573aff6804491ddb9"
integrity sha512-T6SqyLd1iLuqPA90J5N4cTalrtovCySh58iiZDGJ6FGznbclKh4UI+FGacQSgFzwKG77W7XT5gwbVEbd9cIH1A==

core-js@^3.11.0:
version "3.49.0"
resolved "https://registry.npmmirror.com/core-js/-/core-js-3.49.0.tgz#8b4d520ac034311fa21aa616f017ada0e0dbbddd"
integrity sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==

core-util-is@~1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
Expand Down Expand Up @@ -4041,6 +4056,11 @@ multistream@^4.1.0:
once "^1.4.0"
readable-stream "^3.6.0"

mutation-observer@^1.0.3:
version "1.0.3"
resolved "https://registry.npmmirror.com/mutation-observer/-/mutation-observer-1.0.3.tgz#42e9222b101bca82e5ba9d5a7acf4a14c0f263d0"
integrity sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA==

nanoid@^3.3.7:
version "3.3.7"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8"
Expand Down Expand Up @@ -5717,6 +5737,16 @@ vary@~1.1.2:
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==

vconsole@^3.15.1:
version "3.15.1"
resolved "https://registry.npmmirror.com/vconsole/-/vconsole-3.15.1.tgz#569a8ab15f353259527bbcf004f02946b4482cff"
integrity sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==
dependencies:
"@babel/runtime" "^7.17.2"
copy-text-to-clipboard "^3.0.1"
core-js "^3.11.0"
mutation-observer "^1.0.3"

vite-node@0.28.5:
version "0.28.5"
resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.28.5.tgz#56d0f78846ea40fddf2e28390899df52a4738006"
Expand Down
Loading