From b32370080acc576ebbe60f3e5a683921331ea6cf Mon Sep 17 00:00:00 2001 From: CrazyH <87752773+CrazyH2@users.noreply.github.com> Date: Wed, 20 Mar 2024 08:36:59 +0000 Subject: [PATCH] update js code --- src/screens/main/SettingsMenu.js | 19 +++++++++++++++++++ src/screens/main/appsMenu.js | 19 +++++++++++++++++++ src/screens/main/mainMenu.js | 19 +++++++++++++++++++ src/screens/screen.js | 24 ++++++++++++++++++++++++ src/screens/screenManager.js | 23 +++++++++++++++++++++++ src/screens/start/actionsInfo.js | 19 +++++++++++++++++++ src/screens/start/controllerAlign.js | 19 +++++++++++++++++++ src/screens/start/controllerInfo.js | 19 +++++++++++++++++++ src/screens/start/hasController.js | 0 src/world/render.js | 3 +++ 10 files changed, 164 insertions(+) create mode 100644 src/screens/screen.js create mode 100644 src/screens/screenManager.js delete mode 100644 src/screens/start/hasController.js diff --git a/src/screens/main/SettingsMenu.js b/src/screens/main/SettingsMenu.js index e69de29..8d910c6 100644 --- a/src/screens/main/SettingsMenu.js +++ b/src/screens/main/SettingsMenu.js @@ -0,0 +1,19 @@ +/** + * @author crazyh / https://github.com/crazyh2 + */ + +import { Screen } from "../screen"; + +class SettingsMenu extends Screen { + constructor(root) { + super(root); + + this.root = root; + }; + + render(renderGroup) { + + }; +}; + +export { SettingsMenu }; \ No newline at end of file diff --git a/src/screens/main/appsMenu.js b/src/screens/main/appsMenu.js index e69de29..ac092b8 100644 --- a/src/screens/main/appsMenu.js +++ b/src/screens/main/appsMenu.js @@ -0,0 +1,19 @@ +/** + * @author crazyh / https://github.com/crazyh2 + */ + +import { Screen } from "../screen"; + +class AppsMenu extends Screen { + constructor(root) { + super(root); + + this.root = root; + }; + + render(renderGroup) { + + }; +}; + +export { AppsMenu }; \ No newline at end of file diff --git a/src/screens/main/mainMenu.js b/src/screens/main/mainMenu.js index e69de29..41297fe 100644 --- a/src/screens/main/mainMenu.js +++ b/src/screens/main/mainMenu.js @@ -0,0 +1,19 @@ +/** + * @author crazyh / https://github.com/crazyh2 + */ + +import { Screen } from "../screen"; + +class MainMenu extends Screen { + constructor(root) { + super(root); + + this.root = root; + }; + + render(renderGroup) { + + }; +}; + +export { MainMenu }; \ No newline at end of file diff --git a/src/screens/screen.js b/src/screens/screen.js new file mode 100644 index 0000000..96ab08b --- /dev/null +++ b/src/screens/screen.js @@ -0,0 +1,24 @@ +/** + * @author crazyh / https://github.com/crazyh2 + */ + +class Screen { + constructor(root) { + this.root = root; + this.renderGroup = new THREE.Group(); + }; + + render(renderGroup) { + + }; + + renderScreen(screen) { + this.root.renderScreen(screen); + }; + + getRender(root) { + return this.renderGroup; + }; +}; + +export { Screen }; \ No newline at end of file diff --git a/src/screens/screenManager.js b/src/screens/screenManager.js new file mode 100644 index 0000000..5a5a401 --- /dev/null +++ b/src/screens/screenManager.js @@ -0,0 +1,23 @@ +/** + * @author crazyh / https://github.com/crazyh2 + */ + +class ScreenManager { + constructor(root) { + this.root = root; + }; + + renderScreen(screenGroup) { + this.root.scene.scene.background = new THREE.Color(0x000000); + + screenGroup.render(screenGroup.renderGroup); + + this.root.scene.remove(screenGroup.renderGroup); + + this.screenGroup = screenGroup; + + this.root.scene.add(screenGroup.renderGroup); + }; +}; + +export { ScreenManager }; \ No newline at end of file diff --git a/src/screens/start/actionsInfo.js b/src/screens/start/actionsInfo.js index e69de29..c1e151f 100644 --- a/src/screens/start/actionsInfo.js +++ b/src/screens/start/actionsInfo.js @@ -0,0 +1,19 @@ +/** + * @author crazyh / https://github.com/crazyh2 + */ + +import { Screen } from "../screen"; + +class ActionsInfoScreen extends Screen { + constructor(root) { + super(root); + + this.root = root; + }; + + render(renderGroup) { + + }; +}; + +export { ActionsInfoScreen }; \ No newline at end of file diff --git a/src/screens/start/controllerAlign.js b/src/screens/start/controllerAlign.js index e69de29..404d2ce 100644 --- a/src/screens/start/controllerAlign.js +++ b/src/screens/start/controllerAlign.js @@ -0,0 +1,19 @@ +/** + * @author crazyh / https://github.com/crazyh2 + */ + +import { Screen } from "../screen"; + +class ControllerAlignScreen extends Screen { + constructor(root) { + super(root); + + this.root = root; + }; + + render(renderGroup) { + + }; +}; + +export { ControllerAlignScreen }; \ No newline at end of file diff --git a/src/screens/start/controllerInfo.js b/src/screens/start/controllerInfo.js index e69de29..87cff03 100644 --- a/src/screens/start/controllerInfo.js +++ b/src/screens/start/controllerInfo.js @@ -0,0 +1,19 @@ +/** + * @author crazyh / https://github.com/crazyh2 + */ + +import { Screen } from "../screen"; + +class ControllerInfoScreen extends Screen { + constructor(root) { + super(root); + + this.root = root; + }; + + render(renderGroup) { + + }; +}; + +export { ControllerInfoScreen }; \ No newline at end of file diff --git a/src/screens/start/hasController.js b/src/screens/start/hasController.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/world/render.js b/src/world/render.js index 8ef0a69..cf263ea 100644 --- a/src/world/render.js +++ b/src/world/render.js @@ -3,11 +3,14 @@ */ import { Scene } from "./scene.js"; +import { ScreenManager } from "./../screens/screenManager.js"; class Render { constructor(top) { this.top = top; this.render(); + + this.ScreenManager = new ScreenManager(this); }; render() {