FreeKill/qml/Pages/GeneralsOverview.qml
notify cc271bcdf8 Standard equips (#50)
* support fkp

* get default setting in qml

* correct zixing

* mark

* TODO: parse fkp in c++

* scale the drawer

* free assign

* fix free assign bug

* add submodule for official generals

* generate fkp in cpp code

* use UTF-8 in windows conhost

* use onUse for regular skill

* active skill for fkp

* add fkp function; change data for DMG and Heal

* add cancelable to askForDiscard

* don't let generals naked

* config bg and bgm

* fix exists for win

* bugfix: rewardandpunish

* fkp: vs skill

* room config

* observe

* god_salavation

* fkp: judge

* add read storage permission for android build

* remove submodule fk_official

* remove include/

* use a submodule as include directory

* libgit2

* remove debugging 'downloadNewPack'

* libgit2.dll for Windows

* rewrite system_enum, disable dangerous function

* fix bug in trigger()

* filter skill

* filter judgement card

* add about page for git2

* very basic general detail

* FKP: status skill

* libgit: android test

* libgit: build for android

* 1

* libgit2.dll

* android: load qm file after copy asset

* filter skill: if no filter skill then remove filtered card

* allow warning and critical to show a popup, and fix warnings from QML

* resource: move general audio/image to packages/

* move assets of cards

* FKP: modify

* use sqlite db to manage packages

* packman cli

* packman gui

* use Popup for error dialog

* android full screen note

* fix android ssl problem
2023-02-15 19:54:35 +08:00

99 lines
2.4 KiB
QML

import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import "RoomElement"
Item {
id: root
property bool loaded: false
ListView {
width: Math.floor(root.width / 98) * 98
height: parent.height
anchors.centerIn: parent
ScrollBar.vertical: ScrollBar {}
model: ListModel {
id: packages
}
delegate: ColumnLayout {
Text { text: Backend.translate(name) }
GridLayout {
columns: root.width / 98
Repeater {
model: JSON.parse(Backend.callLuaFunction("GetGenerals", [name]))
GeneralCardItem {
autoBack: false
name: modelData
onClicked: {
generalText.clear();
generalText.general = modelData;
generalDetail.open();
}
}
}
}
}
}
Button {
text: Backend.translate("Quit")
anchors.right: parent.right
onClicked: {
mainStack.pop();
}
}
Drawer {
id: generalDetail
edge: Qt.RightEdge
width: parent.width * 0.4 / mainWindow.scale
height: parent.height / mainWindow.scale
dim: false
clip: true
dragMargin: 0
scale: mainWindow.scale
transformOrigin: Item.TopRight
Flickable {
flickableDirection: Flickable.VerticalFlick
contentWidth: generalText.width
contentHeight: generalText.height
width: parent.width * 0.8
height: parent.height * 0.8
clip: true
anchors.centerIn: parent
ScrollBar.vertical: ScrollBar {}
TextEdit {
id: generalText
property string general: ""
width: generalDetail.width * 0.75
readOnly: true
selectByKeyboard: true
selectByMouse: true
wrapMode: TextEdit.WordWrap
textFormat: TextEdit.RichText
font.pixelSize: 16
onGeneralChanged: {
let data = JSON.parse(Backend.callLuaFunction("GetGeneralDetail", [general]));
this.append(Backend.translate(data.kingdom) + " " + Backend.translate(general) + " " + data.hp + "/" + data.maxHp);
data.skill.forEach(t => {
this.append("<b>" + Backend.translate(t.name) + "</b>: " + t.description)
});
}
}
}
}
function loadPackages() {
if (loaded) return;
let packs = JSON.parse(Backend.callLuaFunction("GetAllGeneralPack", []));
packs.forEach((name) => packages.append({ name: name }));
loaded = true;
}
}