first commit

This commit is contained in:
2026-03-30 09:39:59 +08:00
parent 6c52425fca
commit 5ac73d3c6d
4484 changed files with 1144395 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
interface LabelConfigType {
[key: string]: string[];
}
export const LabelConfig : LabelConfigType = {
"自动游戏B": ["自动游戏", "AUTO PLAY"],
"剩余次数B:": ["剩余次数:", "REMAINING TIMES:"],
"数据错误": ["数据错误", "Data error"],
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "2ef0d99e-c12a-4894-a23f-cb0267a1ad5c",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,20 @@
export enum LangType {
ZH = 0,
EN = 1,
}
export const LANG_STRING = {
"zh" : LangType.ZH,
"en" : LangType.EN
};
export const LANG_ENUM = {
0 : "zh",
1 : "en"
};
export class LangSet {
public langIndex : LangType = LangType.EN;
}
export const LANG_SET = new LangSet();

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "d950b1eb-aff9-4280-822f-fcce09077313",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,34 @@
/** 服务区域 */
export const enum SERVER_EREA {
// 一级棒横版
ZP = 0,
}
/** 当前服务区域配置(根据打包修改) */
export const NOW_SERVER_EREA : SERVER_EREA = SERVER_EREA.ZP;
// 默认地址
const DEFAULT_URL = "https://dice-api.yuliao666.top"
/** 通用版本 */
const DEFAULT_VERSION = "1.0.5"
/** 测试服版本号 */
const DEFAULT_TEST_VERSION = "1.0.0"
/** 区域打包配置文件 */
const SERVER_CONFIG = {
// 横版一级棒
[0] : {
"server" : DEFAULT_URL,
"site_id" : "ba5ea4dc-75bb-438d-8a3a-b8031ef89426",
"ver" : DEFAULT_TEST_VERSION,
"area" : "86",
}
}
/** 服务器地址 */
export const SERVER_LIST = SERVER_CONFIG[NOW_SERVER_EREA]["server"];
/** Site ID */
export const HTTP_SITE_ID = SERVER_CONFIG[NOW_SERVER_EREA]["site_id"];
/** 当前版本号 */
export const GAME_VER = SERVER_CONFIG[NOW_SERVER_EREA]["ver"];
/** 国家电话区号 */
export const COUNTRY_CODE = SERVER_CONFIG[NOW_SERVER_EREA]["area"];

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "29ef329c-fd90-4d8a-a91a-95ab0b17eace",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,34 @@
import { _decorator, Component, Label, Sprite, SpriteFrame } from "cc";
import { app } from "../../app/app";
import { Tools } from "../tools/Tools";
import { LANG_SET } from "./LangSet";
const { ccclass, property } = _decorator;
@ccclass('SwitchLang')
export class SwitchLang extends Component {
@property(String) lab_lang: string = "";
@property(SpriteFrame) spr_lang : SpriteFrame[] = [];
protected onLoad(): void {
this.updateLab();
app.manager.event.on("LangChanged", this.updateLab, this);
}
protected onDestroy(): void {
app?.manager.event?.off("LangChanged", this.updateLab, this);
}
updateLab(){
let lab = this.getComponent(Label)
if (lab != null) {
this.getComponent(Label).string = Tools.GetLocalized(this.lab_lang)
};
let sprite = this.getComponent(Sprite)
if (sprite != null) {
if (this.spr_lang && this.spr_lang[LANG_SET.langIndex])
this.getComponent(Sprite).spriteFrame = this.spr_lang[LANG_SET.langIndex]
};
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "62eb7e15-ddf5-4380-98b5-f9ab11085deb",
"files": [],
"subMetas": {},
"userData": {}
}