parent
beaaa09fbe
commit
9876becf2e
|
@ -45,7 +45,28 @@ Item {
|
|||
ListView {
|
||||
anchors.fill: parent
|
||||
model: modConfig.modList
|
||||
delegate: Text { text: modelData }
|
||||
delegate: SwipeDelegate {
|
||||
width: root.width
|
||||
text: modelData
|
||||
|
||||
swipe.right: Label {
|
||||
id: deleteLabel
|
||||
text: qsTr("Delete")
|
||||
color: "white"
|
||||
verticalAlignment: Label.AlignVCenter
|
||||
padding: 12
|
||||
height: parent.height
|
||||
anchors.right: parent.right
|
||||
opacity: swipe.complete ? 1 : 0
|
||||
Behavior on opacity { NumberAnimation { } }
|
||||
|
||||
SwipeDelegate.onClicked: deleteMod(modelData);
|
||||
|
||||
background: Rectangle {
|
||||
color: deleteLabel.SwipeDelegate.pressed ? Qt.darker("tomato", 1.1) : "tomato"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,4 +131,9 @@ Item {
|
|||
ModBackend.commitChanges(name, "Initial commit", modConfig.userName, modConfig.email);
|
||||
modConfig.addMod(name);
|
||||
}
|
||||
|
||||
function deleteMod(name) {
|
||||
ModBackend.removeMod(name);
|
||||
modConfig.removeMod(name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ Item {
|
|||
anchors.bottom: parent.bottom
|
||||
anchors.leftMargin: 12
|
||||
anchors.bottomMargin: 12
|
||||
text: "FreeKill " + FkVersion
|
||||
text: qsTr("FreeKill") + " v" + FkVersion
|
||||
font.pixelSize: 16
|
||||
font.bold: true
|
||||
}
|
||||
|
@ -188,6 +188,7 @@ Item {
|
|||
text: qsTr("Mod Making")
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
visible: Debugging
|
||||
onClicked: {
|
||||
mainStack.push(modMaker);
|
||||
}
|
||||
|
|
|
@ -59,6 +59,10 @@
|
|||
|
||||
<context>
|
||||
<name>Init</name>
|
||||
<message>
|
||||
<source>FreeKill</source>
|
||||
<translation>新月杀</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Username</source>
|
||||
<translation>用户名</translation>
|
||||
|
@ -227,6 +231,10 @@
|
|||
<source>ModMaker</source>
|
||||
<translation>新月杀Mod制作器 - 首页</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>删除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>config is incomplete</source>
|
||||
<translation>
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -49,10 +49,11 @@ elseif (ANDROID)
|
|||
set(SQLITE3_LIB ${PROJECT_SOURCE_DIR}/lib/android/libsqlite3.so)
|
||||
set(CRYPTO_LIB ${PROJECT_SOURCE_DIR}/lib/android/libcrypto.so)
|
||||
set(SSL_LIB ${PROJECT_SOURCE_DIR}/lib/android/libssl.so)
|
||||
set(SSH_LIB ${PROJECT_SOURCE_DIR}/lib/android/libssh2.so)
|
||||
set(GIT_LIB ${PROJECT_SOURCE_DIR}/lib/android/libgit2.so)
|
||||
set_target_properties(FreeKill PROPERTIES
|
||||
QT_ANDROID_PACKAGE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/android
|
||||
QT_ANDROID_EXTRA_LIBS "${LUA_LIB};${SQLITE3_LIB};${CRYPTO_LIB};${SSL_LIB};${GIT_LIB}"
|
||||
QT_ANDROID_EXTRA_LIBS "${LUA_LIB};${SQLITE3_LIB};${CRYPTO_LIB};${SSL_LIB};${SSH_LIB};${GIT_LIB}"
|
||||
)
|
||||
list(REMOVE_ITEM QT_LIB Qt6::QuickControls2)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
|
||||
|
@ -88,6 +89,7 @@ target_link_libraries(FreeKill PRIVATE
|
|||
${SSL_LIB}
|
||||
${READLINE_LIB}
|
||||
${QT_LIB}
|
||||
${SSH_LIB}
|
||||
${GIT_LIB}
|
||||
${IDBFS_LIB}
|
||||
)
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include <qobject.h>
|
||||
#include <qversionnumber.h>
|
||||
|
||||
#include <openssl/bn.h>
|
||||
|
||||
#include "client_socket.h"
|
||||
#include "packman.h"
|
||||
#include "player.h"
|
||||
|
|
|
@ -125,6 +125,10 @@ void ModMaker::createMod(const QString &name) {
|
|||
init(name);
|
||||
}
|
||||
|
||||
void ModMaker::removeMod(const QString &name) {
|
||||
QDir("mymod/" + name).removeRecursively();
|
||||
}
|
||||
|
||||
void ModMaker::commitChanges(const QString &name, const QString &msg,
|
||||
const QString &user, const QString &email)
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@ public:
|
|||
Q_INVOKABLE void saveToFile(const QString &fileName, const QString &content);
|
||||
|
||||
Q_INVOKABLE void createMod(const QString &name);
|
||||
Q_INVOKABLE void removeMod(const QString &name);
|
||||
Q_INVOKABLE void stageFiles(const QString &name) { add(name); }
|
||||
Q_INVOKABLE void commitChanges(const QString &name, const QString &msg,
|
||||
const QString &user, const QString &email);
|
||||
|
|
Loading…
Reference in New Issue