手牌上限显示修改

手牌上限显示
This commit is contained in:
肯我赛 2023-05-28 14:28:23 +08:00
parent 179bc6954f
commit 92ff7ffeef
3 changed files with 23 additions and 7 deletions

View File

@ -299,7 +299,8 @@ function doIndicate(from, tos) {
line.running = true; line.running = true;
} }
callbacks["cardMax"] = function(jsonData) { <<<<<<< HEAD
callbacks["MaxCard"] = function(jsonData) {
let data = JSON.parse(jsonData); let data = JSON.parse(jsonData);
let id = data.id; let id = data.id;
@ -308,10 +309,12 @@ callbacks["cardMax"] = function(jsonData) {
if (!photo) { if (!photo) {
return null; return null;
} }
photo.cardMax = cardMax; photo.maxCard = cardMax;
} }
=======
>>>>>>> parent of 179bc69 (CardMax)
function changeSelf(id) { function changeSelf(id) {
Backend.callLuaFunction("ChangeSelf", [id]); Backend.callLuaFunction("ChangeSelf", [id]);

View File

@ -31,7 +31,10 @@ Item {
property bool isOwner: false property bool isOwner: false
property int distance: 0 property int distance: 0
property string status: "normal" property string status: "normal"
property int cardMax: 0 <<<<<<< HEAD
property int maxCard: 0
=======
>>>>>>> parent of 179bc69 (CardMax)
property alias handcardArea: handcardAreaItem property alias handcardArea: handcardAreaItem
property alias equipArea: equipAreaItem property alias equipArea: equipAreaItem
@ -352,9 +355,13 @@ Item {
x: -6 x: -6
Text { 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.family: fontLibian.name
font.pixelSize: 32 font.pixelSize: root.maxCard==root.hp ? 32 : 27
//font.weight: 30 //font.weight: 30
color: "white" color: "white"
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View File

@ -77,7 +77,10 @@ function Client:moveCards(moves)
for _, move in ipairs(moves) do for _, move in ipairs(moves) do
if move.from and move.fromArea then if move.from and move.fromArea then
local from = self:getPlayerById(move.from) 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 if from.id ~= Self.id and move.fromArea == Card.PlayerHand then
for i = 1, #move.ids do for i = 1, #move.ids do
table.remove(from.player_cards[Player.Hand]) 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] local id, name, value = data[1], data[2], data[3]
ClientInstance:getPlayerById(id)[name] = value ClientInstance:getPlayerById(id)[name] = value
ClientInstance:notifyUI("PropertyUpdate", jsonData) 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 end
fk.client_callback["AskForCardChosen"] = function(jsonData) fk.client_callback["AskForCardChosen"] = function(jsonData)