Compare commits

...

3 Commits

Author SHA1 Message Date
Ho-spair 3dce239c94 Merge branch 'heg-mark-card' of https://github.com/Qsgs-Fans/FreeKill into heg-mark-card 2023-12-14 09:36:58 +08:00
Ho-spair b56cb08954 mark card in UI 2023-12-14 09:35:01 +08:00
Ho-spair ae84b104cc mark card in UI 2023-11-25 18:18:40 +08:00
2 changed files with 40 additions and 5 deletions

View File

@ -471,6 +471,33 @@ Item {
} }
} }
Rectangle {
id: markCardBoard
anchors.top: dashboard.top
anchors.left: dashboardBtn.right
visible: false
color: "black"
width: markCardItem.width + 20
height: markCardItem.height + 20
radius: 5
PicMarkArea {
id: markCardItem
anchors.centerIn: markCardBoard
}
TapHandler {
id: mouse
onTapped: markCardBoard.clicked()
}
onClicked: {
}
}
Dashboard { Dashboard {
id: dashboard id: dashboard
width: roomScene.width - dashboardBtn.width width: roomScene.width - dashboardBtn.width

View File

@ -790,7 +790,7 @@ callbacks["PropertyUpdate"] = (jsonData) => {
model[property_name] = value; model[property_name] = value;
} }
if (property_name === "phase") { if (prdashboardoperty_name === "phase") {
let item = getPhoto(uid); let item = getPhoto(uid);
item.playing = value < 8; // Player.NotActive item.playing = value < 8; // Player.NotActive
} }
@ -1372,16 +1372,22 @@ callbacks["WaitForNullification"] = () => {
callbacks["SetPlayerMark"] = (jsonData) => { callbacks["SetPlayerMark"] = (jsonData) => {
const data = JSON.parse(jsonData); const data = JSON.parse(jsonData);
const player = getPhoto(data[0]); const player = getPhoto(data[0]);
const mark = data[1]; const mark = data[1].startsWith('@#') ? data[1].replace('@#', '@!') : data[1];
const value = data[2] instanceof Object ? data[2] : data[2].toString(); const value = data[2] instanceof Array ? data[2] : data[2].toString();
let area = mark.startsWith("@!") ? player.picMarkArea : player.markArea; let area = (data[1].startsWith("@!") || data[1].startsWith("@#")) ? player.picMarkArea : player.markArea;
if (data[2] === 0) { if (data[2] === 0) {
area.removeMark(mark); area.removeMark(mark);
} else {
if (data[1].startsWith("@#") && data[0] === Self.id) {
markCardItem.setMark(mark, value);
} else { } else {
area.setMark(mark, mark.startsWith("@@") ? "" : value); area.setMark(mark, mark.startsWith("@@") ? "" : value);
} }
} }
markCardBoard.visible = markCardItem.data.length > 0;
}
callbacks["SetBanner"] = (jsonData) => { callbacks["SetBanner"] = (jsonData) => {
const data = JSON.parse(jsonData); const data = JSON.parse(jsonData);
const mark = data[0]; const mark = data[0];
@ -1392,6 +1398,8 @@ callbacks["SetBanner"] = (jsonData) => {
} else { } else {
area.setMark(mark, mark.startsWith("@@") ? "" : value); area.setMark(mark, mark.startsWith("@@") ? "" : value);
} }
markCardBoard.visible = markCardItem.data.length > 0;
} }
callbacks["Animate"] = (jsonData) => { callbacks["Animate"] = (jsonData) => {