From 92ff7ffeefcea01db712fb09fad291ef5ebef00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=AF=E6=88=91=E8=B5=9B?= <1164198126@qq.com> Date: Sun, 28 May 2023 14:28:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E7=89=8C=E4=B8=8A=E9=99=90=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 手牌上限显示 --- Fk/Pages/RoomLogic.js | 7 +++++-- Fk/RoomElement/Photo.qml | 13 ++++++++++--- lua/client/client.lua | 10 ++++++++-- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Fk/Pages/RoomLogic.js b/Fk/Pages/RoomLogic.js index 74e47c31..2180ac41 100644 --- a/Fk/Pages/RoomLogic.js +++ b/Fk/Pages/RoomLogic.js @@ -299,7 +299,8 @@ function doIndicate(from, tos) { line.running = true; } -callbacks["cardMax"] = function(jsonData) { +<<<<<<< HEAD +callbacks["MaxCard"] = function(jsonData) { let data = JSON.parse(jsonData); let id = data.id; @@ -308,10 +309,12 @@ callbacks["cardMax"] = function(jsonData) { if (!photo) { return null; } - photo.cardMax = cardMax; + photo.maxCard = cardMax; } +======= +>>>>>>> parent of 179bc69 (CardMax) function changeSelf(id) { Backend.callLuaFunction("ChangeSelf", [id]); diff --git a/Fk/RoomElement/Photo.qml b/Fk/RoomElement/Photo.qml index 54700660..d99d629d 100644 --- a/Fk/RoomElement/Photo.qml +++ b/Fk/RoomElement/Photo.qml @@ -31,7 +31,10 @@ Item { property bool isOwner: false property int distance: 0 property string status: "normal" - property int cardMax: 0 +<<<<<<< HEAD + property int maxCard: 0 +======= +>>>>>>> parent of 179bc69 (CardMax) property alias handcardArea: handcardAreaItem property alias equipArea: equipAreaItem @@ -352,9 +355,13 @@ Item { x: -6 Text { - text: root.handcards + "/" +root.cardMax +<<<<<<< HEAD + text: root.maxCard==root.hp ? root.handcards : root.handcards + "/" +root.maxCard +======= + text: root.handcards +>>>>>>> parent of 179bc69 (CardMax) font.family: fontLibian.name - font.pixelSize: 32 + font.pixelSize: root.maxCard==root.hp ? 32 : 27 //font.weight: 30 color: "white" anchors.horizontalCenter: parent.horizontalCenter diff --git a/lua/client/client.lua b/lua/client/client.lua index a1a76830..cf1c2fee 100644 --- a/lua/client/client.lua +++ b/lua/client/client.lua @@ -77,7 +77,10 @@ function Client:moveCards(moves) for _, move in ipairs(moves) do if move.from and move.fromArea then local from = self:getPlayerById(move.from) - ClientInstance:notifyUI("cardMax", json.encode{ pcardMax = from:getMaxCards(),id = move.from}) +<<<<<<< HEAD + ClientInstance:notifyUI("MaxCard", json.encode{ pcardMax = from:getMaxCards(),id = move.from}) +======= +>>>>>>> parent of 179bc69 (CardMax) if from.id ~= Self.id and move.fromArea == Card.PlayerHand then for i = 1, #move.ids do table.remove(from.player_cards[Player.Hand]) @@ -291,7 +294,10 @@ fk.client_callback["PropertyUpdate"] = function(jsonData) local id, name, value = data[1], data[2], data[3] ClientInstance:getPlayerById(id)[name] = value ClientInstance:notifyUI("PropertyUpdate", jsonData) - ClientInstance:notifyUI("cardMax", json.encode{ pcardMax = ClientInstance:getPlayerById(data[1]):getMaxCards(), id = data[1]}) +<<<<<<< HEAD + ClientInstance:notifyUI("MaxCard", json.encode{ pcardMax = ClientInstance:getPlayerById(data[1]):getMaxCards(), id = data[1]}) +======= +>>>>>>> parent of 179bc69 (CardMax) end fk.client_callback["AskForCardChosen"] = function(jsonData)