Compare commits

...

3 Commits

Author SHA1 Message Date
Mechanel
bb1edddddf SkillButton Detail 2024-06-10 02:11:41 +08:00
Mechanel
f0bb15cf0a BanPackages limit width 2024-06-10 01:01:31 +08:00
Mechanel
2ca68e061a enable selected_targets of ActiveSkillPrompt 2024-06-10 01:01:04 +08:00
3 changed files with 51 additions and 2 deletions

View File

@ -184,6 +184,12 @@ Item {
return ret; return ret;
} }
delegate: Text { delegate: Text {
width: parent.width / 2
wrapMode: Text.WordWrap
fontSizeMode: Text.HorizontalFit
minimumPixelSize: 14
elide: Text.ElideRight
height: 24
text: luatr(modelData) text: luatr(modelData)
font.pixelSize: 16 font.pixelSize: 16
} }

View File

@ -718,6 +718,15 @@ function updateSelectedTargets(playerid, selected) {
} }
if (candidate) { if (candidate) {
roomScene.resetPrompt(); // update prompt due to selected_targets
const prompt = lcall("ActiveSkillPrompt",
dashboard.pending_skill !== "" ? dashboard.pending_skill: lcall("GetCardSkill", card),
dashboard.pending_skill !== "" ? dashboard.pendings : [card],
selected_targets);
if (prompt !== "") {
roomScene.setPrompt(Util.processPrompt(prompt));
}
all_photos.forEach(photo => { all_photos.forEach(photo => {
if (photo.selected) return; if (photo.selected) return;
const id = photo.playerid; const id = photo.playerid;

View File

@ -2,6 +2,7 @@
import QtQuick import QtQuick
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import QtQuick.Controls
Item { Item {
id: root id: root
@ -86,7 +87,40 @@ Item {
} }
TapHandler { TapHandler {
enabled: root.type !== "notactive" && root.enabled acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.NoButton
onTapped: parent.pressed = !parent.pressed; onTapped: (p, btn) => {
if ((btn === Qt.LeftButton || btn === Qt.NoButton) && root.type !== "notactive" && root.enabled) {
parent.pressed = !parent.pressed;
} else if (btn === Qt.RightButton) {
skillDetail.open();
}
}
}
Popup {
id: skillDetail
x: Math.round((parent.width - width) / 2)
y: Math.round((parent.height - height) / 2)
property string text: ""
width: Math.min(contentWidth, realMainWin.width * 0.4)
height: Math.min(contentHeight + 24, realMainWin.height * 0.9)
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
padding: 12
background: Rectangle {
color: "#EEEEEEEE"
radius: 5
border.color: "#A6967A"
border.width: 1
}
contentItem: Text {
text: "<b>" + luatr(orig) + "</b>: " + luatr(":" + orig)
font.pixelSize: 20
wrapMode: Text.WordWrap
textFormat: TextEdit.RichText
TapHandler {
onTapped: skillDetail.close();
}
}
} }
} }