Compare commits
190 Commits
Author | SHA1 | Date | |
---|---|---|---|
119c8c87ee | |||
2758b4d896 | |||
d8c7f0ad56 | |||
0d8b51f199 | |||
6e296edf11 | |||
072066ac87 | |||
a359dea603 | |||
29decd4899 | |||
92a5d53d35 | |||
40e33dcb1c | |||
![]() |
2b2757ccff | ||
f57f4097ac | |||
5865441074 | |||
2d916392c1 | |||
dec3b2261f | |||
5b0cb912e4 | |||
5cbdaa7134 | |||
b2f59431a6 | |||
04ec214714 | |||
196b56ab71 | |||
226742776f | |||
f4ec2ee5fa | |||
f33d37cd90 | |||
2394ec7f5d | |||
8baa61b72c | |||
f35ea79475 | |||
46b8ca0b63 | |||
b8cfaf308d | |||
c7d3e5021c | |||
a689b425ca | |||
9bd45157a4 | |||
![]() |
169b8997ec | ||
![]() |
aa6ea882d9 | ||
![]() |
c86b275096 | ||
![]() |
a81985549e | ||
![]() |
f4e9409afa | ||
6647e5bd37 | |||
64b7c25de5 | |||
7c562228c6 | |||
91a194c948 | |||
50a30331e5 | |||
![]() |
da47941564 | ||
![]() |
6e999f92a0 | ||
f4fc0ef3c5 | |||
![]() |
2dc8dc734b | ||
![]() |
98663240de | ||
ba782c85d4 | |||
dea067b21f | |||
d56c73e2a3 | |||
5d208d1220 | |||
47a3a1c7ab | |||
56059b4f4f | |||
09577d5403 | |||
fb77f9432a | |||
0f70405041 | |||
399888f976 | |||
a8a0a14713 | |||
59af1e468d | |||
0d1bad5551 | |||
7eb2ff1624 | |||
72351ba60f | |||
7dc2dcc9db | |||
5b4a7d784d | |||
1d8d199af7 | |||
c4e29dc000 | |||
72ec031f8a | |||
2300b8d5db | |||
7ec81ab146 | |||
cf3ffeb8c6 | |||
118a7fe0f1 | |||
005c68cc5b | |||
70f390c5d7 | |||
65de82a227 | |||
a2494b59f7 | |||
b05269712a | |||
740463f017 | |||
![]() |
30521d068e | ||
c7898401ce | |||
d169de9a9e | |||
74ddb428ee | |||
ba4837f1f8 | |||
cdf25f6b6f | |||
e630c53c9f | |||
db13f82bfc | |||
63ebaa5df8 | |||
7b886ea251 | |||
436c4d809c | |||
6ab7bac20b | |||
![]() |
7f852ffb8e | ||
69e68810ba | |||
a63f79230b | |||
3b01c62ed2 | |||
cdc69d23b9 | |||
92a15afabf | |||
277e265bf1 | |||
473163e7c6 | |||
f1eb40bb0d | |||
6c23915615 | |||
d0361c29aa | |||
9ee1239341 | |||
a2a74980bf | |||
01c7f7d528 | |||
a9c8a667ec | |||
bcfb23a8fb | |||
111a98a916 | |||
784163d816 | |||
ce2a6533f2 | |||
17275e194a | |||
9664c9f11d | |||
8b1e4a3d1a | |||
e7347a1a26 | |||
a4cf38dd71 | |||
c018b23913 | |||
0c003616cb | |||
7bfd6517a7 | |||
42e5c94601 | |||
cd25afe0c7 | |||
302e4e327d | |||
52317d8d5a | |||
757bb2dd95 | |||
3be6550593 | |||
![]() |
f79764dbb5 | ||
![]() |
61a598d7e3 | ||
dc61940e3c | |||
086c4da557 | |||
d79b50527e | |||
4a91e5a6bd | |||
8db5fd1efd | |||
![]() |
d22ba331d9 | ||
![]() |
cc20e81ebf | ||
0dac9051f7 | |||
![]() |
78106ee726 | ||
b708cff0cd | |||
aa075f5f91 | |||
8d42ddee10 | |||
2a3100c822 | |||
97bc9d8f6a | |||
f2c4bfb7d3 | |||
d84f8036f7 | |||
16a57f38d3 | |||
88031a79d0 | |||
a36ce1af0f | |||
397ec8472b | |||
160b49d752 | |||
fd515b18cf | |||
5c7c64ea6c | |||
64626ad065 | |||
8a65120e47 | |||
150e3a1132 | |||
fbe53a7a0b | |||
641d130a72 | |||
6313373283 | |||
f70e61c686 | |||
7d19876072 | |||
74613a809d | |||
60e54b1c91 | |||
c860180564 | |||
f0885a1fee | |||
641a4b0006 | |||
fec144cb64 | |||
c6b2c0ea65 | |||
8c42aca027 | |||
d84a34b268 | |||
![]() |
eb6f15f078 | ||
![]() |
bd7aac6fcf | ||
346a68ddb4 | |||
e8736c997a | |||
![]() |
5d383ad72f | ||
![]() |
0ec942275e | ||
![]() |
24a38cbdf4 | ||
c0a798ba93 | |||
d930e3ee11 | |||
![]() |
3dbfa76de9 | ||
8634d37977 | |||
f2a923a654 | |||
5737a967b3 | |||
5f80a270c1 | |||
e3664f577e | |||
46eb1ee6b1 | |||
a43744c89d | |||
12d7dde2e7 | |||
![]() |
69068fad63 | ||
![]() |
2975ef0b49 | ||
0871238e59 | |||
5f2755f5bb | |||
746254c348 | |||
c43b73db3f | |||
af40aed3f3 | |||
![]() |
ea013737f6 | ||
79d4b266b8 |
32
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: Build project
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- Source/**
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- Source/**
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup MSBuild.exe
|
||||||
|
uses: microsoft/setup-msbuild@v1.1.3
|
||||||
|
|
||||||
|
- name: Build release
|
||||||
|
run: msbuild Source/GrasscutterTools.sln /p:Configuration=Release /t:build /restore
|
||||||
|
|
||||||
|
- name: Upload build artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: GrasscutterTools
|
||||||
|
path: Source/GrasscutterTools/bin/Release/GrasscutterTools.exe
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 40 KiB |
BIN
Doc/Screenshots-en/15-DropEditor.png
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
Doc/Screenshots-en/16-MailEditor.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
Doc/Screenshots-en/17-ShopEditor.png
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
Doc/Screenshots-en/18-TaskPage.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
Doc/Screenshots-en/19-AchievementPage.png
Normal file
After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 181 KiB |
Before Width: | Height: | Size: 268 KiB |
BIN
Doc/Screenshots-ru/1-Home.png
Normal file
After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 80 KiB |
BIN
Doc/Screenshots-ru/10-Mail.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
Doc/Screenshots-ru/11-Quests.png
Normal file
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 150 KiB |
BIN
Doc/Screenshots-ru/12-Scenes.png
Normal file
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 258 KiB |
BIN
Doc/Screenshots-ru/13-Shop.png
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
Doc/Screenshots-ru/14-Gachas.png
Normal file
After Width: | Height: | Size: 95 KiB |
BIN
Doc/Screenshots-ru/15-Drops.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
Doc/Screenshots-ru/16-Textmaps.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
Doc/Screenshots-ru/18-TaskPage.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
Doc/Screenshots-ru/19-AchievementPage.png
Normal file
After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 162 KiB |
BIN
Doc/Screenshots-ru/2-Opencommand.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
Doc/Screenshots-ru/3-Custom.png
Normal file
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 165 KiB |
BIN
Doc/Screenshots-ru/4-Artifacts.png
Normal file
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 206 KiB |
Before Width: | Height: | Size: 280 KiB |
BIN
Doc/Screenshots-ru/5-Spawn.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
Doc/Screenshots-ru/6-Give.png
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 239 KiB |
Before Width: | Height: | Size: 253 KiB |
BIN
Doc/Screenshots-ru/7-Character.png
Normal file
After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 132 KiB |
BIN
Doc/Screenshots-ru/8-Weapons.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
Doc/Screenshots-ru/9-Accounts.png
Normal file
After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 143 KiB |
BIN
Doc/Screenshots-tw/0-Home.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
Doc/Screenshots-tw/1-CustomCommands.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
Doc/Screenshots-tw/10-GachaBannerEditor.png
Normal file
After Width: | Height: | Size: 136 KiB |
BIN
Doc/Screenshots-tw/11-TextMapBrowser.png
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
Doc/Screenshots-tw/12-Remote.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
Doc/Screenshots-tw/13-Quest.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
Doc/Screenshots-tw/15-DropEditor.png
Normal file
After Width: | Height: | Size: 74 KiB |
BIN
Doc/Screenshots-tw/16-MailEditor.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
Doc/Screenshots-tw/17-ShopEditor.png
Normal file
After Width: | Height: | Size: 86 KiB |
BIN
Doc/Screenshots-tw/18-TaskPage.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
Doc/Screenshots-tw/19-AchievementPage.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
Doc/Screenshots-tw/2-CustomArtifact.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
Doc/Screenshots-tw/3-CustomWeapon.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
Doc/Screenshots-tw/4-GiveItem.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
Doc/Screenshots-tw/5-GiveAvatar.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
Doc/Screenshots-tw/6-SpawnEntity.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
Doc/Screenshots-tw/6.1-AttackMod.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
Doc/Screenshots-tw/6.2-AttackInfuse.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
Doc/Screenshots-tw/7-ChangeScene.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
Doc/Screenshots-tw/9-Manage.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
Doc/Screenshots-tw/AttackMod.gif
Normal file
After Width: | Height: | Size: 3.6 MiB |
BIN
Doc/Screenshots-tw/ConfigHttp.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
Doc/Screenshots-tw/GrasscutterLogo.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
Doc/Screenshots-tw/OpenCommand.gif
Normal file
After Width: | Height: | Size: 821 KiB |
BIN
Doc/Screenshots-tw/RunMultipleCommands.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
Doc/Screenshots/15-DropEditor.png
Normal file
After Width: | Height: | Size: 69 KiB |
BIN
Doc/Screenshots/16-MailEditor.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
Doc/Screenshots/17-ShopEditor.png
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
Doc/Screenshots/18-TaskPage.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
Doc/Screenshots/19-AchievementPage.png
Normal file
After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 42 KiB |
BIN
Doc/Screenshots/6.1-AttackMod.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
Doc/Screenshots/6.2-AttackInfuse.png
Normal file
After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 26 KiB |
BIN
Doc/Screenshots/AttackMod.gif
Normal file
After Width: | Height: | Size: 3.6 MiB |
BIN
Doc/Screenshots/RunMultipleCommands.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
87
README.md
@@ -3,60 +3,93 @@
|
|||||||
[](https://github.com/jie65535/GrasscutterCommandGenerator/blob/main/LICENSE)
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/blob/main/LICENSE)
|
||||||
[](https://github.com/jie65535/GrasscutterCommandGenerator/stargazers)
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/stargazers)
|
||||||
[](https://github.com/jie65535/GrasscutterCommandGenerator/releases)
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/releases)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/releases/latest)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/actions/workflows/build.yml)
|
||||||
|
[](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=fBizzp6RwJsIY7gFlmd4L-WG0V3aF8X3&authKey=mTjf%2B7jCIZess1HTRi05e5yi%2FHKA1auMwE8%2FJ960PFWk8WMATST654gWPi4OTHTZ&noverify=0&group_code=835489603)
|
||||||
|
|
||||||
中文 | [English](README_en-US.md) | [Русский](README_ru-RU.md)
|
English | [简体中文](README_zh-cn.md) | [繁體中文](README_zh-tw.md) | [Русский](README_ru-RU.md)
|
||||||
|
|
||||||
## Commands Generator
|
## Commands Generator
|
||||||
|
|
||||||
请从 [Releases](https://github.com/jie65535/GrasscutterCommandGenerator/releases) 中获取最新版本
|
Please download the latest committed automated build from [Action](https://github.com/jie65535/GrasscutterCommandGenerator/actions/workflows/build.yml), or a release from [Releases](https://github.com/jie65535/GrasscutterCommandGenerator/releases) (may be behind)
|
||||||
|
|
||||||
本工具支持 简中, 繁中, English 与 Русский 等语言。
|
Support 简体中文, 繁體中文, English and Русский languages.
|
||||||
|
|
||||||
## 远程执行
|
> **Warning**: app look may be different rather than on screenshots. It may also contain translation errors and a lack of certain resources. **We're welcome everyone to contribute to their [improvement](/Source/GrasscutterTools/Resources/en-us)**
|
||||||
|
|
||||||
服务端需要 [gc-opencommand-plugin](https://github.com/jie65535/gc-opencommand-plugin) 插件支持
|
## Update log
|
||||||
|
|
||||||
|
### GrasscutterTools-v1.9
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.8
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.3
|
||||||
|

|
||||||
|
|
||||||
|
Added [AttackModifier](https://github.com/NotThorny/AttackModifier), [AttackInfusedWithItem](https://github.com/snoobi-seggs/AttackInfusedWithItem), [SwitchElementTraveller](https://github.com/Penelopeep/SwitchElementTraveller) plugins command generation
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.2
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.1
|
||||||
|
- Gadgets(CHS Only)
|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.0
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Remote command
|
||||||
|
|
||||||
|
The server require [gc-opencommand-plugin](https://github.com/jie65535/gc-opencommand-plugin) support
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> 如果你无法连接到服务器,请确认填写的服务器地址是否正确。
|
> If you cannot connect to the server, please make sure the server address is correct.
|
||||||
>
|
>
|
||||||
> 建议配置服务器为HTTP模式,如图所示(config.json):
|
> It is recommended to configure the server to HTTP mode, as shown in the figure(config.json):
|
||||||
> 
|
> 
|
||||||
>
|
>
|
||||||
> 你可以用浏览器访问 http://127.0.0.1/status/server 来测试服务是否正常工作。
|
> You can visit http://127.0.0.1/status/server with a browser to test whether the service is working properly.
|
||||||
>
|
>
|
||||||
> 如果使用的不是`80`端口,则要在url中指定访问的端口号:http://127.0.0.1:443
|
> If you are not using port `80`, specify the port number to access in the url: http://127.0.0.1:443
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 软件截图
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|
|
||||||
|
@@ -1,62 +0,0 @@
|
|||||||
# Grasscutter Tools
|
|
||||||
|
|
||||||
[](https://github.com/jie65535/GrasscutterCommandGenerator/blob/main/LICENSE)
|
|
||||||
[](https://github.com/jie65535/GrasscutterCommandGenerator/stargazers)
|
|
||||||
[](https://github.com/jie65535/GrasscutterCommandGenerator/releases)
|
|
||||||
|
|
||||||
[中文](README.md) | English | [Русский](README_ru-RU.md)
|
|
||||||
|
|
||||||
## Commands Generator
|
|
||||||
|
|
||||||
Please download the latest version from [Releases](https://github.com/jie65535/GrasscutterCommandGenerator/releases)
|
|
||||||
|
|
||||||
Support 简中, 繁中, English and Русский languages.
|
|
||||||
|
|
||||||
## Remote command
|
|
||||||
|
|
||||||
The server require [gc-opencommand-plugin](https://github.com/jie65535/gc-opencommand-plugin) support
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
> If you cannot connect to the server, please make sure the server address is correct.
|
|
||||||
>
|
|
||||||
> It is recommended to configure the server to HTTP mode, as shown in the figure(config.json):
|
|
||||||
> 
|
|
||||||
>
|
|
||||||
> You can visit http://127.0.0.1/status/server with a browser to test whether the service is working properly.
|
|
||||||
>
|
|
||||||
> If you are not using port `80`, specify the port number to access in the url: http://127.0.0.1:443
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Screenshots
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
@@ -3,30 +3,63 @@
|
|||||||
[](https://github.com/jie65535/GrasscutterCommandGenerator/blob/main/LICENSE)
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/blob/main/LICENSE)
|
||||||
[](https://github.com/jie65535/GrasscutterCommandGenerator/stargazers)
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/stargazers)
|
||||||
[](https://github.com/jie65535/GrasscutterCommandGenerator/releases)
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/releases)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/releases/latest)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/actions/workflows/build.yml)
|
||||||
|
|
||||||
[中文](README.md) | [English](README_en-US.md) | Русский - Перевод Юрий Дворецкий (с исправлениями от EgorBron)
|
[English](README.md) | [简体中文](README_zh-cn.md) | [繁體中文](README_zh-tw.md) | Русский - Перевод [Юрий Дворецкий](https://github.com/yurikenjx) (с исправлениями от [EgorBron](https://github.com/EgorBron))
|
||||||
|
|
||||||
## Генератор команд
|
## Генератор команд (GCG)
|
||||||
|
|
||||||
Пожалуйста, загрузите последнюю версию из вкладки [Releases](https://github.com/jie65535/GrasscutterCommandGenerator/releases)
|
Пожалуйста, загрузите последнюю подтвержденную автоматизированную сборку из [Action](https://github.com/jie65535/GrasscutterCommandGenerator/actions/workflows/build.yml) или выпуск из [Releases](https://github.com/jie65535/GrasscutterCommandGenerator/releases) (может отставать)
|
||||||
|
|
||||||
Поддерживает 简中 (китайский упр.), 繁中 (китайский трад.), English (английский) и Русский языки.
|
GCG поддерживает 简体中文 (китайский упр.), 繁體中文 (китайский трад.), English (английский) и Русский языки.
|
||||||
|
|
||||||
## Удаленная команда
|
> **Warning**: вид приложения может отличаться от скриншотов. Также в нём могут присутствовать ошибки в переводе и отсутсвие некоторых ресурсов. **Мы приглашаем всех сделать вклад в их [улучшение](/Source/GrasscutterTools/Resources/ru-ru)**
|
||||||
|
|
||||||
Для этого серверу требуется плагин [gc-opencommand-plugin](https://github.com/jie65535/gc-opencommand-plugin)
|
## Лог обновлений
|
||||||
|
|
||||||
|
### GrasscutterTools-v1.9
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.8
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.3
|
||||||
|

|
||||||
|
|
||||||
|
Добавлена поддержка генерации команд для плагинов [AttackModifier](https://github.com/NotThorny/AttackModifier), [AttackInfusedWithItem](https://github.com/snoobi-seggs/AttackInfusedWithItem), [SwitchElementTraveller](https://github.com/Penelopeep/SwitchElementTraveller).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.2
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.1
|
||||||
|
- Гаджеты (пока что только на китайском)
|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.0
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Удаленная команда (OpenCommand)
|
||||||
|
|
||||||
|
Чтобы использовать команды прямо из GCG, серверу требуется плагин [gc-opencommand-plugin](https://github.com/jie65535/gc-opencommand-plugin).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> Если вы не можете подключиться к серверу, проверьте правильность написания его URL-адреса.
|
> Если вы не можете подключиться к серверу, проверьте правильность написания его URL-адреса.
|
||||||
>
|
>
|
||||||
> Рекомендуется изменить секцию HTTP в конфиге как на скриншоте ниже (в файле config.json):
|
> Рекомендуется изменить секцию HTTP в конфиге как на скриншоте ниже (конфиг - файл config.json):
|
||||||
>
|
>
|
||||||
> 
|
> 
|
||||||
>
|
>
|
||||||
> Для проверки можете посетить http://127.0.0.1/status/server в браузере, чтобы проверить работоспособность.
|
> Для проверки можете посетить http://127.0.0.1/status/server в браузере, чтобы проверить работоспособность OpenCommand.
|
||||||
>
|
>
|
||||||
> Если вы не указали порт `80` в конфиге, вам нужно указать его в URL-адресе: http://127.0.0.1:443
|
> Если вы не указали порт `80` в конфиге, вам нужно указать свой порт в URL-адресе (например, http://127.0.0.1:443)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -34,30 +67,34 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
98
README_zh-cn.md
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
# Grasscutter Tools
|
||||||
|
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/blob/main/LICENSE)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/stargazers)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/releases)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/releases/latest)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/actions/workflows/build.yml)
|
||||||
|
[](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=fBizzp6RwJsIY7gFlmd4L-WG0V3aF8X3&authKey=mTjf%2B7jCIZess1HTRi05e5yi%2FHKA1auMwE8%2FJ960PFWk8WMATST654gWPi4OTHTZ&noverify=0&group_code=835489603)
|
||||||
|
|
||||||
|
[English](README.md) | 简体中文 | [繁體中文](README_zh-tw.md) | [Русский](README_ru-RU.md)
|
||||||
|
|
||||||
|
## Commands Generator
|
||||||
|
|
||||||
|
请从 [Action](https://github.com/jie65535/GrasscutterCommandGenerator/actions/workflows/build.yml) 中下载最新提交的自动构建版本,或者从 [Releases](https://github.com/jie65535/GrasscutterCommandGenerator/releases) 中下载发布版本(可能落后)
|
||||||
|
|
||||||
|
本工具支持 简体中文, 繁體中文, English 与 Русский 语言。
|
||||||
|
|
||||||
|
> **Warning**: 应用程序的外观可能与截图上的不同。它也可能包含翻译错误和缺乏某些资源。**我们欢迎各位为此工具做出贡献并<a href="./Source/GrasscutterTools/Resources/zh-cn">改进</a> : )**
|
||||||
|
|
||||||
|
## Update log
|
||||||
|
|
||||||
|
### GrasscutterTools-v1.9
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.8
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.3
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
新增[攻击修改](https://github.com/NotThorny/AttackModifier)、[攻击注入](https://github.com/snoobi-seggs/AttackInfusedWithItem)、[切换元素](https://github.com/Penelopeep/SwitchElementTraveller)等插件命令生成
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.2
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.1
|
||||||
|
- 增加了 Gadgets
|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.0
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 远程执行
|
||||||
|
|
||||||
|
服务端需要 [gc-opencommand-plugin](https://github.com/jie65535/gc-opencommand-plugin) 插件支持
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
> 如果你无法连接到服务器,请确认填写的服务器地址是否正确。
|
||||||
|
>
|
||||||
|
> 建议配置服务器为HTTP模式,如图所示(config.json):
|
||||||
|
> 
|
||||||
|
>
|
||||||
|
> 你可以用浏览器访问 http://127.0.0.1/status/server 来测试服务是否正常工作。
|
||||||
|
>
|
||||||
|
> 如果使用的不是`80`端口,则要在url中指定访问的端口号:http://127.0.0.1:443
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 软件截图
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
99
README_zh-tw.md
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
# Grasscutter Tools
|
||||||
|
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/blob/main/LICENSE)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/stargazers)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/releases)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/releases/latest)
|
||||||
|
[](https://github.com/jie65535/GrasscutterCommandGenerator/actions/workflows/build.yml)
|
||||||
|
[](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=fBizzp6RwJsIY7gFlmd4L-WG0V3aF8X3&authKey=mTjf%2B7jCIZess1HTRi05e5yi%2FHKA1auMwE8%2FJ960PFWk8WMATST654gWPi4OTHTZ&noverify=0&group_code=835489603)
|
||||||
|
|
||||||
|
[English](README.md) | [简体中文](README_zh-cn.md) | 繁體中文 | [Русский](README_ru-RU.md)
|
||||||
|
|
||||||
|
## 指令產生工具
|
||||||
|
|
||||||
|
請從 [Action](https://github.com/jie65535/GrasscutterCommandGenerator/actions/workflows/build.yml) 中下載最新提交的自動構建版本,或者從 [Releases](https://github.com/jie65535/GrasscutterCommandGenerator/releases) 中下載發布版本(可能落後)
|
||||||
|
|
||||||
|
本工具支援 简体中文、繁體中文、English 及 Русский 上述語言。
|
||||||
|
|
||||||
|
> **Warning**: 程式中的實際外觀可能會與截圖中的內容不同。其中也可能包含翻譯錯誤及缺乏特定資源。**我們歡迎各位為此工具做出貢獻並[改進](/Source/GrasscutterTools/Resources/zh-tw)**
|
||||||
|
|
||||||
|
## 更新日誌
|
||||||
|
|
||||||
|
### GrasscutterTools-v1.9
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.8
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.3
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
新增 [攻擊修改](https://github.com/NotThorny/AttackModifier)、[攻擊注入](https://github.com/snoobi-seggs/AttackInfusedWithItem)、[主角切換元素](https://github.com/Penelopeep/SwitchElementTraveller)等插件指令產生
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.2
|
||||||
|

|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.1
|
||||||
|
- 新增 Gadgets
|
||||||
|
|
||||||
|
### GrasscutterTools-v1.7.0
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 遠端控制
|
||||||
|
|
||||||
|
伺服器需要安裝 [gc-opencommand-plugin](https://github.com/jie65535/gc-opencommand-plugin) 插件
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
> 如果你無法連接至伺服器,請確認輸入的伺服器位址是否正確。
|
||||||
|
>
|
||||||
|
> 建議將伺服器調整為HTTP模式,如下圖所示(config.json):
|
||||||
|
> 
|
||||||
|
>
|
||||||
|
> 你可藉由任何瀏覽器輸入網址 http://127.0.0.1/status/server 以測試伺服器是否正常運作。
|
||||||
|
>
|
||||||
|
> 如果你並非使用`80`端口, 則須在網址後輸入指定端口: http://127.0.0.1:443
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## 工具截圖
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
@@ -43,6 +43,33 @@
|
|||||||
<setting name="IsTopMost" serializeAs="String">
|
<setting name="IsTopMost" serializeAs="String">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="DropJsonPath" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="DefaultMailSender" serializeAs="String">
|
||||||
|
<value>GrasscutterTools</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="ShopJsonPath" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="MainFormLocation" serializeAs="String">
|
||||||
|
<value>0, 0</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="MainFormSize" serializeAs="String">
|
||||||
|
<value>0, 0</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="BannersJsonPath" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="IsIncludeUID" serializeAs="String">
|
||||||
|
<value>False</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="NavContainerSplitterDistance" serializeAs="String">
|
||||||
|
<value>0</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="ActivityConfigJsonPath" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
</GrasscutterTools.Properties.Settings>
|
</GrasscutterTools.Properties.Settings>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
</configuration>
|
</configuration>
|
@@ -1,186 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
|
|
||||||
namespace GrasscutterTools.Controls
|
|
||||||
{
|
|
||||||
[ToolboxItem(true)]
|
|
||||||
public class TextBoxXP : TextBox
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获得当前进程,以便重绘控件
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="hWnd"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[DllImport("user32.dll")]
|
|
||||||
private static extern IntPtr GetWindowDC(IntPtr hWnd);
|
|
||||||
|
|
||||||
[DllImport("user32.dll")]
|
|
||||||
private static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
|
|
||||||
|
|
||||||
private const int EM_SETCUEBANNER = 0x1501;
|
|
||||||
|
|
||||||
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
|
||||||
private static extern Int32 SendMessage
|
|
||||||
(IntPtr hWnd, int msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 水印文本
|
|
||||||
/// </summary>
|
|
||||||
private string _Watermark = "";
|
|
||||||
|
|
||||||
private float maximum;
|
|
||||||
private float minimum;
|
|
||||||
|
|
||||||
#region 属性
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否启用热点效果
|
|
||||||
/// </summary>
|
|
||||||
[Category("外观")]
|
|
||||||
[Browsable(true)]
|
|
||||||
[Localizable(true)]
|
|
||||||
[Description("获取或设置输入框水印文本")]
|
|
||||||
[DefaultValue("")]
|
|
||||||
public string Watermark
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this._Watermark;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this._Watermark = value;
|
|
||||||
SendMessage(Handle, EM_SETCUEBANNER, 0, _Watermark);
|
|
||||||
this.Invalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否只能输入数字
|
|
||||||
/// </summary>
|
|
||||||
[Category("行为")]
|
|
||||||
[Browsable(true)]
|
|
||||||
[Description("获取或设置TextBox是否只允许输入数字")]
|
|
||||||
[DefaultValue(false)]
|
|
||||||
public bool DigitOnly { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 转为数值
|
|
||||||
/// </summary>
|
|
||||||
public float Number
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (float.TryParse(Text, out float value))
|
|
||||||
return value;
|
|
||||||
else
|
|
||||||
return 0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Category("数据")]
|
|
||||||
[Browsable(true)]
|
|
||||||
[DefaultValue(0)]
|
|
||||||
[Description("指示小数点后位数")]
|
|
||||||
public int DecimalPlaces { get; set; }
|
|
||||||
|
|
||||||
[Category("数据")]
|
|
||||||
[Description("获取或设置限制的最大值")]
|
|
||||||
public float Maximum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return maximum;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
maximum = value;
|
|
||||||
if (minimum > maximum)
|
|
||||||
{
|
|
||||||
minimum = maximum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Category("数据")]
|
|
||||||
[Browsable(true)]
|
|
||||||
[Description("获取或设置限制的最小值")]
|
|
||||||
public float Minimum
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return minimum;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
minimum = value;
|
|
||||||
if (minimum > maximum)
|
|
||||||
{
|
|
||||||
maximum = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion 属性
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public TextBoxXP()
|
|
||||||
: base()
|
|
||||||
{
|
|
||||||
//BorderStyle = BorderStyle.FixedSingle;
|
|
||||||
//Font = Styles.StaticResources.DefaultFont;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnKeyPress(KeyPressEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnKeyPress(e);
|
|
||||||
// 如果只允许输入数字,则判断输入是否为退格或者数字
|
|
||||||
if (DigitOnly)
|
|
||||||
{
|
|
||||||
//IsNumber:指定字符串中位于指定位置的字符是否属于数字类别
|
|
||||||
//IsPunctuation:指定字符串中位于指定位置的字符是否属于标点符号类别
|
|
||||||
//IsControl:指定字符串中位于指定位置的字符是否属于控制字符类别
|
|
||||||
if (!Char.IsNumber(e.KeyChar) && !Char.IsPunctuation(e.KeyChar) && !Char.IsControl(e.KeyChar))
|
|
||||||
{
|
|
||||||
e.Handled = true; //获取或设置一个值,指示是否处理过System.Windows.Forms.Control.KeyPress事件
|
|
||||||
}
|
|
||||||
else if (Char.IsPunctuation(e.KeyChar) && DecimalPlaces > 0)
|
|
||||||
{
|
|
||||||
if (e.KeyChar == '.')
|
|
||||||
{
|
|
||||||
if (Text.LastIndexOf('.') != -1)
|
|
||||||
{
|
|
||||||
e.Handled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
e.Handled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnLeave(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnLeave(e);
|
|
||||||
|
|
||||||
if (DigitOnly)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrWhiteSpace(Text))
|
|
||||||
{
|
|
||||||
if (Number > Maximum)
|
|
||||||
Text = Maximum.ToString("F" + DecimalPlaces);
|
|
||||||
if (Number < Minimum)
|
|
||||||
Text = Minimum.ToString("F" + DecimalPlaces);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -14,8 +14,9 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using GrasscutterTools.DispatchServer.Model;
|
using GrasscutterTools.DispatchServer.Model;
|
||||||
|
@@ -14,8 +14,9 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace GrasscutterTools.DispatchServer.Model
|
namespace GrasscutterTools.DispatchServer.Model
|
||||||
|
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
|
||||||
<Costura />
|
|
||||||
</Weavers>
|
|
346
Source/GrasscutterTools/Forms/FormActivityEditor.Designer.cs
generated
Normal file
@@ -0,0 +1,346 @@
|
|||||||
|
namespace GrasscutterTools.Forms
|
||||||
|
{
|
||||||
|
partial class FormActivityEditor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormActivityEditor));
|
||||||
|
this.BtnSave = new System.Windows.Forms.Button();
|
||||||
|
this.BtnLoad = new System.Windows.Forms.Button();
|
||||||
|
this.ActivityConfigJsonPath = new System.Windows.Forms.TextBox();
|
||||||
|
this.LblActivityConfigJsonPath = new System.Windows.Forms.Label();
|
||||||
|
this.GrpAllActivity = new System.Windows.Forms.GroupBox();
|
||||||
|
this.ListAllActivity = new System.Windows.Forms.ListView();
|
||||||
|
this.ColumnActivityId = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.ColumnActivityName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.GrpFileActivity = new System.Windows.Forms.GroupBox();
|
||||||
|
this.ListActivityConfigItems = new System.Windows.Forms.ListView();
|
||||||
|
this.ColActivityId = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.ColActivityTitle = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.ColActivityBeginTime = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.ColActivityEndTime = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.GrpActivityInfo = new System.Windows.Forms.GroupBox();
|
||||||
|
this.LblActivityTitle = new System.Windows.Forms.Label();
|
||||||
|
this.LblActivityParmEditTip = new System.Windows.Forms.Label();
|
||||||
|
this.BtnDelete = new System.Windows.Forms.Button();
|
||||||
|
this.BtnAddOrUpdate = new System.Windows.Forms.Button();
|
||||||
|
this.DTPEndTime = new System.Windows.Forms.DateTimePicker();
|
||||||
|
this.DTPBeginTime = new System.Windows.Forms.DateTimePicker();
|
||||||
|
this.TxtMeetCondList = new System.Windows.Forms.TextBox();
|
||||||
|
this.NUDScheduleId = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.NUDActivityType = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.NUDActivityId = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.LblEndTime = new System.Windows.Forms.Label();
|
||||||
|
this.LblBeginTime = new System.Windows.Forms.Label();
|
||||||
|
this.LblMeetCondList = new System.Windows.Forms.Label();
|
||||||
|
this.LblScheduleId = new System.Windows.Forms.Label();
|
||||||
|
this.LblActivityType = new System.Windows.Forms.Label();
|
||||||
|
this.LblActivityId = new System.Windows.Forms.Label();
|
||||||
|
this.GrpAllActivity.SuspendLayout();
|
||||||
|
this.GrpFileActivity.SuspendLayout();
|
||||||
|
this.GrpActivityInfo.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.NUDScheduleId)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.NUDActivityType)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.NUDActivityId)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// BtnSave
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.BtnSave, "BtnSave");
|
||||||
|
this.BtnSave.Name = "BtnSave";
|
||||||
|
this.BtnSave.UseVisualStyleBackColor = true;
|
||||||
|
this.BtnSave.Click += new System.EventHandler(this.BtnSave_Click);
|
||||||
|
//
|
||||||
|
// BtnLoad
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.BtnLoad, "BtnLoad");
|
||||||
|
this.BtnLoad.Name = "BtnLoad";
|
||||||
|
this.BtnLoad.UseVisualStyleBackColor = true;
|
||||||
|
this.BtnLoad.Click += new System.EventHandler(this.BtnLoad_Click);
|
||||||
|
//
|
||||||
|
// ActivityConfigJsonPath
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.ActivityConfigJsonPath, "ActivityConfigJsonPath");
|
||||||
|
this.ActivityConfigJsonPath.Name = "ActivityConfigJsonPath";
|
||||||
|
//
|
||||||
|
// LblActivityConfigJsonPath
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.LblActivityConfigJsonPath, "LblActivityConfigJsonPath");
|
||||||
|
this.LblActivityConfigJsonPath.Name = "LblActivityConfigJsonPath";
|
||||||
|
//
|
||||||
|
// GrpAllActivity
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.GrpAllActivity, "GrpAllActivity");
|
||||||
|
this.GrpAllActivity.Controls.Add(this.ListAllActivity);
|
||||||
|
this.GrpAllActivity.Name = "GrpAllActivity";
|
||||||
|
this.GrpAllActivity.TabStop = false;
|
||||||
|
//
|
||||||
|
// ListAllActivity
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.ListAllActivity, "ListAllActivity");
|
||||||
|
this.ListAllActivity.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||||
|
this.ColumnActivityId,
|
||||||
|
this.ColumnActivityName});
|
||||||
|
this.ListAllActivity.FullRowSelect = true;
|
||||||
|
this.ListAllActivity.HideSelection = false;
|
||||||
|
this.ListAllActivity.MultiSelect = false;
|
||||||
|
this.ListAllActivity.Name = "ListAllActivity";
|
||||||
|
this.ListAllActivity.UseCompatibleStateImageBehavior = false;
|
||||||
|
this.ListAllActivity.View = System.Windows.Forms.View.Details;
|
||||||
|
this.ListAllActivity.SelectedIndexChanged += new System.EventHandler(this.ListAllActivity_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// ColumnActivityId
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.ColumnActivityId, "ColumnActivityId");
|
||||||
|
//
|
||||||
|
// ColumnActivityName
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.ColumnActivityName, "ColumnActivityName");
|
||||||
|
//
|
||||||
|
// GrpFileActivity
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.GrpFileActivity, "GrpFileActivity");
|
||||||
|
this.GrpFileActivity.Controls.Add(this.ListActivityConfigItems);
|
||||||
|
this.GrpFileActivity.Name = "GrpFileActivity";
|
||||||
|
this.GrpFileActivity.TabStop = false;
|
||||||
|
//
|
||||||
|
// ListActivityConfigItems
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.ListActivityConfigItems, "ListActivityConfigItems");
|
||||||
|
this.ListActivityConfigItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||||
|
this.ColActivityId,
|
||||||
|
this.ColActivityTitle,
|
||||||
|
this.ColActivityBeginTime,
|
||||||
|
this.ColActivityEndTime});
|
||||||
|
this.ListActivityConfigItems.FullRowSelect = true;
|
||||||
|
this.ListActivityConfigItems.HideSelection = false;
|
||||||
|
this.ListActivityConfigItems.MultiSelect = false;
|
||||||
|
this.ListActivityConfigItems.Name = "ListActivityConfigItems";
|
||||||
|
this.ListActivityConfigItems.UseCompatibleStateImageBehavior = false;
|
||||||
|
this.ListActivityConfigItems.View = System.Windows.Forms.View.Details;
|
||||||
|
this.ListActivityConfigItems.SelectedIndexChanged += new System.EventHandler(this.ListActivityConfigItems_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// ColActivityId
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.ColActivityId, "ColActivityId");
|
||||||
|
//
|
||||||
|
// ColActivityTitle
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.ColActivityTitle, "ColActivityTitle");
|
||||||
|
//
|
||||||
|
// ColActivityBeginTime
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.ColActivityBeginTime, "ColActivityBeginTime");
|
||||||
|
//
|
||||||
|
// ColActivityEndTime
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.ColActivityEndTime, "ColActivityEndTime");
|
||||||
|
//
|
||||||
|
// GrpActivityInfo
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.GrpActivityInfo, "GrpActivityInfo");
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.LblActivityTitle);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.LblActivityParmEditTip);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.BtnDelete);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.BtnAddOrUpdate);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.DTPEndTime);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.DTPBeginTime);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.TxtMeetCondList);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.NUDScheduleId);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.NUDActivityType);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.NUDActivityId);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.LblEndTime);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.LblBeginTime);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.LblMeetCondList);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.LblScheduleId);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.LblActivityType);
|
||||||
|
this.GrpActivityInfo.Controls.Add(this.LblActivityId);
|
||||||
|
this.GrpActivityInfo.Name = "GrpActivityInfo";
|
||||||
|
this.GrpActivityInfo.TabStop = false;
|
||||||
|
//
|
||||||
|
// LblActivityTitle
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.LblActivityTitle, "LblActivityTitle");
|
||||||
|
this.LblActivityTitle.AutoEllipsis = true;
|
||||||
|
this.LblActivityTitle.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||||
|
this.LblActivityTitle.Name = "LblActivityTitle";
|
||||||
|
//
|
||||||
|
// LblActivityParmEditTip
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.LblActivityParmEditTip, "LblActivityParmEditTip");
|
||||||
|
this.LblActivityParmEditTip.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||||
|
this.LblActivityParmEditTip.Name = "LblActivityParmEditTip";
|
||||||
|
//
|
||||||
|
// BtnDelete
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.BtnDelete, "BtnDelete");
|
||||||
|
this.BtnDelete.Name = "BtnDelete";
|
||||||
|
this.BtnDelete.UseVisualStyleBackColor = true;
|
||||||
|
this.BtnDelete.Click += new System.EventHandler(this.BtnDelete_Click);
|
||||||
|
//
|
||||||
|
// BtnAddOrUpdate
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.BtnAddOrUpdate, "BtnAddOrUpdate");
|
||||||
|
this.BtnAddOrUpdate.Name = "BtnAddOrUpdate";
|
||||||
|
this.BtnAddOrUpdate.UseVisualStyleBackColor = true;
|
||||||
|
this.BtnAddOrUpdate.Click += new System.EventHandler(this.BtnAddOrUpdate_Click);
|
||||||
|
//
|
||||||
|
// DTPEndTime
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.DTPEndTime, "DTPEndTime");
|
||||||
|
this.DTPEndTime.Name = "DTPEndTime";
|
||||||
|
//
|
||||||
|
// DTPBeginTime
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.DTPBeginTime, "DTPBeginTime");
|
||||||
|
this.DTPBeginTime.Name = "DTPBeginTime";
|
||||||
|
//
|
||||||
|
// TxtMeetCondList
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.TxtMeetCondList, "TxtMeetCondList");
|
||||||
|
this.TxtMeetCondList.Name = "TxtMeetCondList";
|
||||||
|
//
|
||||||
|
// NUDScheduleId
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.NUDScheduleId, "NUDScheduleId");
|
||||||
|
this.NUDScheduleId.Maximum = new decimal(new int[] {
|
||||||
|
2147483647,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.NUDScheduleId.Name = "NUDScheduleId";
|
||||||
|
//
|
||||||
|
// NUDActivityType
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.NUDActivityType, "NUDActivityType");
|
||||||
|
this.NUDActivityType.Maximum = new decimal(new int[] {
|
||||||
|
2147483647,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.NUDActivityType.Name = "NUDActivityType";
|
||||||
|
//
|
||||||
|
// NUDActivityId
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.NUDActivityId, "NUDActivityId");
|
||||||
|
this.NUDActivityId.Maximum = new decimal(new int[] {
|
||||||
|
2147483647,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.NUDActivityId.Name = "NUDActivityId";
|
||||||
|
this.NUDActivityId.ValueChanged += new System.EventHandler(this.NUDActivityId_ValueChanged);
|
||||||
|
//
|
||||||
|
// LblEndTime
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.LblEndTime, "LblEndTime");
|
||||||
|
this.LblEndTime.Name = "LblEndTime";
|
||||||
|
//
|
||||||
|
// LblBeginTime
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.LblBeginTime, "LblBeginTime");
|
||||||
|
this.LblBeginTime.Name = "LblBeginTime";
|
||||||
|
//
|
||||||
|
// LblMeetCondList
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.LblMeetCondList, "LblMeetCondList");
|
||||||
|
this.LblMeetCondList.Name = "LblMeetCondList";
|
||||||
|
//
|
||||||
|
// LblScheduleId
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.LblScheduleId, "LblScheduleId");
|
||||||
|
this.LblScheduleId.Name = "LblScheduleId";
|
||||||
|
//
|
||||||
|
// LblActivityType
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.LblActivityType, "LblActivityType");
|
||||||
|
this.LblActivityType.Name = "LblActivityType";
|
||||||
|
//
|
||||||
|
// LblActivityId
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.LblActivityId, "LblActivityId");
|
||||||
|
this.LblActivityId.Name = "LblActivityId";
|
||||||
|
//
|
||||||
|
// FormActivityEditor
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this, "$this");
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Controls.Add(this.GrpAllActivity);
|
||||||
|
this.Controls.Add(this.GrpActivityInfo);
|
||||||
|
this.Controls.Add(this.GrpFileActivity);
|
||||||
|
this.Controls.Add(this.BtnSave);
|
||||||
|
this.Controls.Add(this.BtnLoad);
|
||||||
|
this.Controls.Add(this.ActivityConfigJsonPath);
|
||||||
|
this.Controls.Add(this.LblActivityConfigJsonPath);
|
||||||
|
this.Name = "FormActivityEditor";
|
||||||
|
this.GrpAllActivity.ResumeLayout(false);
|
||||||
|
this.GrpFileActivity.ResumeLayout(false);
|
||||||
|
this.GrpActivityInfo.ResumeLayout(false);
|
||||||
|
this.GrpActivityInfo.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.NUDScheduleId)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.NUDActivityType)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.NUDActivityId)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button BtnSave;
|
||||||
|
private System.Windows.Forms.Button BtnLoad;
|
||||||
|
private System.Windows.Forms.TextBox ActivityConfigJsonPath;
|
||||||
|
private System.Windows.Forms.Label LblActivityConfigJsonPath;
|
||||||
|
private System.Windows.Forms.GroupBox GrpAllActivity;
|
||||||
|
private System.Windows.Forms.GroupBox GrpFileActivity;
|
||||||
|
private System.Windows.Forms.GroupBox GrpActivityInfo;
|
||||||
|
private System.Windows.Forms.ListView ListAllActivity;
|
||||||
|
private System.Windows.Forms.Label LblEndTime;
|
||||||
|
private System.Windows.Forms.Label LblBeginTime;
|
||||||
|
private System.Windows.Forms.Label LblMeetCondList;
|
||||||
|
private System.Windows.Forms.Label LblScheduleId;
|
||||||
|
private System.Windows.Forms.Label LblActivityType;
|
||||||
|
private System.Windows.Forms.Label LblActivityId;
|
||||||
|
private System.Windows.Forms.Button BtnDelete;
|
||||||
|
private System.Windows.Forms.Button BtnAddOrUpdate;
|
||||||
|
private System.Windows.Forms.DateTimePicker DTPEndTime;
|
||||||
|
private System.Windows.Forms.DateTimePicker DTPBeginTime;
|
||||||
|
private System.Windows.Forms.TextBox TxtMeetCondList;
|
||||||
|
private System.Windows.Forms.NumericUpDown NUDScheduleId;
|
||||||
|
private System.Windows.Forms.NumericUpDown NUDActivityType;
|
||||||
|
private System.Windows.Forms.NumericUpDown NUDActivityId;
|
||||||
|
private System.Windows.Forms.Label LblActivityParmEditTip;
|
||||||
|
private System.Windows.Forms.Label LblActivityTitle;
|
||||||
|
private System.Windows.Forms.ColumnHeader ColumnActivityId;
|
||||||
|
private System.Windows.Forms.ColumnHeader ColumnActivityName;
|
||||||
|
private System.Windows.Forms.ListView ListActivityConfigItems;
|
||||||
|
private System.Windows.Forms.ColumnHeader ColActivityId;
|
||||||
|
private System.Windows.Forms.ColumnHeader ColActivityTitle;
|
||||||
|
private System.Windows.Forms.ColumnHeader ColActivityBeginTime;
|
||||||
|
private System.Windows.Forms.ColumnHeader ColActivityEndTime;
|
||||||
|
}
|
||||||
|
}
|
310
Source/GrasscutterTools/Forms/FormActivityEditor.cs
Normal file
@@ -0,0 +1,310 @@
|
|||||||
|
/**
|
||||||
|
* Grasscutter Tools
|
||||||
|
* Copyright (C) 2023 jie65535
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published
|
||||||
|
* by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
using GrasscutterTools.Game;
|
||||||
|
using GrasscutterTools.Game.Activity;
|
||||||
|
using GrasscutterTools.Properties;
|
||||||
|
using GrasscutterTools.Utils;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace GrasscutterTools.Forms
|
||||||
|
{
|
||||||
|
public partial class FormActivityEditor : Form
|
||||||
|
{
|
||||||
|
#region - 成员 -
|
||||||
|
|
||||||
|
private List<ActivityConfigItem> ActivityConfigItems = new List<ActivityConfigItem>();
|
||||||
|
|
||||||
|
#endregion - 成员 -
|
||||||
|
|
||||||
|
#region - 构造与窗体事件 -
|
||||||
|
|
||||||
|
public FormActivityEditor()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
Icon = Resources.IconGrasscutter;
|
||||||
|
|
||||||
|
DTPBeginTime.Value = DateTime.Today;
|
||||||
|
DTPEndTime.Value = DateTime.Today.AddMonths(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnLoad(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnLoad(e);
|
||||||
|
LoadAllActivity();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 加载文件路径
|
||||||
|
var path = Settings.Default.ActivityConfigJsonPath;
|
||||||
|
ActivityConfigJsonPath.Text = path;
|
||||||
|
if (!string.IsNullOrEmpty(path) && File.Exists(path))
|
||||||
|
LoadActivityConfig(path);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.ToString(), Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnFormClosed(FormClosedEventArgs e)
|
||||||
|
{
|
||||||
|
Settings.Default.ActivityConfigJsonPath = ActivityConfigJsonPath.Text;
|
||||||
|
|
||||||
|
base.OnFormClosed(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion - 构造与窗体事件 -
|
||||||
|
|
||||||
|
#region - ActivityConfig.json 文件相关 -
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 加载按钮点击时触发
|
||||||
|
/// </summary>
|
||||||
|
private void BtnLoad_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var path = ActivityConfigJsonPath.Text.Trim();
|
||||||
|
if (path == string.Empty)
|
||||||
|
{
|
||||||
|
var dialog = new OpenFileDialog
|
||||||
|
{
|
||||||
|
FileName = "ActivityConfig.json",
|
||||||
|
Filter = "ActivityConfig.Json (*.json)|*.json|All files (*.*)|*.*",
|
||||||
|
};
|
||||||
|
var result = dialog.ShowDialog();
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
path = ActivityConfigJsonPath.Text = dialog.FileName;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 反序列化
|
||||||
|
LoadActivityConfig(path);
|
||||||
|
MessageBox.Show("OK", Resources.Tips, MessageBoxButtons.OK);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.ToString(), Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 加载活动配置
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">ActivityConfig.json 文件路径</param>
|
||||||
|
private void LoadActivityConfig(string path)
|
||||||
|
{
|
||||||
|
ActivityConfigItems = JsonConvert.DeserializeObject<List<ActivityConfigItem>>(File.ReadAllText(path)) ?? new List<ActivityConfigItem>();
|
||||||
|
ListActivityConfigItems.BeginUpdate();
|
||||||
|
ListActivityConfigItems.Items.Clear();
|
||||||
|
ListActivityConfigItems.Items.AddRange(ActivityConfigItems.Select(Convert).ToArray());
|
||||||
|
ListActivityConfigItems.EndUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ListViewItem Convert(ActivityConfigItem item)
|
||||||
|
{
|
||||||
|
return new ListViewItem(new[]
|
||||||
|
{
|
||||||
|
item.ActivityId.ToString(),
|
||||||
|
GameData.Activity[item.ActivityId],
|
||||||
|
item.BeginTime.ToShortDateString(),
|
||||||
|
item.EndTime.ToShortDateString(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存按钮点击时触发
|
||||||
|
/// </summary>
|
||||||
|
private void BtnSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var path = ActivityConfigJsonPath.Text.Trim();
|
||||||
|
if (path == string.Empty)
|
||||||
|
{
|
||||||
|
var dialog = new SaveFileDialog
|
||||||
|
{
|
||||||
|
FileName = "ActivityConfig.json",
|
||||||
|
Filter = "ActivityConfig.json (*.json)|*.json|All files (*.*)|*.*",
|
||||||
|
};
|
||||||
|
var result = dialog.ShowDialog();
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
path = ActivityConfigJsonPath.Text = dialog.FileName;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 序列化
|
||||||
|
File.WriteAllText(path, JsonConvert.SerializeObject(ActivityConfigItems, Formatting.Indented));
|
||||||
|
MessageBox.Show("OK", Resources.Tips, MessageBoxButtons.OK);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.ToString(), Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion - ActivityConfig.json 文件相关 -
|
||||||
|
|
||||||
|
#region - 活动列表 -
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 加载所有活动
|
||||||
|
/// </summary>
|
||||||
|
private void LoadAllActivity()
|
||||||
|
{
|
||||||
|
ListAllActivity.BeginUpdate();
|
||||||
|
foreach (var grp in GameData.Activity)
|
||||||
|
{
|
||||||
|
var grpControl = ListAllActivity.Groups.Add(grp.Key, grp.Key);
|
||||||
|
for (var i = 0; i < grp.Value.Count; i++)
|
||||||
|
{
|
||||||
|
ListAllActivity.Items.Add(new ListViewItem(new[]
|
||||||
|
{
|
||||||
|
grp.Value.Ids[i].ToString(), grp.Value.Names[i]
|
||||||
|
}, grpControl));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ListAllActivity.EndUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所有活动列表选中项改变时触发
|
||||||
|
/// </summary>
|
||||||
|
private void ListAllActivity_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (ListAllActivity.SelectedItems.Count == 0)
|
||||||
|
return;
|
||||||
|
NUDActivityId.Text = ListAllActivity.SelectedItems[0].Text;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.ToString(), Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 活动ID改变时触发
|
||||||
|
/// </summary>
|
||||||
|
private void NUDActivityId_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// 更新活动名称到提示文本
|
||||||
|
var activityId = (int)NUDActivityId.Value;
|
||||||
|
LblActivityTitle.Text = GameData.Activity[activityId];
|
||||||
|
|
||||||
|
// 检查是否在列表中,允许删除
|
||||||
|
var item = ActivityConfigItems.Find(it => it.ActivityId == activityId);
|
||||||
|
BtnDelete.Enabled = item != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 点击添加或更新按钮时触发
|
||||||
|
/// </summary>
|
||||||
|
private async void BtnAddOrUpdate_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var activityId = (int)NUDActivityId.Value;
|
||||||
|
var isNew = false;
|
||||||
|
var item = ActivityConfigItems.Find(it => it.ActivityId == activityId);
|
||||||
|
if (item == null)
|
||||||
|
{
|
||||||
|
item = new ActivityConfigItem();
|
||||||
|
isNew = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
item.ActivityId = activityId;
|
||||||
|
item.ActivityType = (int)NUDActivityType.Value;
|
||||||
|
item.ScheduleId = (int)NUDScheduleId.Value;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
item.MeetCondList = !string.IsNullOrEmpty(TxtMeetCondList.Text)
|
||||||
|
? TxtMeetCondList.Text.Split(',').Select(it => int.Parse(it.Trim())).ToList()
|
||||||
|
: new List<int>();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
item.MeetCondList = new List<int>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DTPBeginTime.Value > DTPEndTime.Value)
|
||||||
|
{
|
||||||
|
// ?
|
||||||
|
}
|
||||||
|
|
||||||
|
item.BeginTime = DTPBeginTime.Value.Date;
|
||||||
|
item.EndTime = DTPEndTime.Value.Date.AddDays(1).AddSeconds(-1);
|
||||||
|
|
||||||
|
if (isNew)
|
||||||
|
{
|
||||||
|
ActivityConfigItems.Add(item);
|
||||||
|
ListActivityConfigItems.Items.Add(Convert(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
BtnDelete.Enabled = true;
|
||||||
|
await UIUtil.ButtonComplete(BtnAddOrUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 点击删除按钮时触发
|
||||||
|
/// </summary>
|
||||||
|
private void BtnDelete_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var activityId = (int)NUDActivityId.Value;
|
||||||
|
var index = ActivityConfigItems.FindIndex(it => it.ActivityId == activityId);
|
||||||
|
if (index != -1)
|
||||||
|
{
|
||||||
|
ListActivityConfigItems.Items.RemoveAt(index);
|
||||||
|
ActivityConfigItems.RemoveAt(index);
|
||||||
|
}
|
||||||
|
BtnDelete.Enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前文件活动配置列表选中项改变时触发
|
||||||
|
/// </summary>
|
||||||
|
private void ListActivityConfigItems_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (ListActivityConfigItems.SelectedItems.Count == 0)
|
||||||
|
return;
|
||||||
|
var index = ListActivityConfigItems.SelectedIndices[0];
|
||||||
|
var configItem = ActivityConfigItems[index];
|
||||||
|
NUDActivityId.Value = configItem.ActivityId;
|
||||||
|
NUDActivityType.Value = configItem.ActivityType;
|
||||||
|
NUDScheduleId.Value = configItem.ScheduleId;
|
||||||
|
TxtMeetCondList.Text = configItem.MeetCondList?.Count > 0
|
||||||
|
? string.Join(",", configItem.MeetCondList)
|
||||||
|
: string.Empty;
|
||||||
|
DTPBeginTime.Value = configItem.BeginTime;
|
||||||
|
DTPEndTime.Value = configItem.EndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion - 活动列表 -
|
||||||
|
}
|
||||||
|
}
|