2023-04-09 13:35:35 +08:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-09-14 13:01:10 +08:00
|
|
|
import QtQuick
|
2022-03-23 19:40:28 +08:00
|
|
|
import "../../skin-bank.js" as SkinBank
|
|
|
|
|
|
|
|
Image {
|
2022-04-30 15:27:56 +08:00
|
|
|
property string value: "unknown"
|
|
|
|
property var options: ["unknown", "loyalist", "rebel", "renegade"]
|
2022-03-23 19:40:28 +08:00
|
|
|
|
2022-04-30 15:27:56 +08:00
|
|
|
id: root
|
|
|
|
source: visible ? SkinBank.ROLE_DIR + value : ""
|
|
|
|
visible: value != "hidden"
|
2022-03-23 19:40:28 +08:00
|
|
|
|
2022-04-30 15:27:56 +08:00
|
|
|
Image {
|
|
|
|
property string value: "unknown"
|
2022-03-23 19:40:28 +08:00
|
|
|
|
2022-04-30 15:27:56 +08:00
|
|
|
id: assumptionBox
|
|
|
|
source: SkinBank.ROLE_DIR + value
|
|
|
|
visible: root.value == "unknown"
|
2022-03-23 19:40:28 +08:00
|
|
|
|
2023-03-18 15:34:42 +08:00
|
|
|
TapHandler {
|
|
|
|
onTapped: optionPopupBox.visible = true;
|
2022-03-23 19:40:28 +08:00
|
|
|
}
|
2022-04-30 15:27:56 +08:00
|
|
|
}
|
2022-03-23 19:40:28 +08:00
|
|
|
|
2022-04-30 15:27:56 +08:00
|
|
|
Column {
|
|
|
|
id: optionPopupBox
|
|
|
|
visible: false
|
|
|
|
spacing: 2
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
model: options
|
|
|
|
|
|
|
|
Image {
|
|
|
|
source: SkinBank.ROLE_DIR + modelData
|
|
|
|
|
2023-03-18 15:34:42 +08:00
|
|
|
TapHandler {
|
|
|
|
onTapped: {
|
2022-04-30 15:27:56 +08:00
|
|
|
optionPopupBox.visible = false;
|
|
|
|
assumptionBox.value = modelData;
|
|
|
|
}
|
2022-03-23 19:40:28 +08:00
|
|
|
}
|
2022-04-30 15:27:56 +08:00
|
|
|
}
|
2022-03-23 19:40:28 +08:00
|
|
|
}
|
2022-04-30 15:27:56 +08:00
|
|
|
}
|
2022-03-23 19:40:28 +08:00
|
|
|
}
|