Compare commits

...

10 Commits

Author SHA1 Message Date
TJH
d2d2540de0 UI修改
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m14s
2026-07-01 15:32:40 +08:00
TJH
97b836b9df bug
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m13s
2026-06-29 17:16:49 +08:00
TJH
1f7dfcfffa 1
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m12s
2026-06-29 15:09:46 +08:00
TJH
d099caf374 缅甸泰语在某些系统下错位问题的修改
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m2s
2026-06-29 15:08:53 +08:00
TJH
deaaf21e3c 开始滚动前获取余额时,如果网络错误,添加错误后的处理
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m3s
2026-06-25 16:40:41 +08:00
TJH
10562f980c 购买按钮隐藏的逻辑修改
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m14s
2026-06-11 11:15:35 +08:00
TJH
ef4560fe8c 余额不足提示逻辑调整
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m16s
2026-06-11 10:18:49 +08:00
TJH
c62d2a1522 点击余额不足提示确认按钮时刷新玩家余额的显示
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m14s
2026-06-10 14:40:27 +08:00
TJH
09f7990e6d 余额刷新添加点击限制
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m16s
2026-06-10 09:55:32 +08:00
TJH
897f305ae3 余额不足时在客户端拦截,不经过spin接口
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m4s
2026-06-08 15:23:28 +08:00
15 changed files with 1562 additions and 1271 deletions

View File

@ -19,7 +19,9 @@ jobs:
echo "💡 The ${{ github.repository }} repository has been cloned to the runner." echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- name: npm i - name: npm i
run: | run: |
echo 'npm i'
npm i npm i
echo "✅ npm i done"
- name: build - name: build
run: | run: |
echo 'build' echo 'build'

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -12095,7 +12095,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 155.625, "width": 200,
"height": 75.6 "height": 75.6
}, },
"_anchorPoint": { "_anchorPoint": {
@ -12132,13 +12132,13 @@
"a": 255 "a": 255
}, },
"_string": "Transaction", "_string": "Transaction",
"_horizontalAlign": 0, "_horizontalAlign": 1,
"_verticalAlign": 1, "_verticalAlign": 1,
"_actualFontSize": 30, "_actualFontSize": 31,
"_fontSize": 30, "_fontSize": 30,
"_fontFamily": "Arial", "_fontFamily": "Arial",
"_lineHeight": 60, "_lineHeight": 60,
"_overflow": 0, "_overflow": 2,
"_enableWrapText": true, "_enableWrapText": true,
"_font": null, "_font": null,
"_isSystemFontUsed": true, "_isSystemFontUsed": true,

View File

@ -29,7 +29,9 @@ import { AutoSpinPanel } from "./game/AutoSpinPanel";
import { NodePoolManager } from "../../Loading/scripts/manager/NodePoolManager"; import { NodePoolManager } from "../../Loading/scripts/manager/NodePoolManager";
import { webView } from "./game/WebView"; import { webView } from "./game/WebView";
import { import {
callGameBalanceApi,
cash2gold, cash2gold,
getGameId,
getHistoryUrl, getHistoryUrl,
getOddsUrl, getOddsUrl,
getSupportUrl, getSupportUrl,
@ -118,7 +120,7 @@ export class SlotBar extends Component {
private btnPositions: Map<string, Vec3> = new Map(); private btnPositions: Map<string, Vec3> = new Map();
private isAnimating: boolean = false; private isAnimating: boolean = false;
private readonly DURATION = 0.1; private readonly DURATION = 0.1;
private readonly OFFSET_Y = -200; private readonly OFFSET_Y = -300;
private hasClickSpin: boolean = false; private hasClickSpin: boolean = false;
private hasClickManualStop: boolean = false; private hasClickManualStop: boolean = false;
@ -420,6 +422,39 @@ export class SlotBar extends Component {
this.setBet(this.betGrade[this.betIndex]); this.setBet(this.betGrade[this.betIndex]);
} }
private isGetBalance: boolean = false;
async onClickBalance(): Promise<number | null> {
if (this.isGetBalance) return
this.isGetBalance = true;
try {
let balacneData = await this.refreshBalanceFromServer();
this.setBalance(balacneData)
return balacneData;
} catch (err) {
console.log('获取余额失败')
return null;
} finally {
this.scheduleOnce(() => {
this.isGetBalance = false;
}, 0.5)
}
}
async onConfirmErr2(): Promise<number | null> {
try {
let balacneData = await this.refreshBalanceFromServer();
this.setBalance(balacneData)
return balacneData;
} catch (err) {
console.log('获取余额失败')
return null;
} finally {
this.isGetBalance = false;
}
}
private currentTipTween: Tween<Node> = null; private currentTipTween: Tween<Node> = null;
private hideTimer: number = null; private hideTimer: number = null;
showTipSmall(str: string, openTurbo?: boolean) { showTipSmall(str: string, openTurbo?: boolean) {
@ -623,7 +658,7 @@ export class SlotBar extends Component {
this.setBtnVisible(this.spinBtn, true); this.setBtnVisible(this.spinBtn, true);
this.setBtnVisible(this.stopAutoBtn, false); this.setBtnVisible(this.stopAutoBtn, false);
this.setBtnEnable(this.spinBtn, false); this.setBtnEnable(this.spinBtn, false);
this.slotGame.showFeatureBuy(false) this.slotGame.showFeatureBuy(this.getBet() * this.gameInfo.BuyMul > this.gameInfo.MaxBuyBet)
} }
@ -799,4 +834,28 @@ export class SlotBar extends Component {
this.setBet(this.betGrade[this.betIndex], true); this.setBet(this.betGrade[this.betIndex], true);
} }
} }
// private _refreshingBalance: boolean = false;
async refreshBalanceFromServer(): Promise<number | null> {
// if (this._refreshingBalance) return this.getBalance();
// this._refreshingBalance = true;
try {
const res = await callGameBalanceApi({});
const balance = Number(res.Balance);
if (!Number.isFinite(balance)) {
console.warn("[SlotBar] invalid balance response:", res);
return this.getBalance();
}
this.setBalance(balance);
return balance;
} catch (err) {
console.error("[SlotBar] refresh balance failed:", err);
return this.getBalance();
} finally {
// this.scheduleOnce(() => {
// this._refreshingBalance = false;
// }, 1)
}
}
} }

View File

@ -875,8 +875,8 @@ export class SlotGame extends Component {
} }
showFeatureBuy(isShow: boolean) { showFeatureBuy(isHide: boolean) {
this.featureBuyNode.active = !isShow; this.featureBuyNode.active = !isHide;
} }
setFeatureBuyInteractable(isInteractable: boolean) { setFeatureBuyInteractable(isInteractable: boolean) {

View File

@ -12,7 +12,7 @@ import { SlotBar } from "./SlotBar";
import { SlotGame } from "./SlotGame"; import { SlotGame } from "./SlotGame";
import { BigWinUI } from "./game/BigWinUI"; import { BigWinUI } from "./game/BigWinUI";
import { GameDataManager } from "../../Loading/scripts/manager/GameDataManager"; import { GameDataManager } from "../../Loading/scripts/manager/GameDataManager";
import { callGameApi, getFromUrl } from "../../Loading/scripts/comm"; import { callGameApi, callGameBalanceApi, getFromUrl, getGameId } from "../../Loading/scripts/comm";
import { TipPanel } from "./game/TipPanel"; import { TipPanel } from "./game/TipPanel";
import { I18nManager } from "../../Loading/scripts/manager/I18nManager"; import { I18nManager } from "../../Loading/scripts/manager/I18nManager";
import { TotalWin } from "./game/TotalWin"; import { TotalWin } from "./game/TotalWin";
@ -88,6 +88,8 @@ export class SlotScene extends Component {
private lastSpinInfo: any = null; private lastSpinInfo: any = null;
private spinData: any = null; private spinData: any = null;
private isReceiveMsg: boolean = false; private isReceiveMsg: boolean = false;
private isErr2: boolean = false;
private objectId: string[] = []; private objectId: string[] = [];
@ -125,6 +127,7 @@ export class SlotScene extends Component {
// this.FreeSpinEnter.show(8) // this.FreeSpinEnter.show(8)
// this.FreeSpinAdd.show(5) // this.FreeSpinAdd.show(5)
// this.BigWinUI.show(800000, WIN_TYPE.SUPER_MEGA_WIN, 10000) // this.BigWinUI.show(800000, WIN_TYPE.SUPER_MEGA_WIN, 10000)
} }
private async init() { private async init() {
@ -283,18 +286,30 @@ export class SlotScene extends Component {
isFreeSpin: boolean = false, isFreeSpin: boolean = false,
isFeatureBuy: boolean = false isFeatureBuy: boolean = false
) { ) {
try {
this.gameState.isOnReconnect = false;
this.isReceiveMsg = false;
this.isErr = false;
this.slotGame.spin(this.gameState.isInFreeSpin);
this.gameState.isOneRoundEnd = false;
this.slotGame.changeBg(this.gameState.isInFreeSpin);
this.slotGame.hideIconMsg();
if (!isFreeSpin) { this.gameState.isOnReconnect = false;
this.slotBar.setWin(0); this.isReceiveMsg = false;
} this.isErr = false;
this.slotGame.spin(this.gameState.isInFreeSpin);
this.gameState.isOneRoundEnd = false;
this.slotGame.changeBg(this.gameState.isInFreeSpin);
this.slotGame.hideIconMsg();
if (!isFreeSpin) {
this.slotBar.setWin(0);
}
let curBalanceData = await this.slotBar.refreshBalanceFromServer()
if (!curBalanceData) {
curBalanceData = this.slotBar.getBalance()
}
if (curBalanceData < (isFeatureBuy ? this.slotBar.getBet() * this.gameInfo.BuyMul : this.slotBar.getBet()) && !isFreeSpin && !GameDataManager.instance.frb.Ongoing) {
//余额不足不经过服务器,在客户端拦截
this.showErrorTip(2, () => { this.slotBar.onConfirmErr2() });
this.handleErrSpin(true);
this.isErr2 = true;
return
}
try {
// 如果有frb就不会扣除金额 // 如果有frb就不会扣除金额
let frb = GameDataManager.instance.frb; let frb = GameDataManager.instance.frb;
if (frb && frb.Ongoing != null) { if (frb && frb.Ongoing != null) {
@ -401,7 +416,7 @@ export class SlotScene extends Component {
} }
private handleErrSpin() { private handleErrSpin(isErr2 = false) {
this.spinInfo = this.lastSpinInfo; this.spinInfo = this.lastSpinInfo;
this.spinData = this.spinInfo.Data; this.spinData = this.spinInfo.Data;
this.slotGame.setRollerIconRule( this.slotGame.setRollerIconRule(
@ -410,8 +425,9 @@ export class SlotScene extends Component {
this.gameState.isAutoSpin = false; this.gameState.isAutoSpin = false;
this.spinData.AllScore = 0; this.spinData.AllScore = 0;
this.slotGame.stopScroll(this.spinData, false, null); this.slotGame.stopScroll(this.spinData, false, null);
this.slotGame.manualStop(); // this.slotGame.manualStop();
this.slotBar.setBalance(this.spinInfo.Balance); this.slotBar.setBalance(isErr2 ? this.slotBar.getBalance() : this.spinInfo.Balance);
this.slotBar.closeAutoSpin();
} }
private async handleSpinResult() { private async handleSpinResult() {
@ -728,7 +744,14 @@ export class SlotScene extends Component {
} }
private async normalStop(isReconnect: boolean = false) { private async normalStop(isReconnect: boolean = false) {
this.slotBar.setBalance(this.spinData.Balance);
if (this.isErr2) {
this.isErr2 = false;
this.slotBar.setBalance(this.slotBar.getBalance());
} else {
this.slotBar.setBalance(this.spinData.Balance);
}
let winType = this.slotGame.checkWinType(this.spinData.AllScore); let winType = this.slotGame.checkWinType(this.spinData.AllScore);
await this.handleWinResult(winType, isReconnect, false, () => { await this.handleWinResult(winType, isReconnect, false, () => {
@ -946,7 +969,7 @@ export class SlotScene extends Component {
this.TipPanel.showTip( this.TipPanel.showTip(
title, title,
tip, tip,
null, callback,
null, null,
I18nManager.instance.t("AID_ERROR_OK_BUTTON"), I18nManager.instance.t("AID_ERROR_OK_BUTTON"),
null, null,

View File

@ -559,6 +559,7 @@ export class HistoryDetail extends Component {
if (idx == this.data.panDetails.length - 1) { if (idx == this.data.panDetails.length - 1) {
// console.log("已全部生成完") // console.log("已全部生成完")
this.hideLoading() this.hideLoading()
this.item_detail.removeFromParent()
this.scrollControl.jumpToPage(0) this.scrollControl.jumpToPage(0)
} }
@ -566,7 +567,6 @@ export class HistoryDetail extends Component {
await waitNextFrame(); await waitNextFrame();
}) })
this.item_detail.removeFromParent()
this.scrollControl.vert_scrollView = this.list_detail.content.children[0].getComponent(ScrollView) this.scrollControl.vert_scrollView = this.list_detail.content.children[0].getComponent(ScrollView)
this.list_detail.node.active = true this.list_detail.node.active = true
} }

View File

@ -1,4 +1,4 @@
import { _decorator, Component, EventMouse, JsonAsset, Layout, math, Node, ScrollView, UITransform } from 'cc'; import { _decorator, Component, EventMouse, JsonAsset, Layout, math, Node, ScrollView, UITransform, Widget } from 'cc';
import { hideToBottom, isBrahmic, updateLang, wrapTextBySpace } from './Tools'; import { hideToBottom, isBrahmic, updateLang, wrapTextBySpace } from './Tools';
import { getLanguage } from 'db://assets/Loading/scripts/comm'; import { getLanguage } from 'db://assets/Loading/scripts/comm';
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@ -18,6 +18,7 @@ export class Paytable extends Component {
this.dict = this.langJson.json[getLanguage()] ?? this.langJson.json["en"]; this.dict = this.langJson.json[getLanguage()] ?? this.langJson.json["en"];
this.scrollView = this.node.getChildByName("ScrollView").getComponent(ScrollView) this.scrollView = this.node.getChildByName("ScrollView").getComponent(ScrollView)
this.scrollView.node.getChildByName('view').getComponent(Widget).updateAlignment()
this.scrollView.node.on('scrolling', this.onScrolling, this); this.scrollView.node.on('scrolling', this.onScrolling, this);
this.node.on(Node.EventType.MOUSE_WHEEL, this.onMouseWheel, this); this.node.on(Node.EventType.MOUSE_WHEEL, this.onMouseWheel, this);

View File

@ -1,4 +1,4 @@
import { _decorator, Component, EventMouse, JsonAsset, Label, Layout, math, Node, ScrollView, UITransform } from 'cc'; import { _decorator, Component, EventMouse, JsonAsset, Label, Layout, math, Node, ScrollView, UITransform, Widget } from 'cc';
import { getAllRichTexts, hideToBottom, isBrahmic, updateLang, wrapTextBySpace } from './Tools'; import { getAllRichTexts, hideToBottom, isBrahmic, updateLang, wrapTextBySpace } from './Tools';
import { getCsymbol, getLanguage } from 'db://assets/Loading/scripts/comm'; import { getCsymbol, getLanguage } from 'db://assets/Loading/scripts/comm';
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@ -16,7 +16,7 @@ export class Rules extends Component {
protected onLoad(): void { protected onLoad(): void {
this.dict = this.langJson.json[getLanguage()] ?? this.langJson.json["en"]; this.dict = this.langJson.json[getLanguage()] ?? this.langJson.json["en"];
this.scrollView = this.node.getChildByName("ScrollView").getComponent(ScrollView) this.scrollView = this.node.getChildByName("ScrollView").getComponent(ScrollView)
this.scrollView.node.getChildByName('view').getComponent(Widget).updateAlignment()
this.scrollView.node.on('scrolling', this.onScrolling, this); this.scrollView.node.on('scrolling', this.onScrolling, this);
this.node.on(Node.EventType.MOUSE_WHEEL, this.onMouseWheel, this); this.node.on(Node.EventType.MOUSE_WHEEL, this.onMouseWheel, this);
} }
@ -49,7 +49,7 @@ export class Rules extends Component {
Label_1_3.string = str Label_1_3.string = str
} }
clickCloseRules() { clickCloseRules() {
const destroyFunc = () => { this.node.destroy() } const destroyFunc = () => { this.node.destroy() }
hideToBottom(this.node, destroyFunc) hideToBottom(this.node, destroyFunc)

View File

@ -23,7 +23,7 @@
"_active": true, "_active": true,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 89 "__id__": 91
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -54,7 +54,7 @@
}, },
"autoReleaseAssets": false, "autoReleaseAssets": false,
"_globals": { "_globals": {
"__id__": 90 "__id__": 92
}, },
"_id": "6c29a3fe-b10e-44a5-98e3-55595b231767" "_id": "6c29a3fe-b10e-44a5-98e3-55595b231767"
}, },
@ -77,17 +77,11 @@
"__id__": 8 "__id__": 8
}, },
{ {
"__id__": 68 "__id__": 70
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 83
},
{
"__id__": 84
},
{ {
"__id__": 85 "__id__": 85
}, },
@ -99,6 +93,12 @@
}, },
{ {
"__id__": 88 "__id__": 88
},
{
"__id__": 89
},
{
"__id__": 90
} }
], ],
"_prefab": null, "_prefab": null,
@ -354,6 +354,12 @@
}, },
{ {
"__id__": 67 "__id__": 67
},
{
"__id__": 68
},
{
"__id__": 69
} }
], ],
"_prefab": null, "_prefab": null,
@ -2503,6 +2509,62 @@
}, },
"_id": "b39r/AfidO+pudz3SN7pqo" "_id": "b39r/AfidO+pudz3SN7pqo"
}, },
{
"__type__": "cc.Mask",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": null,
"_type": 0,
"_inverted": false,
"_segments": 64,
"_alphaThreshold": 0.1,
"_id": "1bp0mDHnVBYoa14QZI/k1G"
},
{
"__type__": "cc.Graphics",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_lineWidth": 1,
"_strokeColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_lineJoin": 2,
"_lineCap": 0,
"_fillColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 0
},
"_miterLimit": 10,
"_id": "d38dT/Kz1Kub1b05cwraDN"
},
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
"_name": "", "_name": "",
@ -2513,7 +2575,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
"_alignFlags": 45, "_alignFlags": 5,
"_target": null, "_target": null,
"_left": 0, "_left": 0,
"_right": 0, "_right": 0,
@ -2521,17 +2583,17 @@
"_bottom": 0, "_bottom": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_isAbsLeft": false, "_isAbsLeft": true,
"_isAbsRight": true, "_isAbsRight": true,
"_isAbsTop": true, "_isAbsTop": true,
"_isAbsBottom": true, "_isAbsBottom": true,
"_isAbsHorizontalCenter": true, "_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true, "_isAbsVerticalCenter": true,
"_originalWidth": 1080, "_originalWidth": 1080,
"_originalHeight": 1920, "_originalHeight": 2400,
"_alignMode": 2, "_alignMode": 2,
"_lockFlags": 0, "_lockFlags": 0,
"_id": "ffH2CIHMVCZImyoyKJ54AK" "_id": "2dAW/VTelFD4EAkT5IAFtx"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
@ -2543,22 +2605,22 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 69 "__id__": 71
}, },
{ {
"__id__": 73 "__id__": 75
}, },
{ {
"__id__": 78 "__id__": 80
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 81 "__id__": 83
}, },
{ {
"__id__": 82 "__id__": 84
} }
], ],
"_prefab": null, "_prefab": null,
@ -2597,19 +2659,19 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
"__id__": 68 "__id__": 70
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 70
},
{
"__id__": 71
},
{ {
"__id__": 72 "__id__": 72
},
{
"__id__": 73
},
{
"__id__": 74
} }
], ],
"_prefab": null, "_prefab": null,
@ -2648,7 +2710,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 69 "__id__": 71
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2670,7 +2732,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 69 "__id__": 71
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2682,7 +2744,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 69 "__id__": 71
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2721,22 +2783,22 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
"__id__": 68 "__id__": 70
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 74
},
{
"__id__": 75
},
{ {
"__id__": 76 "__id__": 76
}, },
{ {
"__id__": 77 "__id__": 77
},
{
"__id__": 78
},
{
"__id__": 79
} }
], ],
"_prefab": null, "_prefab": null,
@ -2775,7 +2837,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 73 "__id__": 75
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2797,7 +2859,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 73 "__id__": 75
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2859,7 +2921,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 73 "__id__": 75
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2872,7 +2934,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 73 "__id__": 75
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2902,16 +2964,16 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
"__id__": 68 "__id__": 70
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 79 "__id__": 81
}, },
{ {
"__id__": 80 "__id__": 82
} }
], ],
"_prefab": null, "_prefab": null,
@ -2950,7 +3012,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 78 "__id__": 80
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2972,7 +3034,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 78 "__id__": 80
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -3011,7 +3073,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 68 "__id__": 70
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -3033,7 +3095,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 68 "__id__": 70
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -3164,7 +3226,7 @@
"__id__": 58 "__id__": 58
}, },
"rotateNode": { "rotateNode": {
"__id__": 68 "__id__": 70
}, },
"_id": "d8F/UwpTxNpZhwSJjDvnkk" "_id": "d8F/UwpTxNpZhwSJjDvnkk"
}, },
@ -3221,29 +3283,29 @@
{ {
"__type__": "cc.SceneGlobals", "__type__": "cc.SceneGlobals",
"ambient": { "ambient": {
"__id__": 91
},
"shadows": {
"__id__": 92
},
"_skybox": {
"__id__": 93 "__id__": 93
}, },
"fog": { "shadows": {
"__id__": 94 "__id__": 94
}, },
"octree": { "_skybox": {
"__id__": 95 "__id__": 95
}, },
"skin": { "fog": {
"__id__": 96 "__id__": 96
}, },
"lightProbeInfo": { "octree": {
"__id__": 97 "__id__": 97
}, },
"postSettings": { "skin": {
"__id__": 98 "__id__": 98
}, },
"lightProbeInfo": {
"__id__": 99
},
"postSettings": {
"__id__": 100
},
"bakedWithStationaryMainLight": false, "bakedWithStationaryMainLight": false,
"bakedWithHighpLightmap": false "bakedWithHighpLightmap": false
}, },

View File

@ -1,7 +1,9 @@
import { _decorator, Node, Component, screen, view, ResolutionPolicy, Sprite, sys, UITransform, Label, find } from 'cc'; import { _decorator, Node, Component, screen, view, ResolutionPolicy, Sprite, sys, UITransform, Label, find } from 'cc';
import { LocalizedLabel } from './i18n/LocalizedLabel'; import { LocalizedLabel } from './i18n/LocalizedLabel';
import { getLanguage } from './comm'; import { getLanguage } from './comm';
import { installLabelAlignmentCenterFix } from 'common_tools';
installLabelAlignmentCenterFix();
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
export let SWITCH_PROTRAIT_MODE = { export let SWITCH_PROTRAIT_MODE = {

View File

@ -7,7 +7,7 @@ import { PREVIEW } from "cc/env"
const gameId = "rp_11001"; const gameId = "rp_11001";
// let apiaddr = "https://rpgames-api.rpfafafahkdev.com"; // let apiaddr = "https://rpgames-api.rpfafafahkdev.com";
let apiaddr = ""; let apiaddr = "";
let token = "eyJQIjoxMDA5NDksIkUiOjE3Nzk5Nzk1NzUsIlMiOjEwMDEsIkQiOiJycF8xMTAwMSJ9.zFNHlm0quBGtYIxM735w8tij2YjXvkTldJ1_rCP-oqk"; let token = "eyJQIjoxMDA5NDksIkUiOjE3ODI5MzA5ODEsIlMiOjEwMDAsIkQiOiJycF8xMTAwMSJ9.432SLYXxigvcnlARfSesXWhDOJ06QHzN3OvU791lMiw";
let language = "en" let language = "en"
let currency = "THB" let currency = "THB"
@ -31,7 +31,7 @@ export function getHistoryUrl() {
} }
export function getLanguage() { export function getLanguage() {
// return 'zh'; // return 'th';
return language; return language;
} }
@ -100,6 +100,29 @@ AbortSignal.timeout ??= function timeout(ms) {
return ctrl.signal return ctrl.signal
} }
export async function callGameBalanceApi(argsObj: any) {
const url = apiaddr + path.join("/gameapi/getPlayerBalance")
const payload = JSON.stringify(argsObj)
const res = await fetch(url, {
signal: AbortSignal.timeout(10000),
headers: {
"Content-Type": "application/json",
"X-Rp-Token": token,
},
method: "POST",
body: payload,
mode: 'cors',
})
if (res.status != 200) {
const errstr = await res.text()
throw new Error(errstr || res.statusText)
}
const obj = await res.json()
return obj
}
export async function callGameApi(action: string, argsObj: any) { export async function callGameApi(action: string, argsObj: any) {
const url = apiaddr + path.join("/gameapi/", gameId, action) const url = apiaddr + path.join("/gameapi/", gameId, action)
const payload = JSON.stringify(argsObj) const payload = JSON.stringify(argsObj)

6
package-lock.json generated
View File

@ -9,9 +9,15 @@
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"common_tools": "git+ssh://git@gitea.rpfafafahkdev.com:taotao/common_tools.git",
"nosleep.js": "^0.12.0" "nosleep.js": "^0.12.0"
} }
}, },
"node_modules/common_tools": {
"version": "1.0.0",
"resolved": "git+ssh://git@gitea.rpfafafahkdev.com:taotao/common_tools.git#c49bf2990a6f348489505ac4998683c814b58dde",
"license": "MIT"
},
"node_modules/nosleep.js": { "node_modules/nosleep.js": {
"version": "0.12.0", "version": "0.12.0",
"resolved": "https://registry.npmjs.org/nosleep.js/-/nosleep.js-0.12.0.tgz", "resolved": "https://registry.npmjs.org/nosleep.js/-/nosleep.js-0.12.0.tgz",

View File

@ -14,6 +14,7 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"common_tools": "git+ssh://git@gitea.rpfafafahkdev.com:taotao/common_tools.git",
"nosleep.js": "^0.12.0" "nosleep.js": "^0.12.0"
} }
} }