Commit 6af08fa7 authored by haiyoucuv's avatar haiyoucuv

init

parent 091d49db
......@@ -7,7 +7,7 @@ import { RoleCarColorsSysterm } from './Systerms/RoleCarColorsSysterm';
import { GlobalData, ConfigKeys } from '../../ScriptFrame/GlobalData';
import { CarCarColorsSysterm } from './Systerms/CarCarColorsSysterm';
import { AudioManager } from '../../ScriptFrame/Frame/AudioManager';
import Scene from "db://assets/Module/Scene";
import Scene from "db://assets/core/Module/Scene";
const { ccclass, property } = _decorator;
@ccclass('CarColorsGameEntry')
......
......@@ -4,7 +4,7 @@ import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { UINames } from '../CarColorsGlobalTypes';
import { ConfigKeys, GlobalData } from '../../../ScriptFrame/GlobalData';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/Module/UIFast";
import { showToast } from "db://assets/core/Module/UIFast";
const { ccclass, property } = _decorator;
@ccclass('FailPage')
......
......@@ -6,7 +6,7 @@ import { CarColors, UINames } from '../CarColorsGlobalTypes';
import { GlobalData, ConfigKeys } from '../../../ScriptFrame/GlobalData';
import { PlatformManager } from '../../../ScriptFrame/Frame/platformManager';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/Module/UIFast";
import { showToast } from "db://assets/core/Module/UIFast";
const { ccclass, property } = _decorator;
@ccclass('GamePage')
......
......@@ -4,7 +4,7 @@ import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { UINames } from '../CarColorsGlobalTypes';
import { GlobalData, ConfigKeys } from '../../../ScriptFrame/GlobalData';
import { AudioClipNames, AudioManager } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/Module/UIFast";
import { showToast } from "db://assets/core/Module/UIFast";
const { ccclass, property } = _decorator;
@ccclass('HomePage')
......
......@@ -4,7 +4,7 @@ import { UINames } from '../CarColorsGlobalTypes';
import { UIBase } from '../Components/UIBase';
import { PlatformManager } from '../../../ScriptFrame/Frame/platformManager';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/Module/UIFast";
import { showToast } from "db://assets/core/Module/UIFast";
const { ccclass, property } = _decorator;
@ccclass('RefreshPage')
......
......@@ -4,7 +4,7 @@ import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { UINames } from '../CarColorsGlobalTypes';
import { PlatformManager } from '../../../ScriptFrame/Frame/platformManager';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/Module/UIFast";
import { showToast } from "db://assets/core/Module/UIFast";
const { ccclass, property } = _decorator;
@ccclass('RevivePage')
......
......@@ -4,7 +4,7 @@ import { UINames } from '../CarColorsGlobalTypes';
import { UIBase } from '../Components/UIBase';
import { PlatformManager } from '../../../ScriptFrame/Frame/platformManager';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/Module/UIFast";
import { showToast } from "db://assets/core/Module/UIFast";
const { ccclass, property } = _decorator;
@ccclass('SortPage')
......
......@@ -4,7 +4,7 @@ import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { UINames } from '../CarColorsGlobalTypes';
import { ConfigKeys, GlobalData } from '../../../ScriptFrame/GlobalData';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/Module/UIFast";
import { showToast } from "db://assets/core/Module/UIFast";
const { ccclass, property } = _decorator;
@ccclass('StopPage')
......
......@@ -4,7 +4,7 @@ import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { UINames } from '../CarColorsGlobalTypes';
import { GlobalData, ConfigKeys } from '../../../ScriptFrame/GlobalData';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/Module/UIFast";
import { showToast } from "db://assets/core/Module/UIFast";
const { ccclass, property } = _decorator;
@ccclass('SuccessPage')
......
......@@ -5,7 +5,7 @@ import { UIBase } from '../Components/UIBase';
import { PlatformManager } from '../../../ScriptFrame/Frame/platformManager';
import { GamePage } from './GamePage';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/Module/UIFast";
import { showToast } from "db://assets/core/Module/UIFast";
const { ccclass, property } = _decorator;
@ccclass('VipPage')
......
......@@ -2,7 +2,7 @@ import { game, native, sys } from "cc";
import { GlobalData } from "../GlobalData";
import { EDITOR, PREVIEW } from "cc/env";
import { CarColorsGlobalInstance } from "../../CarColorsGame/Scrips/CarColorsGlobalInstance";
import { showToast } from "db://assets/Module/UIFast";
import { showToast } from "db://assets/core/Module/UIFast";
export class PlatformManager {
......
import Panel from "../../Module/Panel";
import Panel from "../../core/Module/Panel";
import { _decorator, Button, game, Node } from "cc";
import store from "../store/store";
import { observer, render } from "../store/decorators";
......
import { _decorator, Button, Node } from "cc";
import Scene from "db://assets/Module/Scene";
import { changeScene, hideWaiting, showPanel, showWaiting } from "db://assets/Module/UIFast";
import Scene from "db://assets/core/Module/Scene";
import { changeScene, hideWaiting, showPanel, showWaiting } from "db://assets/core/Module/UIFast";
import store from "../store/store";
import { observer, render } from "../store/decorators";
import { _asyncThrottle } from "../Utils/Utils";
import { UIMgr } from "../../Module/UIMgr";
import { CarColorsGameEntry } from "db://assets/CarColorsGame/Scrips/CarColorsGameEntry";
const { ccclass, property } = _decorator;
......
import { assetManager, director, ImageAsset, Node, SpriteFrame, Texture2D, tween, UITransform } from "cc";
import Svga from "db://assets/Component/Svga/Svga";
import Svga from "db://assets/core/Component/Svga/Svga";
/**
* 添加url的协议头
......
import { jsonp } from "./web/jsonp";
import { getUrlParams } from "./web/webTools";
import { showToast } from "../../../Module/UIFast";
import { showToast } from "../../../core/Module/UIFast";
import { PREVIEW } from 'cc/env';
import JSON5 from "json5";
......@@ -75,13 +75,13 @@ export enum WebNetName {
queryExchange = "exchange_1/listExchangeLimit.do",
// 兑换接口
doExchange = "exchange_1/doExchange.do",
// 青果兑换
doGreenExchange = "task_1/greenExchange.do",
// 体力值兑换
powerExchange = "coin/exEnergy.do",
/**
* 签到
*/
......
......@@ -8,7 +8,7 @@ import {
showPanel,
showToast,
showWaiting
} from "../../Module/UIFast";
} from "../../core/Module/UIFast";
import store, { IHomeInfo } from "./store";
import { prefixInteger } from "../Utils/Utils";
import { NetTime } from "../NetTime";
......
......@@ -3,7 +3,7 @@ import { assetManager, ImageAsset, SpriteFrame, Texture2D } from "cc";
import { getUrlParams } from "../Utils/WebNet/web/webTools";
import { sendWebNet, WebNetName } from "../Utils/WebNet/WebNet";
import store from "./store";
import {showShareGuide, showToast} from "../../Module/UIFast";
import {showShareGuide, showToast} from "../../core/Module/UIFast";
const { makeAutoObservable } = mobx;
......@@ -97,4 +97,4 @@ class ShareStore {
const shareStore: ShareStore = makeAutoObservable(new ShareStore());
export default shareStore;
\ No newline at end of file
export default shareStore;
import mobx from "mobx";
import { sendWebNet, sendWebNetWithToken, WebNetName } from "../Utils/WebNet/WebNet";
import { showPanel, showToast } from "../../Module/UIFast";
import { showPanel, showToast } from "../../core/Module/UIFast";
import { getUrlParams } from "../Utils/WebNet/web/webTools";
import { AESDecrypt } from "../Utils/Crypto";
import { PREVIEW } from "cc/env";
......@@ -289,11 +289,11 @@ class Store {
setRankPopInfo(rankInfo){
this.rankPopInfo.settlementPop = rankInfo;
// console.log("setRankPopInfo",this.rankPopInfo);
}
}
const store: Store = makeAutoObservable(new Store());
export default store;
\ No newline at end of file
export default store;
import { _decorator, Component, Label, lerp, Prefab, ProgressBar, } from "cc";
import { PREVIEW } from "cc/env";
import { UIMgr } from "../Module/UIMgr";
import { changeScene } from "db://assets/Module/UIFast";
import { MusicBtn } from "../Component/MusicBtn/MusicBtn";
import { UIMgr } from "../core/Module/UIMgr";
import { changeScene } from "db://assets/core/Module/UIFast";
import { MusicBtn } from "../core/Component/MusicBtn/MusicBtn";
import ZipLoader from "./ZipLoader";
import store from "../Scripts/store/store";
import { getPreLoadList, preload } from "../Scripts/Utils/LoaderTools";
import { AudioMgr } from "../core_tgx/base/AudioMgr";
import { AudioMgr } from "../core/base/AudioMgr";
import { LOG_TYPE, sendLog } from "../Scripts/Utils/WebNet/WebNet";
import shareStore from "../Scripts/store/shareStore";
import { HomeScene } from "db://assets/Scripts/Scenes/HomeScene";
......
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "cae9a971-05ca-4f51-98da-0ece38f2e6c1",
"files": [],
"subMetas": {},
"userData": {}
}
......@@ -2,7 +2,7 @@
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "7e510966-c2ba-4c75-9d15-09c591fe0481",
"uuid": "ec76414f-12d0-43d2-b6de-aff6532a52a1",
"files": [],
"subMetas": {},
"userData": {}
......
import { _decorator, Button, Component, Node, Sprite, SpriteFrame } from 'cc';
import { AudioMgr } from "../../core_tgx/base/AudioMgr";
import { AudioMgr } from "../../base/AudioMgr";
const {ccclass, property, requireComponent} = _decorator;
......
import { _decorator, easing, Node, tween, v3 } from "cc";
import Module from "db://assets/Module/Module";
import { hidePanel } from "db://assets/Module/UIFast";
import Module from "./Module";
import { hidePanel } from "./UIFast";
import { loadAllObject } from "db://assets/Scripts/Utils/Utils";
import { UIMgr } from "./UIMgr";
......@@ -40,7 +40,7 @@ export default class Panel extends Module {
// parent.getComponent(PanelCtrl)?.hide();
// parent.getComponent(TopCtrl)?.hide();
}
hideAllPanel() {
this.node.emit('close-panel');
UIMgr.ins.hideAllPanel();
......
import { _decorator } from "cc";
import Module from "db://assets/Module/Module";
import { UILayer } from "db://assets/Module/UILayer";
import Module from "./Module";
import { UILayer } from "./UILayer";
const {ccclass, property} = _decorator;
......@@ -8,5 +8,5 @@ const {ccclass, property} = _decorator;
export default class Scene extends Module {
// @property(UILayer)
// uiLayer: UILayer = null;
}
import { UIMgr } from "db://assets/Module/UIMgr";
import Scene from "db://assets/Module/Scene";
import { UIMgr } from "./UIMgr";
import Scene from "./Scene";
export async function changeScene(cls: typeof Scene, data?: any) {
await UIMgr.ins.changeScene(cls, data);
......
......@@ -12,9 +12,9 @@ import {
UITransform,
Widget
} from "cc";
import Scene from "db://assets/Module/Scene";
import Panel from "db://assets/Module/Panel";
import RES from "db://assets/Module/RES";
import Scene from "./Scene";
import Panel from "./Panel";
import RES from "./RES";
export class UIMgr {
......
......@@ -2,7 +2,7 @@
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "7aebb67a-53c0-42ae-965a-bdbe30277e3f",
"uuid": "36279232-b2a3-4f86-b10b-36c68130a377",
"files": [],
"subMetas": {},
"userData": {}
......
//AudioMgr.ts
import { Node, AudioSource, AudioClip, resources, director, assetManager } from 'cc';
......@@ -157,4 +156,4 @@ export class AudioMgr {
resume() {
this._audioSource.play();
}
}
\ No newline at end of file
}
......@@ -2,7 +2,7 @@
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "d506f08a-1247-4c63-baa4-759594ea27aa",
"uuid": "fa6e281f-1d99-47fb-9f32-37983ff77510",
"files": [],
"subMetas": {},
"userData": {}
......
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "c7398400-3038-4203-9f2a-34001361a00f",
"files": [],
"subMetas": {},
"userData": {}
}
export class InputMgr{
private STATE_NORMAL = 1;
private STATE_KEEP = 2;
private static _inst:InputMgr = null;
private _flags = {};
private _flagsMeta = {};
public static get inst():InputMgr{
if(!this._inst){
this._inst = new InputMgr();
}
return this._inst;
}
public setFlag(flag:string,keep?:boolean,meta?:any){
this._flags[flag] = keep? this.STATE_KEEP:this.STATE_NORMAL;
if(meta != null){
this._flagsMeta[flag] = meta;
}
}
public removeFlag(flag:string){
delete this._flags[flag];
}
public hasFlag(flag:string):boolean{
return !!this._flags[flag];
}
public getMetaByFlag(flag:string):any{
return this._flagsMeta[flag];
}
public update(){
for(let k in this._flags){
if(this._flags[k] != this.STATE_KEEP){
this._flags[k] = 0;
}
}
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "8fac4981-1bc9-4fa3-9c41-df044d19386c",
"files": [],
"subMetas": {},
"userData": {
"moduleId": "project:///assets/scripts/qfw/InputMgr.js",
"importerSettings": 0,
"simulateGlobals": []
}
}
const PROP_MODULE = '__module__name__';
const PROP_IMPL_CLASS = '__impl__class__';
let defaultModule = 'resources';
export class ModuleContext {
public static setDefaultModule(moduleName) {
defaultModule = moduleName;
}
public static getDefaultModule(){
return defaultModule;
}
public static attachModule(cls, moduleName) {
cls[PROP_MODULE] = moduleName;
}
public static getClassModule(cls) {
return cls[PROP_MODULE] || defaultModule;
}
public static attachImplClass(cls, implCls) {
cls[PROP_IMPL_CLASS] = implCls;
}
public static attachModuleAndImplClass(cls, moduleName, implCls) {
cls[PROP_MODULE] = moduleName;
cls[PROP_IMPL_CLASS] = implCls;
}
public static getImplClass(cls) {
return cls[PROP_IMPL_CLASS] || cls;
}
public static createFromModule(cls) {
let implCls = this.getImplClass(cls) || cls;
return new implCls();
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "5575add5-5764-43ef-8ea1-8b5394d57b23",
"files": [],
"subMetas": {},
"userData": {}
}
import { _decorator, Component, view, screen, Size, size, ResolutionPolicy } from 'cc';
const { ccclass, property } = _decorator;
const CHECK_INTERVAL = 0.1;
@ccclass('tgxResolutionAutoFit')
export class ResolutionAutoFit extends Component {
private _oldSize:Size = size();
start() {
this.adjustResolutionPolicy();
}
private lastCheckTime = 0;
update(deltaTime: number) {
this.lastCheckTime+=deltaTime;
if(this.lastCheckTime < CHECK_INTERVAL){
return;
}
this.lastCheckTime = 0;
this.adjustResolutionPolicy();
}
adjustResolutionPolicy(){
let winSize = screen.windowSize;
if(!this._oldSize.equals(winSize)){
let ratio = winSize.width / winSize.height;
let drs = view.getDesignResolutionSize();
let drsRatio = drs.width / drs.height;
if(ratio > drsRatio){
//wider than desgin. fixed height
view.setResolutionPolicy(ResolutionPolicy.FIXED_HEIGHT);
}
else{
//
view.setResolutionPolicy(ResolutionPolicy.FIXED_WIDTH);
}
this._oldSize.set(winSize);
}
}
}
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "e5d8a223-5fd3-4ede-8c77-28c5930dbb00",
"files": [],
"subMetas": {},
"userData": {}
}
import { loader, Constructor, resources, Asset } from "cc";
class ResItem {
public url: string;
public isLoading = false;
public callbackArr = [];
}
export class ResourceMgr {
private static _inst: ResourceMgr = null;
public static get inst(): ResourceMgr {
if (!this._inst) {
this._inst = new ResourceMgr();
}
return this._inst;
}
private loadingQueue:[] = [];
public loadRes<T>(url: string, type: any, callback: (err, assets: T) => void) {
let cache = resources.get(url,type) as any;
if(cache){
if(callback){
setTimeout(()=>{
callback(null,cache);
},10);
}
return;
}
let loadingItem:ResItem = this.loadingQueue[url];
if(!loadingItem){
loadingItem = this.loadingQueue[url] = new ResItem();
loadingItem.url = url;
}
loadingItem.callbackArr.push(callback);
if(!loadingItem.isLoading){
loadingItem.isLoading = true;
resources.load(url, type, (err,asset:Asset)=>{
delete this.loadingQueue[url];
for(let k in loadingItem.callbackArr){
let cb = loadingItem.callbackArr[k];
if(cb){
cb(err,asset);
}
}
});
}
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "b666c2cf-c69b-456e-adc2-73d54d34f216",
"files": [],
"subMetas": {},
"userData": {
"moduleId": "project:///assets/scripts/qfw/ResourceMgr.js",
"importerSettings": 0,
"simulateGlobals": []
}
}
/**
* @en call JSON mthods safely.
* @zh 用于安全操作JSON相关函数
* */
export class SafeJSON {
public static parse(text: string, reciver?: (key: any, value: any) => any): any {
try {
return JSON.parse(text, reciver);
} catch (error) {
console.log(error);
return null;
}
}
public static stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number) {
try {
return JSON.stringify(value, replacer, space);
} catch (error) {
return '';
}
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "2aad897f-5b30-4f4c-886b-d56e9207d3ed",
"files": [],
"subMetas": {},
"userData": {
"moduleId": "project:///assets/scripts/qfw/SafeJSON.js",
"importerSettings": 0,
"simulateGlobals": []
}
}
import { assetManager, director, AssetManager } from "cc";
export interface ISceneInfo {
name: string;
bundle?: string;
}
export class SceneUtil {
static async reloadScene(){
return new Promise((resolve, reject) => {
director.loadScene(director.getScene().name,()=>{
resolve(true);
});
});
}
static async loadScene(scene: ISceneInfo) {
return new Promise((resolve, reject) => {
let bundle = assetManager.getBundle(scene.bundle);
if (bundle) {
director.loadScene(scene.name, () => {
resolve(true);
});
}
else {
assetManager.loadBundle(scene.bundle, (err, bundle: AssetManager.Bundle) => {
if (bundle) {
director.loadScene(scene.name, () => {
resolve(true);
});
}
})
}
});
}
}
\ No newline at end of file
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "a97b967d-fe2c-4dde-8d45-2d5a86a5f13d",
"files": [],
"subMetas": {},
"userData": {}
}
function urlParse() {
var params = {};
if (!window.location) {
return params;
}
var name, value;
var str = window.location.href; //取得整个地址栏
var num = str.indexOf("?")
str = str.substring(num + 1); //取得所有参数 stringvar.substr(start [, length ]
var arr = str.split("&"); //各个参数放到数组里
for (var i = 0; i < arr.length; i++) {
num = arr[i].indexOf("=");
if (num > 0) {
name = arr[i].substring(0, num);
value = arr[i].substr(num + 1);
params[name] = value;
}
}
return params;
}
export { urlParse };
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment