Skip to content

Commit 44c79b7

Browse files
committed
first commit
0 parents  commit 44c79b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3530
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/workflows/windows.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Windows
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [windows-latest]
16+
include:
17+
- qt_ver: 6.5.3
18+
qt_arch: win64_msvc2019_64
19+
msvc_arch: x64
20+
qt_arch_install: msvc2019_64
21+
env:
22+
targetName: Firefly-Launcher.exe
23+
fileName: Firefly-Launcher
24+
steps:
25+
- name: Check out repository
26+
uses: actions/[email protected]
27+
with:
28+
submodules: recursive
29+
30+
- name: install env
31+
env:
32+
archiveName: ${{ env.fileName }}-${{ matrix.qt_arch }}-${{ matrix.qt_ver }}
33+
msvcArch: ${{ matrix.msvc_arch }}
34+
shell: pwsh
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install pip install "PySide6-Fluent-Widgets" -i https://pypi.org/simple/
38+
pip install PySide6==6.4.2
39+
pip install PySideSix-Frameless-Window>=0.3.1
40+
pip install pyinstaller
41+
42+
- name: package
43+
env:
44+
archiveName: ${{ env.fileName }}-${{ matrix.qt_arch }}-${{ matrix.qt_ver }}
45+
msvcArch: ${{ matrix.msvc_arch }}
46+
shell: pwsh
47+
run: |
48+
pyinstaller -w -i ./src/image/icon.ico ./main.py -n Firefly-Launcher
49+
xcopy /s /e /y src\qss\ dist\Firefly-Launcher\src\qss\
50+
xcopy /s /e /y src\image\ dist\Firefly-Launcher\src\image\
51+
xcopy /s /e /y src\patch\starrail\ dist\Firefly-Launcher\src\patch\starrail\
52+
xcopy /s /e /y src\patch\yuanshen\ dist\Firefly-Launcher\src\patch\yuanshen\
53+
xcopy /s /e /y src\patch\gradle\ dist\Firefly-Launcher\src\patch\gradle\
54+
xcopy /s /e /y src\patch\font\ dist\Firefly-Launcher\src\patch\font\
55+
xcopy /s /e /y config\ dist\Firefly-Launcher\config\
56+
57+
- uses: actions/[email protected]
58+
with:
59+
name: ${{ env.fileName }}
60+
path: dist

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
##
4+
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
5+
6+
__pycache__/
7+
dist/
8+
build/
9+
Firefly-Launcher/
10+
.idea/
11+
.vs/
12+
server/
13+
tool/
14+
temp/
15+
*.spec
16+
auto.json
17+
test/

LICENSE

+674
Large diffs are not rendered by default.

README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Firefly Launcher
2+
## 简介
3+
本软件是一款基于 Pyside6 和 QFluentWidgets 的服务端启动器GUI , 旨在快捷地安装服务端所需环境、一键打开服务端 , 为PS之旅提供一个赏心悦目的操作界面 ~~而不是冰冷的CLI~~
4+
5+
![image](https://github.com/letheriver2007/Firefly-Launcher/assets/77842352/b85f96a0-e185-48d2-b7eb-ae8aa2391bda)
6+
## 计划
7+
详情请见 [Project](https://github.com/letheriver2007/Firefly-Launcher/projects)
8+
## 声明
9+
### 警告
10+
本仓库已开源 , 严禁二次打包发布 , 严禁倒卖 , 违者必究 !!!
11+
### 鸣谢
12+
- [PySide6-Fluent-Widgets](https://github.com/zhiyiYo/PyQt-Fluent-Widgets/tree/PySide6)
13+
## 使用
14+
### 安装
15+
#### 方法一(普通)
16+
从本仓库的 [Release](https://github.com/letheriver2007/Firefly-Launcher/releases) 下载对应操作系统的稳定版本
17+
#### 方法二(进阶)
18+
从本仓库的 [Actions](https://github.com/letheriver2007/Firefly-Launcher/actions/) 下载对应操作系统的开发版本
19+
#### 方法三(开发)
20+
克隆本仓库,从源码构建GUI,目前运行build.bat可一键构建源码(无虚拟环境)
21+
### 构建
22+
解压文件或者构建,以下是构建完成后的文件目录
23+
24+
![image](https://github.com/letheriver2007/Firefly-Launcher/assets/77842352/2118e3a4-afa0-4683-9a1a-ca11084851a7)
25+
### 字体
26+
下载字体文件并安装,[字体文件](https://github.com/letheriver2007/Firefly-Launcher/releases/download/v1.2.0/zh-cn.ttf)
27+
### 配置
28+
#### 配置文件
29+
打开软件->设置->配置->设置配置->打开文件 , 修改合适的代理端口、服务端名称和命令,默认文件见[config.json](https://github.com/letheriver2007/Firefly-Launcher/blob/main/config/config.json)
30+
#### 代理设置
31+
打开软件->设置->代理 , 根据需要调整代理设置
32+
### 下载
33+
#### 官方
34+
前往下载页根据提示下载(仅支持Fiddler、Mitmdump、Lunarcore)
35+
36+
![image](https://github.com/letheriver2007/Firefly-Launcher/assets/77842352/8def8337-81b7-436c-9f65-1d939357201a)
37+
#### 本地
38+
根据需要可以自行下载文件后放入相应文件夹内
39+
### 启动
40+
#### 第一步
41+
选择合适的服务端后点击一键启动
42+
#### 第二步(可选)
43+
对于部分需要额外启动代理软件的 , 如Fiddler、Mitmdump , 打开软件->设置->代理 , 选择相应软件后打开即可
44+
#### 第三步(可选)
45+
对于关闭服务端后存在未关闭代理设置的 , 打开软件->设置->代理->重置代理->重置 , 可一键关闭

app/config_interface.py

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
import os
2+
import subprocess
3+
from PySide6.QtWidgets import QWidget, QVBoxLayout, QLabel, QStackedWidget
4+
from PySide6.QtCore import Qt
5+
from qfluentwidgets import FluentIcon as FIF
6+
from qfluentwidgets import (Pivot, qrouter, ScrollArea, SettingCardGroup,
7+
PrimaryPushSettingCard, InfoBar, InfoBarPosition)
8+
from src.component.style_sheet import StyleSheet
9+
10+
11+
class Config(ScrollArea):
12+
Nav = Pivot
13+
def __init__(self, text: str, parent=None):
14+
super().__init__(parent=parent)
15+
self.parent = parent
16+
self.setObjectName(text.replace(' ', '-'))
17+
self.scrollWidget = QWidget()
18+
self.vBoxLayout = QVBoxLayout(self.scrollWidget)
19+
20+
# 栏定义
21+
self.pivot = self.Nav(self)
22+
self.stackedWidget = QStackedWidget(self)
23+
24+
# 添加项 , 名字会隐藏
25+
self.LauncherInterface = SettingCardGroup('配置', self.scrollWidget)
26+
self.settingConfigCard = PrimaryPushSettingCard(
27+
'打开文件',
28+
FIF.LABEL,
29+
'启动器设置',
30+
'自定义启动器配置'
31+
)
32+
self.personalConfigCard = PrimaryPushSettingCard(
33+
'打开文件',
34+
FIF.LABEL,
35+
'个性化',
36+
'自定义个性化配置'
37+
)
38+
self.LunarCoreInterface = SettingCardGroup('LunarCore', self.scrollWidget)
39+
self.bannersConfigCard = PrimaryPushSettingCard(
40+
'打开文件',
41+
FIF.LABEL,
42+
'Banners',
43+
'LunarCore的跃迁配置'
44+
)
45+
46+
self.__initWidget()
47+
48+
def __initWidget(self):
49+
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) # 水平滚动条关闭
50+
self.setViewportMargins(20, 0, 20, 20)
51+
self.setWidget(self.scrollWidget)
52+
self.setWidgetResizable(True) # 必须设置!!!
53+
54+
# 使用qss设置样式
55+
self.scrollWidget.setObjectName('scrollWidget')
56+
StyleSheet.SETTING_INTERFACE.apply(self)
57+
58+
self.__initLayout()
59+
self.__connectSignalToSlot()
60+
61+
def __initLayout(self):
62+
# 项绑定到栏目
63+
self.LauncherInterface.addSettingCard(self.settingConfigCard)
64+
self.LauncherInterface.addSettingCard(self.personalConfigCard)
65+
self.LunarCoreInterface.addSettingCard(self.bannersConfigCard)
66+
67+
# 目前无法做到导航栏各个页面独立分组 , 故隐藏组标题
68+
self.LauncherInterface.titleLabel.setHidden(True)
69+
self.LunarCoreInterface.titleLabel.setHidden(True)
70+
71+
# 栏绑定界面
72+
self.addSubInterface(self.LauncherInterface, 'LauncherInterface','启动器', icon=FIF.PLAY)
73+
self.addSubInterface(self.LunarCoreInterface, 'LunarCoreInterface','LunarCore', icon=FIF.TAG)
74+
75+
# 初始化配置界面
76+
self.vBoxLayout.addWidget(self.pivot, 0, Qt.AlignLeft)
77+
self.vBoxLayout.addWidget(self.stackedWidget)
78+
self.vBoxLayout.setSpacing(28)
79+
self.vBoxLayout.setContentsMargins(0, 10, 10, 0)
80+
self.stackedWidget.currentChanged.connect(self.onCurrentIndexChanged)
81+
self.stackedWidget.setCurrentWidget(self.LauncherInterface)
82+
self.pivot.setCurrentItem(self.LauncherInterface.objectName())
83+
qrouter.setDefaultRouteKey(self.stackedWidget, self.LauncherInterface.objectName())
84+
85+
def __connectSignalToSlot(self):
86+
self.settingConfigCard.clicked.connect(lambda: self.open_file('config/config.json'))
87+
self.personalConfigCard.clicked.connect(lambda: self.open_file('config/auto.json'))
88+
self.bannersConfigCard.clicked.connect(lambda: self.open_file('server/lunarcore/data/banners.json'))
89+
90+
def addSubInterface(self, widget: QLabel, objectName, text, icon=None):
91+
widget.setObjectName(objectName)
92+
self.stackedWidget.addWidget(widget)
93+
self.pivot.addItem(
94+
icon=icon,
95+
routeKey=objectName,
96+
text=text,
97+
onClick=lambda: self.stackedWidget.setCurrentWidget(widget)
98+
)
99+
100+
def onCurrentIndexChanged(self, index):
101+
widget = self.stackedWidget.widget(index)
102+
self.pivot.setCurrentItem(widget.objectName())
103+
qrouter.push(self.stackedWidget, widget.objectName())
104+
105+
def open_file(self, file_path):
106+
if os.path.exists(file_path):
107+
subprocess.run(['start', file_path], shell=True)
108+
else:
109+
InfoBar.error(
110+
title="找不到文件,请重新下载!",
111+
content="",
112+
orient=Qt.Horizontal,
113+
isClosable=True,
114+
position=InfoBarPosition.TOP,
115+
duration=3000,
116+
parent=self
117+
)

0 commit comments

Comments
 (0)