Menu modal WIP, new settigns

This commit is contained in:
Martin
2022-12-16 11:49:52 +01:00
parent 44d6ba6fc7
commit 40ebf267e0
32 changed files with 2519 additions and 607 deletions

View File

@@ -0,0 +1,10 @@
import { ModalWindowManager } from "../../Services/ModalWindowSystem/ModalWindowManager";
import { MenuModalWindowTypes } from "./MenuModalWindowTypes";
export class MenuModalLauncher {
public constructor(private modalWindowManager: ModalWindowManager) {}
public async openUpgradesWindow(): Promise<void> {
await this.modalWindowManager.showModal(MenuModalWindowTypes.Upgrades, {});
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "fc6227d2-7b1d-49f3-85a2-abdb82e1638b",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,3 @@
export enum MenuModalWindowTypes {
Upgrades = "UpgradesModalWindow"
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "5c0f41ea-f404-452a-b17b-0ecdfd0a5f71",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "332aac81-54d3-4914-bc63-2efdecaef4b2",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@@ -0,0 +1,20 @@
import { Component, instantiate, Label, Node, Prefab, _decorator } from "cc";
const { ccclass, property } = _decorator;
@ccclass("UpgradeUI")
export class UpgradeUI extends Component {
@property(Prefab) private levelPointPrefab: Prefab;
@property(Node) private levelPointsParent: Node;
@property(Label) private title: Label;
@property(Label) private description: Label;
public init(titleText: string, descriptionText: string, levels: number): void {
for (let i = 0; i < levels; i++) {
const node: Node = instantiate(this.levelPointPrefab);
node.setParent(this.levelPointsParent);
}
this.title.string = titleText;
this.description.string = descriptionText;
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "76edae8c-16ba-482d-91fd-2833991475ac",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,21 @@
import { instantiate, Prefab, _decorator, Node } from "cc";
import { ModalWindow } from "../../../Services/ModalWindowSystem/ModalWindow";
import { UpgradeUI } from "./UpgradeUI";
const { ccclass, property } = _decorator;
@ccclass("UpgradesModalWindow")
export class UpgradesModalWindow extends ModalWindow<Empty, Empty> {
@property(Prefab) upgradeButtonPrefab: Prefab;
@property(Node) upgradeButtonParent: Node;
public setup(params: Empty): void {
for (let index = 0; index < 6; index++) {
const upgradeButton: Node = instantiate(this.upgradeButtonPrefab);
upgradeButton.getComponent(UpgradeUI).init("Title", "Description", 5);
upgradeButton.setParent(this.upgradeButtonParent);
}
}
}
export class Empty {}

View File

@@ -0,0 +1 @@
{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"854a4b66-9084-4ecd-814f-0300f12f7ff3","files":[],"subMetas":{},"userData":{}}