Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d2d2540de0 | |||
| 97b836b9df | |||
| 1f7dfcfffa | |||
| d099caf374 | |||
| deaaf21e3c | |||
| 10562f980c | |||
| ef4560fe8c | |||
| c62d2a1522 | |||
| 09f7990e6d | |||
| 897f305ae3 | |||
| d6d9db5f65 | |||
| 51d05d5209 |
@ -19,7 +19,9 @@ jobs:
|
||||
echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
|
||||
- name: npm i
|
||||
run: |
|
||||
echo 'npm i'
|
||||
npm i
|
||||
echo "✅ npm i done"
|
||||
- name: build
|
||||
run: |
|
||||
echo 'build'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -29,7 +29,9 @@ import { AutoSpinPanel } from "./game/AutoSpinPanel";
|
||||
import { NodePoolManager } from "../../Loading/scripts/manager/NodePoolManager";
|
||||
import { webView } from "./game/WebView";
|
||||
import {
|
||||
callGameBalanceApi,
|
||||
cash2gold,
|
||||
getGameId,
|
||||
getHistoryUrl,
|
||||
getOddsUrl,
|
||||
getSupportUrl,
|
||||
@ -118,7 +120,7 @@ export class SlotBar extends Component {
|
||||
private btnPositions: Map<string, Vec3> = new Map();
|
||||
private isAnimating: boolean = false;
|
||||
private readonly DURATION = 0.1;
|
||||
private readonly OFFSET_Y = -200;
|
||||
private readonly OFFSET_Y = -300;
|
||||
|
||||
private hasClickSpin: boolean = false;
|
||||
private hasClickManualStop: boolean = false;
|
||||
@ -420,6 +422,39 @@ export class SlotBar extends Component {
|
||||
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 hideTimer: number = null;
|
||||
showTipSmall(str: string, openTurbo?: boolean) {
|
||||
@ -623,7 +658,7 @@ export class SlotBar extends Component {
|
||||
this.setBtnVisible(this.spinBtn, true);
|
||||
this.setBtnVisible(this.stopAutoBtn, 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);
|
||||
}
|
||||
}
|
||||
|
||||
// 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)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -875,8 +875,8 @@ export class SlotGame extends Component {
|
||||
}
|
||||
|
||||
|
||||
showFeatureBuy(isShow: boolean) {
|
||||
this.featureBuyNode.active = !isShow;
|
||||
showFeatureBuy(isHide: boolean) {
|
||||
this.featureBuyNode.active = !isHide;
|
||||
}
|
||||
|
||||
setFeatureBuyInteractable(isInteractable: boolean) {
|
||||
|
||||
@ -12,7 +12,7 @@ import { SlotBar } from "./SlotBar";
|
||||
import { SlotGame } from "./SlotGame";
|
||||
import { BigWinUI } from "./game/BigWinUI";
|
||||
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 { I18nManager } from "../../Loading/scripts/manager/I18nManager";
|
||||
import { TotalWin } from "./game/TotalWin";
|
||||
@ -88,6 +88,8 @@ export class SlotScene extends Component {
|
||||
private lastSpinInfo: any = null;
|
||||
private spinData: any = null;
|
||||
private isReceiveMsg: boolean = false;
|
||||
private isErr2: boolean = false;
|
||||
|
||||
|
||||
private objectId: string[] = [];
|
||||
|
||||
@ -125,6 +127,7 @@ export class SlotScene extends Component {
|
||||
// this.FreeSpinEnter.show(8)
|
||||
// this.FreeSpinAdd.show(5)
|
||||
// this.BigWinUI.show(800000, WIN_TYPE.SUPER_MEGA_WIN, 10000)
|
||||
|
||||
}
|
||||
|
||||
private async init() {
|
||||
@ -283,18 +286,30 @@ export class SlotScene extends Component {
|
||||
isFreeSpin: 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.slotBar.setWin(0);
|
||||
}
|
||||
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.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就不会扣除金额
|
||||
let frb = GameDataManager.instance.frb;
|
||||
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.spinData = this.spinInfo.Data;
|
||||
this.slotGame.setRollerIconRule(
|
||||
@ -410,8 +425,9 @@ export class SlotScene extends Component {
|
||||
this.gameState.isAutoSpin = false;
|
||||
this.spinData.AllScore = 0;
|
||||
this.slotGame.stopScroll(this.spinData, false, null);
|
||||
this.slotGame.manualStop();
|
||||
this.slotBar.setBalance(this.spinInfo.Balance);
|
||||
// this.slotGame.manualStop();
|
||||
this.slotBar.setBalance(isErr2 ? this.slotBar.getBalance() : this.spinInfo.Balance);
|
||||
this.slotBar.closeAutoSpin();
|
||||
}
|
||||
|
||||
private async handleSpinResult() {
|
||||
@ -728,7 +744,14 @@ export class SlotScene extends Component {
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
await this.handleWinResult(winType, isReconnect, false, () => {
|
||||
@ -946,7 +969,7 @@ export class SlotScene extends Component {
|
||||
this.TipPanel.showTip(
|
||||
title,
|
||||
tip,
|
||||
null,
|
||||
callback,
|
||||
null,
|
||||
I18nManager.instance.t("AID_ERROR_OK_BUTTON"),
|
||||
null,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { _decorator, Button, Color, Component, EventHandler, EventMouse, instantiate, isValid, JsonAsset, Label, math, Node, Prefab, ScrollView, sp, tween, UITransform, Vec3 } from 'cc';
|
||||
import { _decorator, Button, Color, Component, EventHandler, EventMouse, instantiate, isValid, JsonAsset, Label, math, Node, Prefab, ScrollView, sp, tween, UIOpacity, UITransform, Vec3 } from 'cc';
|
||||
import { getCsymbol, getHistory, getHistoryDetails, getLanguage } from '../../../Loading/scripts/comm';
|
||||
import { fixNum, getTimezoneOffsetString, getTranslate, hideAllChildren, hideToBottom, isBrahmic, showAllChildren, updateLang } from './Tools';
|
||||
const { ccclass, property } = _decorator;
|
||||
@ -405,6 +405,7 @@ export class History extends Component {
|
||||
// console.log("clickItem, roundId = ", roundId)
|
||||
|
||||
const history_detail = instantiate(this.history_detail)
|
||||
history_detail.getComponent(UIOpacity).opacity = 0
|
||||
this.node_detail.addChild(history_detail)
|
||||
let data = await getHistoryDetails({
|
||||
GameId: "rp_11001",
|
||||
@ -415,6 +416,8 @@ export class History extends Component {
|
||||
|
||||
const self = this
|
||||
history_detail.position = new Vec3(1080, 0)
|
||||
history_detail.getComponent(UIOpacity).opacity = 255
|
||||
|
||||
tween(history_detail).to(0.2, { position: new Vec3(0, 0) })
|
||||
.call(() => {
|
||||
self.scheduleOnce(() => { comp.entryFinish() })
|
||||
|
||||
@ -197,7 +197,7 @@ export class HistoryDetail extends Component {
|
||||
node.active = true
|
||||
|
||||
let startVec = new Vec3(0, 3000)
|
||||
let endVec = new Vec3(0, 800)
|
||||
let endVec = new Vec3(0, this.list_detail.node.getPosition().y)
|
||||
|
||||
node.position = startVec
|
||||
tween(node).to(0.2, { position: endVec }).call(() => {
|
||||
@ -559,6 +559,7 @@ export class HistoryDetail extends Component {
|
||||
if (idx == this.data.panDetails.length - 1) {
|
||||
// console.log("已全部生成完")
|
||||
this.hideLoading()
|
||||
this.item_detail.removeFromParent()
|
||||
this.scrollControl.jumpToPage(0)
|
||||
}
|
||||
|
||||
@ -647,15 +648,16 @@ export class HistoryDetail extends Component {
|
||||
showLoading() {
|
||||
this.loading.active = true
|
||||
let sk = this.loading.getComponent(sp.Skeleton)
|
||||
sk.paused = false
|
||||
sk.loop = true
|
||||
// sk.paused = false
|
||||
// sk.loop = true
|
||||
sk.setAnimation(0, 'loadingLoop')
|
||||
}
|
||||
|
||||
hideLoading() {
|
||||
let sk = this.loading.getComponent(sp.Skeleton)
|
||||
sk.paused = true
|
||||
sk.loop = false
|
||||
|
||||
// sk.paused = true
|
||||
// sk.loop = false
|
||||
sk.clearAnimations()
|
||||
this.loading.active = false
|
||||
|
||||
}
|
||||
|
||||
@ -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 { getLanguage } from 'db://assets/Loading/scripts/comm';
|
||||
const { ccclass, property } = _decorator;
|
||||
@ -18,6 +18,7 @@ export class Paytable extends Component {
|
||||
this.dict = this.langJson.json[getLanguage()] ?? this.langJson.json["en"];
|
||||
|
||||
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.node.on(Node.EventType.MOUSE_WHEEL, this.onMouseWheel, this);
|
||||
|
||||
@ -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 { getCsymbol, getLanguage } from 'db://assets/Loading/scripts/comm';
|
||||
const { ccclass, property } = _decorator;
|
||||
@ -16,7 +16,7 @@ export class Rules extends Component {
|
||||
protected onLoad(): void {
|
||||
this.dict = this.langJson.json[getLanguage()] ?? this.langJson.json["en"];
|
||||
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.node.on(Node.EventType.MOUSE_WHEEL, this.onMouseWheel, this);
|
||||
}
|
||||
@ -49,7 +49,7 @@ export class Rules extends Component {
|
||||
Label_1_3.string = str
|
||||
}
|
||||
|
||||
|
||||
|
||||
clickCloseRules() {
|
||||
const destroyFunc = () => { this.node.destroy() }
|
||||
hideToBottom(this.node, destroyFunc)
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 90
|
||||
"__id__": 91
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@ -54,7 +54,7 @@
|
||||
},
|
||||
"autoReleaseAssets": false,
|
||||
"_globals": {
|
||||
"__id__": 91
|
||||
"__id__": 92
|
||||
},
|
||||
"_id": "6c29a3fe-b10e-44a5-98e3-55595b231767"
|
||||
},
|
||||
@ -96,6 +96,9 @@
|
||||
},
|
||||
{
|
||||
"__id__": 89
|
||||
},
|
||||
{
|
||||
"__id__": 90
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
@ -2345,7 +2348,7 @@
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1080,
|
||||
"height": 2560
|
||||
"height": 1920
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@ -2445,7 +2448,7 @@
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1080,
|
||||
"height": 2560
|
||||
"height": 1920
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@ -2497,7 +2500,7 @@
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1080,
|
||||
"height": 2560
|
||||
"height": 1920
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@ -2506,36 +2509,6 @@
|
||||
},
|
||||
"_id": "b39r/AfidO+pudz3SN7pqo"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 8
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_alignFlags": 45,
|
||||
"_target": null,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": -320,
|
||||
"_bottom": -320,
|
||||
"_horizontalCenter": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_isAbsLeft": false,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 1080,
|
||||
"_originalHeight": 1920,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": "ffH2CIHMVCZImyoyKJ54AK"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Mask",
|
||||
"_name": "",
|
||||
@ -2550,7 +2523,7 @@
|
||||
"_inverted": false,
|
||||
"_segments": 64,
|
||||
"_alphaThreshold": 0.1,
|
||||
"_id": "31IUj90uNGboMG/ZgAfkg4"
|
||||
"_id": "1bp0mDHnVBYoa14QZI/k1G"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Graphics",
|
||||
@ -2590,7 +2563,37 @@
|
||||
"a": 0
|
||||
},
|
||||
"_miterLimit": 10,
|
||||
"_id": "88ENBOYIpCGKFcHVTgSMzZ"
|
||||
"_id": "d38dT/Kz1Kub1b05cwraDN"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 8
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_alignFlags": 5,
|
||||
"_target": null,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 1080,
|
||||
"_originalHeight": 2400,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": "2dAW/VTelFD4EAkT5IAFtx"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
@ -3239,6 +3242,36 @@
|
||||
"__prefab": null,
|
||||
"_id": "46W4D2JoFNZZugl/RX7IG4"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_alignFlags": 45,
|
||||
"_target": null,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 1080,
|
||||
"_originalHeight": 1920,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": "afR8mXvHhEeIs7Aiv76HNP"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": null,
|
||||
@ -3250,29 +3283,29 @@
|
||||
{
|
||||
"__type__": "cc.SceneGlobals",
|
||||
"ambient": {
|
||||
"__id__": 92
|
||||
},
|
||||
"shadows": {
|
||||
"__id__": 93
|
||||
},
|
||||
"_skybox": {
|
||||
"shadows": {
|
||||
"__id__": 94
|
||||
},
|
||||
"fog": {
|
||||
"_skybox": {
|
||||
"__id__": 95
|
||||
},
|
||||
"octree": {
|
||||
"fog": {
|
||||
"__id__": 96
|
||||
},
|
||||
"skin": {
|
||||
"octree": {
|
||||
"__id__": 97
|
||||
},
|
||||
"lightProbeInfo": {
|
||||
"skin": {
|
||||
"__id__": 98
|
||||
},
|
||||
"postSettings": {
|
||||
"lightProbeInfo": {
|
||||
"__id__": 99
|
||||
},
|
||||
"postSettings": {
|
||||
"__id__": 100
|
||||
},
|
||||
"bakedWithStationaryMainLight": false,
|
||||
"bakedWithHighpLightmap": false
|
||||
},
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
import { _decorator, Node, Component, screen, view, ResolutionPolicy, Sprite, sys, UITransform, Label, find } from 'cc';
|
||||
import { LocalizedLabel } from './i18n/LocalizedLabel';
|
||||
import { getLanguage } from './comm';
|
||||
import { installLabelAlignmentCenterFix } from 'common_tools';
|
||||
|
||||
installLabelAlignmentCenterFix();
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
export let SWITCH_PROTRAIT_MODE = {
|
||||
|
||||
@ -7,7 +7,7 @@ import { PREVIEW } from "cc/env"
|
||||
const gameId = "rp_11001";
|
||||
// let apiaddr = "https://rpgames-api.rpfafafahkdev.com";
|
||||
let apiaddr = "";
|
||||
let token = "eyJQIjoxMDA5NDksIkUiOjE3NzIwMjYxNzYsIlMiOjEwMDMsIkQiOiJycF8xMTAwMSJ9.3wfZ318ajoHyaEkAcGF9VKAW6qXko5aTVFw1K1rr478";
|
||||
let token = "eyJQIjoxMDA5NDksIkUiOjE3ODI5MzA5ODEsIlMiOjEwMDAsIkQiOiJycF8xMTAwMSJ9.432SLYXxigvcnlARfSesXWhDOJ06QHzN3OvU791lMiw";
|
||||
|
||||
let language = "en"
|
||||
let currency = "THB"
|
||||
@ -31,7 +31,7 @@ export function getHistoryUrl() {
|
||||
}
|
||||
|
||||
export function getLanguage() {
|
||||
// return 'zh';
|
||||
// return 'th';
|
||||
return language;
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ export function getGameId() {
|
||||
}
|
||||
|
||||
export function initReqAddr() {
|
||||
let partHost = ".rpfafafahkdev.com";
|
||||
let partHost = ".rpenenenhkdev.com";
|
||||
if (!PREVIEW) {
|
||||
const qs = new URLSearchParams(location.search)
|
||||
|
||||
@ -100,6 +100,29 @@ AbortSignal.timeout ??= function timeout(ms) {
|
||||
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) {
|
||||
const url = apiaddr + path.join("/gameapi/", gameId, action)
|
||||
const payload = JSON.stringify(argsObj)
|
||||
|
||||
@ -94,6 +94,5 @@ export class LocalizedLabel2 extends Component {
|
||||
}
|
||||
this.label.isBold = this.isBold;
|
||||
this.label.updateRenderData();
|
||||
console.log(currentLang, 'targetFont', targetFont);
|
||||
}
|
||||
}
|
||||
6
package-lock.json
generated
6
package-lock.json
generated
@ -9,9 +9,15 @@
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"common_tools": "git+ssh://git@gitea.rpfafafahkdev.com:taotao/common_tools.git",
|
||||
"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": {
|
||||
"version": "0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/nosleep.js/-/nosleep.js-0.12.0.tgz",
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"common_tools": "git+ssh://git@gitea.rpfafafahkdev.com:taotao/common_tools.git",
|
||||
"nosleep.js": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user