This commit is contained in:
YoumuKon 2024-04-01 16:46:51 +08:00
parent e30b9aa451
commit 5a1bd8c81e
1 changed files with 6 additions and 22 deletions

View File

@ -8,10 +8,10 @@ import Fk.Pages
GraphicsBox { GraphicsBox {
id: root id: root
property string Yuqi_type property string Yuqi_type
property var cards: [] property var cards: [] //
property var result: [] property var result: [] //
property var pilecards: [] property var pilecards: [] //
property var areaNames: [] property var areaNames: [] //
property bool cancelable: true property bool cancelable: true
property var extra_data property var extra_data
property int padding: 25 property int padding: 25
@ -110,10 +110,7 @@ GraphicsBox {
} }
function updateCardsReleased() { function updateCardsReleased() {
let _card = result[0][0]; for (i = 0; i < cardItem.count; i++) {
if (Math.abs(card.y - _card.y) >= card.height) return;
let i;
for (i = 0; i < result[0].length; i++) {
_card = result[0][i] _card = result[0][i]
if (Math.abs(card.x - _card.x) <= 50) { if (Math.abs(card.x - _card.x) <= 50) {
result[1][result[1].indexOf(card)] = _card; result[1][result[1].indexOf(card)] = _card;
@ -128,7 +125,7 @@ GraphicsBox {
let i, j; let i, j;
let card, box, pos, pile; let card, box, pos, pile;
let spacing let spacing
for (j = 0; j < 2; j++){ for (j = 0; j < pilecards.length; j++){
pile = areaRepeater.itemAt(j); pile = areaRepeater.itemAt(j);
if (pile.y === 0){ if (pile.y === 0){
pile.y = j * 150 pile.y = j * 150
@ -150,19 +147,6 @@ GraphicsBox {
refreshPrompt(); refreshPrompt();
} }
function initializeCards() {
for (i = 0; i < pilecards.length; i++) {
card = cardItem.itemAt(i);
if (i < pilecards.length) {
result[0].push(card);
} else {
result[1].push(card);
}
}
arrangeCards();
}
function refreshPrompt() { function refreshPrompt() {
root.title.text = Util.processPrompt(lcall("YuqiPrompt", Yuqi_type, card_data, extra_data)) root.title.text = Util.processPrompt(lcall("YuqiPrompt", Yuqi_type, card_data, extra_data))
} }