mirror of
https://github.com/octopusYan/dayz-mod-translator.git
synced 2025-12-13 11:41:57 +08:00
first commit
This commit is contained in:
3
src/main/resources/application.properties
Normal file
3
src/main/resources/application.properties
Normal file
@ -0,0 +1,3 @@
|
||||
app.name=${project.name}
|
||||
app.title=DayZ\u6A21\u7EC4\u6C49\u5316\u5DE5\u5177
|
||||
app.version=${project.version}
|
||||
9
src/main/resources/css/main-view.css
Normal file
9
src/main/resources/css/main-view.css
Normal file
@ -0,0 +1,9 @@
|
||||
#root{
|
||||
-fx-background-color: white;
|
||||
}
|
||||
|
||||
#dragFileLabel {
|
||||
-fx-font-family: "Microsoft YaHei";
|
||||
-fx-text-fill: black;
|
||||
-fx-font-size: 20;
|
||||
}
|
||||
10
src/main/resources/css/root.css
Normal file
10
src/main/resources/css/root.css
Normal file
@ -0,0 +1,10 @@
|
||||
.box_class {
|
||||
-fx-background-radius: 5;
|
||||
-fx-border-style: solid;
|
||||
-fx-border-color: rgba(136, 136, 136, 0.5);
|
||||
-fx-background-color: white;
|
||||
}
|
||||
|
||||
.conf_menu_item {
|
||||
-fx-pref-width: 100;
|
||||
}
|
||||
73
src/main/resources/fxml/main-view.fxml
Normal file
73
src/main/resources/fxml/main-view.fxml
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<VBox fx:id="root" minHeight="330" minWidth="430" prefHeight="430.0" prefWidth="700" stylesheets="@../css/main-view.css"
|
||||
xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="cn.octopusyan.dayzmodtranslator.controller.MainController">
|
||||
<MenuBar>
|
||||
<Menu mnemonicParsing="false" text="文件">
|
||||
<MenuItem fx:id="openFileSetupBtn" mnemonicParsing="false" styleClass="conf_menu_item" text="打开"/>
|
||||
<SeparatorMenuItem/>
|
||||
<MenuItem onAction="#onDestroy" mnemonicParsing="false" styleClass="conf_menu_item" text="退出"/>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="设置">
|
||||
<MenuItem fx:id="translateSetupBtn" mnemonicParsing="false" styleClass="conf_menu_item" text="翻译"/>
|
||||
<MenuItem fx:id="proxySetupBtn" mnemonicParsing="false" styleClass="conf_menu_item" text="代理"/>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="帮助">
|
||||
<MenuItem mnemonicParsing="false" styleClass="conf_menu_item" text="关于"/>
|
||||
</Menu>
|
||||
</MenuBar>
|
||||
<HBox alignment="CENTER_LEFT">
|
||||
<Label text="PBO文件:">
|
||||
<HBox.margin>
|
||||
<Insets right="5.0"/>
|
||||
</HBox.margin>
|
||||
</Label>
|
||||
<Label fx:id="filePath"/>
|
||||
<HBox HBox.hgrow="ALWAYS"/>
|
||||
<HBox>
|
||||
<Button fx:id="translateWordBtn" text="一键翻译" visible="false"/>
|
||||
<Button fx:id="packBtn" text="打包" visible="false">
|
||||
<HBox.margin>
|
||||
<Insets left="5"/>
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
</HBox>
|
||||
<VBox.margin>
|
||||
<Insets bottom="5.0" top="5.0"/>
|
||||
</VBox.margin>
|
||||
<padding>
|
||||
<Insets left="5.0" right="5.0"/>
|
||||
</padding>
|
||||
</HBox>
|
||||
<SplitPane dividerPositions="0.3" prefHeight="${root.height}">
|
||||
<StackPane fx:id="fileBox" SplitPane.resizableWithParent="false" maxWidth="420" minWidth="210">
|
||||
<VBox fx:id="openFileBox" alignment="CENTER" styleClass="box_class">
|
||||
<Button fx:id="openFile" text="打开文件"/>
|
||||
<Label style="-fx-text-fill: rgba(136,136,136,0.7)" text="或将 pbo文件 拖到此处">
|
||||
<VBox.margin>
|
||||
<Insets top="10.0"/>
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
</VBox>
|
||||
<VBox fx:id="dragFileBox" alignment="CENTER" styleClass="box_class" visible="false">
|
||||
<Label fx:id="dragFileLabel" alignment="CENTER" prefHeight="-Infinity" text="将文件拖放到此处"
|
||||
textAlignment="CENTER"/>
|
||||
</VBox>
|
||||
<VBox fx:id="loadFileBox" alignment="CENTER" styleClass="box_class" visible="false">
|
||||
<Label fx:id="loadFileLabel"/>
|
||||
<ProgressBar fx:id="loadFileProgressBar"/>
|
||||
</VBox>
|
||||
<TreeView fx:id="treeFileBox" styleClass="box_class" visible="false"/>
|
||||
</StackPane>
|
||||
<StackPane fx:id="wordBox" styleClass="box_class" GridPane.columnIndex="1" minWidth="210">
|
||||
<VBox fx:id="wordMsgBox" alignment="CENTER" styleClass="box_class">
|
||||
<Label fx:id="wordMsgLabel"/>
|
||||
<ProgressBar fx:id="loadWordProgressBar" visible="false"/>
|
||||
</VBox>
|
||||
</StackPane>
|
||||
</SplitPane>
|
||||
</VBox>
|
||||
70
src/main/resources/fxml/proxy-view.fxml
Normal file
70
src/main/resources/fxml/proxy-view.fxml
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<StackPane fx:id="root" prefHeight="276.0" prefWidth="260.0" xmlns="http://javafx.com/javafx/17.0.2-ea"
|
||||
xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="cn.octopusyan.dayzmodtranslator.controller.SetupProxyController">
|
||||
<VBox alignment="CENTER_LEFT">
|
||||
<Label alignment="CENTER" prefWidth="Infinity" text="网络代理设置"/>
|
||||
<Label text="Host">
|
||||
<VBox.margin>
|
||||
<Insets top="20"/>
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TextField fx:id="hostField">
|
||||
<VBox.margin>
|
||||
<Insets top="5.0"/>
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<Label text="port">
|
||||
<VBox.margin>
|
||||
<Insets top="15.0"/>
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TextField fx:id="portField">
|
||||
<VBox.margin>
|
||||
<Insets top="5.0"/>
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<Label text="测试地址">
|
||||
<VBox.margin>
|
||||
<Insets top="15.0"/>
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TextField fx:id="testPath">
|
||||
<VBox.margin>
|
||||
<Insets top="5.0"/>
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<VBox alignment="CENTER">
|
||||
<VBox.margin>
|
||||
<Insets top="5.0"/>
|
||||
</VBox.margin>
|
||||
<Button onAction="#test" style="-fx-background-color: transparent; -fx-text-fill: #000FFF"
|
||||
text="网络代理测试"/>
|
||||
</VBox>
|
||||
<HBox alignment="CENTER_RIGHT">
|
||||
<VBox.margin>
|
||||
<Insets top="15.0"/>
|
||||
</VBox.margin>
|
||||
<Button text="确定" onAction="#save">
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="15.0" right="15.0" top="5.0"/>
|
||||
</padding>
|
||||
</Button>
|
||||
<Button text="取消" onAction="#close">
|
||||
<HBox.margin>
|
||||
<Insets left="5.0"/>
|
||||
</HBox.margin>
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="15.0" right="15.0" top="5.0"/>
|
||||
</padding>
|
||||
</Button>
|
||||
</HBox>
|
||||
<StackPane.margin>
|
||||
<Insets left="20.0" right="20.0"/>
|
||||
</StackPane.margin>
|
||||
</VBox>
|
||||
</StackPane>
|
||||
89
src/main/resources/fxml/translate-view.fxml
Normal file
89
src/main/resources/fxml/translate-view.fxml
Normal file
@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<StackPane fx:id="root" prefHeight="155.0" prefWidth="200.0" xmlns="http://javafx.com/javafx/17.0.2-ea"
|
||||
xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="cn.octopusyan.dayzmodtranslator.controller.SetupTranslateController">
|
||||
<VBox alignment="CENTER">
|
||||
<VBox>
|
||||
<Label text="翻译源">
|
||||
<VBox.margin>
|
||||
<Insets right="15.0"/>
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<ComboBox fx:id="translateSourceCombo">
|
||||
<VBox.margin>
|
||||
<Insets top="5.0"/>
|
||||
</VBox.margin>
|
||||
</ComboBox>
|
||||
</VBox>
|
||||
<VBox alignment="CENTER_LEFT">
|
||||
<VBox.margin>
|
||||
<Insets top="15.0"/>
|
||||
</VBox.margin>
|
||||
<Label text="QPS(每秒翻译数量)">
|
||||
<VBox.margin>
|
||||
<Insets right="15.0"/>
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TextField fx:id="qps">
|
||||
<VBox.margin>
|
||||
<Insets top="5.0"/>
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
</VBox>
|
||||
<VBox alignment="CENTER_LEFT" fx:id="appidBox">
|
||||
<VBox.margin>
|
||||
<Insets top="15.0"/>
|
||||
</VBox.margin>
|
||||
<Label text="appid">
|
||||
<VBox.margin>
|
||||
<Insets right="15.0"/>
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TextField fx:id="appid">
|
||||
<VBox.margin>
|
||||
<Insets top="5.0"/>
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
</VBox>
|
||||
<VBox alignment="CENTER_LEFT" fx:id="apikeyBox">
|
||||
<VBox.margin>
|
||||
<Insets top="15.0"/>
|
||||
</VBox.margin>
|
||||
<Label text="apikey">
|
||||
<VBox.margin>
|
||||
<Insets right="15.0"/>
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TextField fx:id="apikey">
|
||||
<VBox.margin>
|
||||
<Insets top="5.0"/>
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
</VBox>
|
||||
<HBox alignment="CENTER_RIGHT">
|
||||
<VBox.margin>
|
||||
<Insets top="15.0"/>
|
||||
</VBox.margin>
|
||||
<Button onAction="#save" text="确定">
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="15.0" right="15.0" top="5.0"/>
|
||||
</padding>
|
||||
</Button>
|
||||
<Button onAction="#onDestroy" text="取消">
|
||||
<HBox.margin>
|
||||
<Insets left="5.0"/>
|
||||
</HBox.margin>
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="15.0" right="15.0" top="5.0"/>
|
||||
</padding>
|
||||
</Button>
|
||||
</HBox>
|
||||
<StackPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0"/>
|
||||
</StackPane.margin>
|
||||
</VBox>
|
||||
</StackPane>
|
||||
98
src/main/resources/logback.xml
Normal file
98
src/main/resources/logback.xml
Normal file
@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
|
||||
<property name="logback.logdir" value="log"/>
|
||||
<property name="CHARSET" value="utf-8"/>
|
||||
<property name="logback.app" value="DayzModTranslator"/>
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN" value="%highlight(%d{HH:mm:ss.SSS}) ${logback.app} %boldYellow([%thread]) %highlight(%-5level) %cyan(%logger{36}) - %mdc{client} [%X{trace_id}] %msg%n"/>
|
||||
|
||||
<!--输出到控制台 ConsoleAppender-->
|
||||
<appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
<charset>${CHARSET}</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!--输出到文件 fileLog-->
|
||||
<appender name="fileLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<!--如果只是想要 Error 级别的日志,那么需要过滤一下,默认是 info 级别的,ThresholdFilter-->
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"/>
|
||||
<File>${logback.logdir}/${logback.app}.info.log</File>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!--文件路径,定义了日志的切分方式——把每一天的日志归档到一个文件中,以防止日志填满整个磁盘空间-->
|
||||
<FileNamePattern>${logback.logdir}/${logback.app}_%d{yyyy-MM-dd}.info.log</FileNamePattern>
|
||||
<!--只保留最近30天的日志-->
|
||||
<maxHistory>30</maxHistory>
|
||||
<!--用来指定日志文件的上限大小,那么到了这个值,就会删除旧的日志-->
|
||||
<totalSizeCap>1GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<!--日志输出编码格式化-->
|
||||
<encoder>
|
||||
<charset>${CHARSET}</charset>
|
||||
<pattern>%d [%thread] %-5level %logger{36} %line - %mdc{client} [%X{trace_id}] %msg%n</pattern>
|
||||
</encoder>
|
||||
<!--只打印错误日志-->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>INFO</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="fileLog-debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<!--如果只是想要 Error 级别的日志,那么需要过滤一下,默认是 info 级别的,ThresholdFilter-->
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"/>
|
||||
<File>${logback.logdir}/${logback.app}.debug.log</File>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!--文件路径,定义了日志的切分方式——把每一天的日志归档到一个文件中,以防止日志填满整个磁盘空间-->
|
||||
<FileNamePattern>${logback.logdir}/${logback.app}_%d{yyyy-MM-dd}.debug.log</FileNamePattern>
|
||||
<!--只保留最近30天的日志-->
|
||||
<maxHistory>30</maxHistory>
|
||||
<!--用来指定日志文件的上限大小,那么到了这个值,就会删除旧的日志-->
|
||||
<totalSizeCap>1GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<!--日志输出编码格式化-->
|
||||
<encoder>
|
||||
<charset>UTF-8</charset>
|
||||
<pattern>%d [%thread] %-5level %logger{36} %line - %mdc{client} [%X{trace_id}] %msg%n</pattern>
|
||||
</encoder>
|
||||
<!--只打印错误日志-->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>DEBUG</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 错误日志 -->
|
||||
<appender name="fileLog-err" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<File>${logback.logdir}/${logback.app}.err.log</File>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<FileNamePattern>${logback.logdir}/${logback.app}_%d{yyyy-MM-dd}.err.log</FileNamePattern>
|
||||
<maxHistory>7</maxHistory>
|
||||
<totalSizeCap>1GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<charset>UTF-8</charset>
|
||||
<pattern>%d [%thread] %-5level %logger{36} %line - %mdc{client} [%X{trace_id}] %msg%n</pattern>
|
||||
</encoder>
|
||||
<!--只打印错误日志-->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>ERROR</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!--指定最基础的日志输出级别-->
|
||||
<root level="INFO">
|
||||
<!--appender将会添加到这个logger-->
|
||||
<appender-ref ref="consoleLog"/>
|
||||
<appender-ref ref="fileLog"/>
|
||||
<appender-ref ref="fileLog-debug"/>
|
||||
<appender-ref ref="fileLog-err"/>
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
BIN
src/main/resources/static/CfgConvert/CfgConvert.exe
Normal file
BIN
src/main/resources/static/CfgConvert/CfgConvert.exe
Normal file
Binary file not shown.
BIN
src/main/resources/static/pboc/Qt6Core.dll
Normal file
BIN
src/main/resources/static/pboc/Qt6Core.dll
Normal file
Binary file not shown.
BIN
src/main/resources/static/pboc/pboc.exe
Normal file
BIN
src/main/resources/static/pboc/pboc.exe
Normal file
Binary file not shown.
Reference in New Issue
Block a user