fix
This commit is contained in:
parent
fadfc0f7ec
commit
3e7950a7c3
|
@ -113,7 +113,7 @@ callbacks["UpdateRoomList"] = function(jsonData) {
|
||||||
gameMode: room[2],
|
gameMode: room[2],
|
||||||
playerNum: room[3],
|
playerNum: room[3],
|
||||||
capacity: room[4],
|
capacity: room[4],
|
||||||
hasPassword: room[5],
|
hasPassword: room[5] ? true : false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -361,7 +361,8 @@ Item {
|
||||||
anchors.rightMargin: 20
|
anchors.rightMargin: 20
|
||||||
color: "#88EEEEEE"
|
color: "#88EEEEEE"
|
||||||
radius: 8
|
radius: 8
|
||||||
visible: roomScene.state == "playing" && (specialCardSkills.count > 1 || specialCardSkills.model[0] !== "_normal_use")
|
visible: roomScene.state == "playing" && (specialCardSkills.count > 1
|
||||||
|
|| (specialCardSkills.model && specialCardSkills.model[0] !== "_normal_use"))
|
||||||
width: childrenRect.width
|
width: childrenRect.width
|
||||||
height: childrenRect.height - 20
|
height: childrenRect.height - 20
|
||||||
|
|
||||||
|
|
|
@ -300,16 +300,13 @@ function doIndicate(from, tos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
callbacks["MaxCard"] = function(jsonData) {
|
callbacks["MaxCard"] = function(jsonData) {
|
||||||
|
|
||||||
let data = JSON.parse(jsonData);
|
let data = JSON.parse(jsonData);
|
||||||
let id = data.id;
|
let id = data.id;
|
||||||
let cardMax = data.pcardMax;
|
let cardMax = data.pcardMax;
|
||||||
let photo = getPhoto(id);
|
let photo = getPhoto(id);
|
||||||
if (!photo) {
|
if (photo) {
|
||||||
return null;
|
|
||||||
}
|
|
||||||
photo.maxCard = cardMax;
|
photo.maxCard = cardMax;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeSelf(id) {
|
function changeSelf(id) {
|
||||||
|
|
|
@ -352,9 +352,9 @@ Item {
|
||||||
x: -6
|
x: -6
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: root.maxCard==root.hp ? root.handcards : root.handcards + "/" +root.maxCard
|
text: (root.maxCard === root.hp) ? (root.handcards) : (root.handcards + "/" + root.maxCard)
|
||||||
font.family: fontLibian.name
|
font.family: fontLibian.name
|
||||||
font.pixelSize: root.maxCard==root.hp ? 32 : 27
|
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
|
||||||
|
|
|
@ -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("MaxCard", json.encode{ pcardMax = from:getMaxCards(),id = move.from})
|
self:notifyUI("MaxCard", json.encode{
|
||||||
|
pcardMax = from:getMaxCards(),
|
||||||
|
id = move.from,
|
||||||
|
})
|
||||||
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])
|
||||||
|
@ -93,6 +96,10 @@ function Client:moveCards(moves)
|
||||||
|
|
||||||
if move.to and move.toArea then
|
if move.to and move.toArea then
|
||||||
local ids = move.ids
|
local ids = move.ids
|
||||||
|
self:notifyUI("MaxCard", json.encode{
|
||||||
|
pcardMax = self:getPlayerById(move.to):getMaxCards(),
|
||||||
|
id = move.to,
|
||||||
|
})
|
||||||
if (move.to ~= Self.id and move.toArea == Card.PlayerHand) or table.contains(ids, -1) then
|
if (move.to ~= Self.id and move.toArea == Card.PlayerHand) or table.contains(ids, -1) then
|
||||||
ids = table.map(ids, function() return -1 end)
|
ids = table.map(ids, function() return -1 end)
|
||||||
end
|
end
|
||||||
|
@ -291,7 +298,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("MaxCard", json.encode{ pcardMax = ClientInstance:getPlayerById(data[1]):getMaxCards(), id = data[1]})
|
ClientInstance:notifyUI("MaxCard", json.encode{
|
||||||
|
pcardMax = ClientInstance:getPlayerById(id):getMaxCards(),
|
||||||
|
id = id,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
fk.client_callback["AskForCardChosen"] = function(jsonData)
|
fk.client_callback["AskForCardChosen"] = function(jsonData)
|
||||||
|
|
Loading…
Reference in New Issue