├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── README.md ├── doc ├── screenshot2.png ├── screenshot3.png └── screenshot4.png ├── patches └── 1622.zip ├── resource ├── GameData │ ├── ActiveTextureManagement │ │ └── ActiveTextureManagerConfigs │ │ │ └── DTS_zh.cfg │ ├── DTS_Addon.dll │ └── DTS_zh │ │ ├── Font.cfg │ │ ├── Hints.cfg │ │ ├── Image │ │ ├── Buttons_TimeMode_StateMap.png │ │ ├── EditorAtlas.png │ │ ├── EditorButtons_stageReset.png │ │ ├── FlightUI_RotQuadrant.png │ │ ├── FlightUI_RotQuadrant_bg.png │ │ ├── GUI_TimeQuadrant.png │ │ ├── Gauge_Atmos.png │ │ ├── Gauge_Gee.png │ │ ├── Gauge_Throttle.png │ │ ├── LED_lin_off.png │ │ ├── LED_lin_on.png │ │ ├── LED_rot_off.png │ │ ├── LED_rot_on.png │ │ ├── RecoveryButton.png │ │ ├── ResearchAndDevelopment.png │ │ ├── StagingQuadrant_Frame.png │ │ ├── StagingQuadrant_bg.png │ │ ├── VesselSpawnDialog.png │ │ ├── flightUI_linearQuadrantFrame_bg.png │ │ ├── gauge_Vs.png │ │ └── navBall_headingPane.png │ │ ├── LanguagePatches.dll │ │ ├── MainMenu.cfg │ │ ├── README.md │ │ ├── System.Regex.dll │ │ ├── cnfont │ │ ├── cn10.fnt.unity3d │ │ ├── cn10.png │ │ ├── cn12.fnt.unity3d │ │ ├── cn12.png │ │ ├── cn14.fnt.unity3d │ │ ├── cn14.png │ │ ├── cn14b.fnt.unity3d │ │ ├── cn14b.png │ │ ├── cn16.fnt.unity3d │ │ ├── cn16.png │ │ ├── cn16b.fnt.unity3d │ │ ├── cn16b.png │ │ └── msyhUIL.assetbundle │ │ ├── en.xml │ │ ├── xSquad │ │ ├── Agents.xml │ │ ├── Contracts.xml │ │ ├── Departments.xml │ │ ├── Parts.xml │ │ ├── README.md │ │ ├── ScienceDefs.xml │ │ ├── StoryDefs.xml │ │ ├── Strategies.xml │ │ ├── TechTree.xml │ │ └── Traits.xml │ │ ├── zh.xml │ │ ├── zhConfig.xml │ │ ├── zhField.xml │ │ ├── zhImage.xml │ │ ├── zhItem.xml │ │ └── zhText.xml ├── KSP_Data │ └── Managed │ │ ├── Assembly-CSharp.dll │ │ ├── DTS_zh.dll │ │ └── README.md ├── KSP_x64_Data │ └── Managed │ │ └── Assembly-CSharp.dll ├── saves │ ├── scenarios │ │ ├── ARM_Asteroid1.sfs │ │ ├── ARM_Asteroid2.sfs │ │ ├── Dynawing Final Approach.sfs │ │ ├── Dynawing Re-entry.sfs │ │ ├── EVA in Kerbin Orbit.sfs │ │ ├── EVA on Duna.sfs │ │ ├── Exploring Gilly.sfs │ │ ├── Impending Impact.sfs │ │ ├── Jool Aerobrake.sfs │ │ ├── Mun Orbit.sfs │ │ ├── Mun Rover.sfs │ │ ├── Powered Landing.sfs │ │ ├── Prospecting Eeloo.sfs │ │ ├── Refuel at Minmus.sfs │ │ ├── Space Station 1.sfs │ │ └── Transmissions.sfs │ └── training │ │ ├── A_VesselConstruction.sfs │ │ ├── B_flightBasics.sfs │ │ ├── B_fmidEditor.sfs │ │ ├── B_fsuborbital.sfs │ │ ├── B_gadvancedConstr.sfs │ │ ├── B_goForOrbit.sfs │ │ ├── C_Orbit101.sfs │ │ ├── D_Science.sfs │ │ ├── E_MunFlight1.sfs │ │ ├── F_MunFlight2.sfs │ │ ├── F_MunFlight3.sfs │ │ ├── G_Docking.sfs │ │ ├── I_Asteroid1.sfs │ │ └── J_Asteroid2.sfs ├── 使用方法.txt └── 版本说明.txt └── src ├── .vs └── KSP_zh │ └── v14 │ └── .suo ├── DTS_Addon ├── DTS_Addon.csproj ├── Properties │ └── AssemblyInfo.cs ├── README.md ├── Scene │ ├── xCredits.cs │ ├── xEditorAny.cs │ ├── xEditorSPH.cs │ ├── xEditorVAB.cs │ ├── xEveryScene.cs │ ├── xFlight.cs │ ├── xInstantly.cs │ ├── xMainMenu.cs │ ├── xPSystemSpawn.cs │ ├── xSettings.cs │ ├── xSpaceCentre.cs │ └── xTrackingStation.cs ├── SuperTool │ ├── ConfigTest.cs │ ├── SuperTools.cs │ ├── Tools.cs │ └── xFontTool.cs ├── VegaTextureReplacer.cs ├── xConfig.cs ├── xImage.cs ├── xItem.cs └── xLoading.cs ├── DTS_zh ├── DTS_zh.csproj ├── Properties │ └── AssemblyInfo.cs ├── README.md ├── TimDebug.cs ├── xDice.cs ├── xField.cs ├── xFont.cs ├── xRead.cs └── xText.cs ├── KSP_zh.sln ├── KSP_zh.v12.suo └── KSP_zh ├── App.config ├── ConvertText.cs ├── ExtractCfg.cs ├── ExtractText.cs ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── KSP_zh.csproj ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── README.md ├── ReferenceProvider.cs └── UpXml.cs /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ####您好,感谢您开issue来反馈信息,在提交前,请确保您已经检查了以下内容! 2 | - [ ] 使用的游戏版本与补丁支持版本相同 3 | - [ ] 补丁文件夹复制位置正确 4 | - [ ] 使用[最新版本](https://github.com/TimChen44/KSP_zh/releases),你的问题可能已经在新版本里解决了。 5 | - [ ] 有没有相同的[issue](https://github.com/TimChen44/KSP_zh/issues) 6 | - [ ] 如果是反馈bug,请上传日志文件(KSP安装文件夹下的KSP.log文件)方便定位问题 7 | 8 | 反馈问题类型 9 | 10 | - [ ] 翻译错误或不完整 11 | 12 | ### 翻译异常位置截图 13 | 14 | - [ ] BUG或其他 15 | 16 | ### 异常情况描述 17 | 18 | ### 重现所需操作 19 | 20 | ### 期望结果 21 | 22 | ### 日志文件链接 23 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ##您好,感谢您开Pull Request来提供帮助,在提交前,请确保您已经检查了以下内容! 2 | - [ ] 没有无用commit(请勿向Git仓库引入奇怪的东西) 3 | - [ ] 同时更新32位和64位翻译文件 4 | - [ ] 更新翻译文件后请打开游戏测试确认基本功能正常 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。 3 | ################################################################################ 4 | 5 | src/DTSDebug 6 | src/DTS_Addon/bin/Debug 7 | src/DTS_Addon/obj/Debug 8 | src/DTS_zh/bin/Debug 9 | src/KSP_zh/bin/Debug 10 | src/KSP_zh/obj/Debug 11 | src/DTS_zh/obj/Debug 12 | src/DTS_Addon/bin/Release 13 | src/DTS_Addon/obj/Release 14 | src/DTS_zh/bin/Release 15 | src/KSP_zh/bin/Release 16 | src/KSP_zh/obj/Release 17 | src/DTS_zh/obj/Release 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KSP_zh 2 | 《坎巴拉太空计划》汉化项目 3 | 4 | #### 官方中文版的已经推出,一个时代的终结,预示着更美好的时代已经到来。 5 | 6 | ### 支持的游戏版本 7 | v1.2.2.1622 32位 8 | 9 | 注:不同版本游戏不支持 10 | 11 | # 手册 12 | ###配置文件相关介绍 13 | 请详见上一版本的介绍[KSP 0.24.2汉化包技术解密](http://bbs.deeptimes.org/forum.php?mod=viewthread&tid=2137227&extra=page%3D2) 14 | 15 | ### 补丁安装方法 16 | 将resource文件夹中的三个文件夹覆盖游戏根目录中同名的三个文件夹。 17 | 18 | ### 汉化截图 19 | **开始界面** 20 | ![alt tag](./doc/screenshot2.png) 21 | 22 | # 感谢 23 | 24 | 现版本汉化中的部分中文资源来自KSP 0.24版汉化,在这里再次感谢0.24版热心网友 25 | 26 | 394966931 Frighter jekiyuan(原总) 光明之门 starikki 作者无敌AA 以及本人 (排名按首字母顺序) 27 | 28 | # 项目许可 29 | 30 | 知识共享许可协议
本汉化项目 采用 知识共享 署名-非商业性使用-相同方式共享 4.0 国际 许可协议进行许可。 31 | -------------------------------------------------------------------------------- /doc/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/doc/screenshot2.png -------------------------------------------------------------------------------- /doc/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/doc/screenshot3.png -------------------------------------------------------------------------------- /doc/screenshot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/doc/screenshot4.png -------------------------------------------------------------------------------- /patches/1622.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/patches/1622.zip -------------------------------------------------------------------------------- /resource/GameData/ActiveTextureManagement/ActiveTextureManagerConfigs/DTS_zh.cfg: -------------------------------------------------------------------------------- 1 | ACTIVE_TEXTURE_MANAGER_CONFIG 2 | { 3 | folder = DTS_zh 4 | enabled = true 5 | filter_mode = Point 6 | make_not_readable = true 7 | compress = false 8 | mipmaps = false 9 | scale = 1 10 | max_size = 0 11 | OVERRIDES 12 | { 13 | DTS_zh/cnfont/.* 14 | { 15 | compress = false 16 | mipmaps = false 17 | scale = 1 18 | max_size = 0 19 | make_not_readable = ture 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /resource/GameData/DTS_Addon.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_Addon.dll -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Font.cfg: -------------------------------------------------------------------------------- 1 | // ************** 2 | // KSP-Deutsch-Patch: KSP ins Deutsche 3 | // Copyright (c) 2016 kerbalspaceprogram.de 4 | // 5 | // Font.cfg: 6 | // Autor: 7 | // ************** 8 | 9 | LANGUAGEPATCHES 10 | { 11 | TMPFONT 12 | { 13 | name = Calibri SDF 14 | file = DTS_zh/cnfont/msyhUIL.assetbundle:msyhUIL SDF 15 | } 16 | TMPFONT 17 | { 18 | name = NotoSansCJKjp-Regular SDF 19 | file = DTS_zh/cnfont/msyhUIL.assetbundle:msyhUIL SDF 20 | } 21 | TMPFONT 22 | { 23 | name = Dotty SDF 24 | file = DTS_zh/cnfont/msyhUIL.assetbundle:msyhUIL SDF 25 | } 26 | } -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Hints.cfg: -------------------------------------------------------------------------------- 1 | // ************** 2 | // KSP-Deutsch-Patch: Übersetzt KSP ins Deutsche 3 | // Copyright (c) 2016 kerbalspaceprogram.de 4 | // 5 | // Hints.cfg: Ersetzt die Tips im Loading-Screen mit unseren Versionen 6 | // Autor: Allan Sche Sar, Thomas P. 7 | // ************** 8 | 9 | LANGUAGEPATCHES 10 | { 11 | HINTS 12 | { 13 | hint = 载入中... 14 | hint = 修正二次曲线... 15 | hint = 将网格叠加至贝塞尔曲线... 16 | hint = 计算轨道中... 17 | hint = 解开扭成一团的安全绳... 18 | hint = 动员宇航员... 19 | hint = 清扫发射台... 20 | hint = 创造更有意思的词条... 21 | hint = 宇航员祈祷中... 22 | hint = 重新招募宇航员... 23 | hint = 计算宇宙终极问题... 24 | hint = 解答宇宙终极问题... 25 | hint = 寻找Jebediah的下落... 26 | hint = 测试弹簧... 27 | hint = 安装更多的推进器... 28 | hint = 给每个词前面都加上"坎"... 29 | hint = 远离危险的火箭... 30 | hint = 打发时间... 31 | hint = 治疗凯斯勒综合症... 32 | hint = 搭载黑科技... 33 | hint = 汉化组正在努力理解Kerbal人的逻辑中... 34 | hint = 你到底装了多少MOD,怎么载入这么慢... 35 | hint = 等待胶水干透... 36 | hint = 努力擦掉望远镜片上那颗灰尘... 37 | hint = 请注意保护视力... 38 | hint = 正在阻止喝醉了的Jeb把自己用火箭喷口打出去... 39 | hint = 正在尝试使用橙汁替代火箭燃料... 40 | hint = 正在驱赶前来索取死亡赔偿的小绿人家属... 41 | hint = 正在阻止试图爬上发射塔自杀的保险公司经理... 42 | hint = 正在训练新进宇航员改掉把食物从鼻子吸进去的恶习... 43 | hint = 正在说服新进宇航员不要认为自己是绿色的就能进行光合作用... 44 | hint = 正在说服某个自称来自地球的家伙这里的第一宇宙速度是2.4km/s... 45 | hint = 正在教育小小绿人们不要立志成为一名宇航员... 46 | hint = 正在统计今日内失踪的宇航员名单... 47 | hint = 据说使用以汉化包为代表的非官方补丁可能导致电脑发生核聚变反应等一系列灾难性后果... 48 | hint = 砖家怀疑贴吧汉化组实际上是外星势力潜入地球的间谍组织... 49 | hint = 警告;如果你使用了GTX690或以上的显卡,请立即退出游戏并向电脑泼水降温以免发生核爆... 50 | } 51 | } -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/Buttons_TimeMode_StateMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/Buttons_TimeMode_StateMap.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/EditorAtlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/EditorAtlas.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/EditorButtons_stageReset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/EditorButtons_stageReset.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/FlightUI_RotQuadrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/FlightUI_RotQuadrant.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/FlightUI_RotQuadrant_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/FlightUI_RotQuadrant_bg.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/GUI_TimeQuadrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/GUI_TimeQuadrant.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/Gauge_Atmos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/Gauge_Atmos.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/Gauge_Gee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/Gauge_Gee.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/Gauge_Throttle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/Gauge_Throttle.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/LED_lin_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/LED_lin_off.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/LED_lin_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/LED_lin_on.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/LED_rot_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/LED_rot_off.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/LED_rot_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/LED_rot_on.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/RecoveryButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/RecoveryButton.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/ResearchAndDevelopment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/ResearchAndDevelopment.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/StagingQuadrant_Frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/StagingQuadrant_Frame.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/StagingQuadrant_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/StagingQuadrant_bg.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/VesselSpawnDialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/VesselSpawnDialog.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/flightUI_linearQuadrantFrame_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/flightUI_linearQuadrantFrame_bg.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/gauge_Vs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/gauge_Vs.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/Image/navBall_headingPane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/Image/navBall_headingPane.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/LanguagePatches.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/LanguagePatches.dll -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/MainMenu.cfg: -------------------------------------------------------------------------------- 1 | // ************** 2 | // KSP-Deutsch-Patch: Übersetzt KSP ins Deutsche 3 | // Copyright (c) 2016 kerbalspaceprogram.de 4 | // 5 | // MainMenu.cfg: Übersetzt die Textbuttons im Hauptmenü 6 | // Autor: Allan Sche Sar, Idinyphe, Thomas P. 7 | // ************** 8 | 9 | LANGUAGEPATCHES 10 | { 11 | TRANSLATION 12 | { 13 | text = (\d)\.(\d)\.(\d)\.(\d*) \(([^\)]*)\) 14 | translation = v @1.@2.@3.@4 ( @5 zh-CN) 15 | scene = MAINMENU 16 | size = 50 17 | } 18 | TRANSLATION 19 | { 20 | text = © <\/size> Squad, 2011 - 2016 21 | translation = © Squad, 2011 - 2016 22 | scene = MAINMENU 23 | size = 40 24 | } 25 | TRANSLATION 26 | { 27 | text = Settings 28 | translation = 设置 29 | scene = MAINMENU 30 | size = 20 31 | } 32 | TRANSLATION 33 | { 34 | text = Addons & Mods 35 | translation = Mod 36 | scene = MAINMENU 37 | size = 20 38 | } 39 | TRANSLATION 40 | { 41 | text = Credits 42 | translation = 制作人员 43 | scene = MAINMENU 44 | size = 20 45 | } 46 | TRANSLATION 47 | { 48 | text = KSP Community 49 | translation = 社区 50 | scene = MAINMENU 51 | size = 20 52 | } 53 | 54 | TRANSLATION 55 | { 56 | text = Quit 57 | translation = 退出 58 | size = 20 59 | } 60 | 61 | TRANSLATION 62 | { 63 | text = Start Game 64 | translation = 开始游戏 65 | scene = MAINMENU 66 | size = 20 67 | } 68 | 69 | TRANSLATION 70 | { 71 | text = Resume Saved 72 | translation = 继续游戏 73 | scene = MAINMENU 74 | size = 20 75 | } 76 | 77 | TRANSLATION 78 | { 79 | text = Scenarios 80 | translation = 场景 81 | scene = MAINMENU 82 | size = 20 83 | } 84 | 85 | TRANSLATION 86 | { 87 | text = Start New 88 | translation = 新游戏 89 | scene = MAINMENU 90 | size = 20 91 | } 92 | 93 | TRANSLATION 94 | { 95 | text = Training 96 | translation = 教程 97 | scene = MAINMENU 98 | size = 20 99 | } 100 | 101 | TRANSLATION 102 | { 103 | text = Back 104 | translation = 退出 105 | scene = MAINMENU 106 | size = 20 107 | } 108 | TRANSLATION 109 | { 110 | text = Load 111 | translation = 加载 112 | } 113 | 114 | TRANSLATION 115 | { 116 | text = Abort 117 | translation = 终止 118 | } 119 | 120 | TRANSLATION 121 | { 122 | text = Delete 123 | translation = 删除 124 | } 125 | TRANSLATION 126 | { 127 | text = Start 128 | translation = 开始 129 | } 130 | } -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/README.md: -------------------------------------------------------------------------------- 1 | #介绍 2 | 3 | 这里放置各类汉化程序需要的资源文件,汉化工作只要对这些文件的补充即可。 4 | 文件均为utf-8编码格式的xml文件。 5 | 6 | ###Image 7 | 8 | 贴图资源 9 | 10 | ###cnfont 11 | 12 | 字库 13 | 14 | ###xSquad 15 | 16 | 资源汉化 17 | 18 | 功能同zhConfig.xml,这里支持创建多个文件便于整理 19 | 20 | ###en.xml 21 | 22 | 原始文本--禁止修改 23 | 24 | ###zh.xml 25 | 26 | 汉化后文本 27 | 28 | ###en_x64.xml 29 | 30 | 原始文本(64位)--禁止修改 31 | 32 | ###zh_x64.xml 33 | 34 | 汉化后文本(64位) 35 | 36 | ###zhConfig.xml 37 | 38 | 资源汉化 39 | 40 | ###zhImage.xml 41 | 42 | 贴图资源配置 43 | 44 | ###zhLoadingTips.xml 45 | 46 | 启动吐槽文件 47 | -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/System.Regex.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/System.Regex.dll -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn10.fnt.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn10.fnt.unity3d -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn10.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn12.fnt.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn12.fnt.unity3d -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn12.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn14.fnt.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn14.fnt.unity3d -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn14.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn14b.fnt.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn14b.fnt.unity3d -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn14b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn14b.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn16.fnt.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn16.fnt.unity3d -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn16.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn16b.fnt.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn16b.fnt.unity3d -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/cn16b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/cn16b.png -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/cnfont/msyhUIL.assetbundle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/GameData/DTS_zh/cnfont/msyhUIL.assetbundle -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/xSquad/Agents.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/xSquad/Contracts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/xSquad/Departments.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/xSquad/README.md: -------------------------------------------------------------------------------- 1 | #介绍 2 | 3 | 此处用于资源汉化所需的文件。 4 | 5 | 文件数量可以根据需要任意建立,通常建议同类的cfg创建一个文件。 6 | 7 | 8 | ###Parts.xml 9 | 10 | 组件内容的汉化 11 | 12 | 汉化的文件:Squad\Parts 13 | 14 | ###ScienceDefs.xml 15 | 16 | 科技探索内容汉化 17 | 18 | 汉化的文件:Squad\Resources\ScienceDefs.cfg 19 | 20 | ###TechTree.xml 21 | 22 | 尚不明确此处条目用于游戏那里 23 | 24 | 汉化的文件:Squad\Resources\TechTree.cfg 25 | 26 | 27 | #xml结构介绍 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/xSquad/Strategies.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/xSquad/Traits.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/zhConfig.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/zhField.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /resource/GameData/DTS_zh/zhImage.xml: -------------------------------------------------------------------------------- 1 |  2 | 1024 3 | 1024 4 | 2048 5 | 256 6 | 128 7 | 256 8 | 256 9 | 256 10 | 256 11 | 256 12 | 256 13 | 256 14 | 256 15 | 512 16 | 64 17 | 64 18 | 64 19 | 64 20 | 256 21 | 256 22 | 256 23 | 256 24 | -------------------------------------------------------------------------------- /resource/KSP_Data/Managed/Assembly-CSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/KSP_Data/Managed/Assembly-CSharp.dll -------------------------------------------------------------------------------- /resource/KSP_Data/Managed/DTS_zh.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/KSP_Data/Managed/DTS_zh.dll -------------------------------------------------------------------------------- /resource/KSP_Data/Managed/README.md: -------------------------------------------------------------------------------- 1 | #文件介绍 2 | 3 | 经过修改的KSP文件,也就是因为这个所以汉化无法跨版本实现。 4 | -------------------------------------------------------------------------------- /resource/KSP_x64_Data/Managed/Assembly-CSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/KSP_x64_Data/Managed/Assembly-CSharp.dll -------------------------------------------------------------------------------- /resource/saves/training/A_VesselConstruction.sfs: -------------------------------------------------------------------------------- 1 | GAME 2 | { 3 | version = 1.0.0 4 | Title = 入门基础火箭建造 5 | Description = 教程由著名火箭专家Wernher von Kerman亲自在装配大楼展示火箭建造的基础知识。他已经在那里等着你了。不要拖拖拉拉 ! 6 | Mode = SANDBOX 7 | // scene to load when starting this save. 8 | scene = 5 9 | flag = Squad/Flags/default 10 | PARAMETERS 11 | { 12 | preset = Custom 13 | EDITOR 14 | { 15 | CanLeaveToSpaceCenter = False 16 | CanLeaveToMainMenu = True 17 | } 18 | FLIGHT 19 | { 20 | CanQuickSave = False 21 | CanQuickLoad = False 22 | CanAutoSave = True 23 | CanUseMap = True 24 | CanSwitchVesselsNear = False 25 | CanSwitchVesselsFar = False 26 | CanTimeWarpHigh = False 27 | CanTimeWarpLow = False 28 | CanEVA = False 29 | CanIVA = True 30 | CanBoard = False 31 | CanRestart = True 32 | CanLeaveToEditor = True 33 | CanLeaveToTrackingStation = False 34 | CanLeaveToSpaceCenter = False 35 | CanLeaveToMainMenu = True 36 | } 37 | SPACECENTER 38 | { 39 | CanGoInVAB = False 40 | CanGoInSPH = False 41 | CanGoInTrackingStation = False 42 | CanLaunchAtPad = False 43 | CanLaunchAtRunway = False 44 | CanLeaveToMainMenu = True 45 | CanGoToRnD = False 46 | CanGoToAstronautC = False 47 | CanGoToAdmin = False 48 | CanGoToMissionControl = False 49 | CanSelectFlag = False 50 | 51 | } 52 | DIFFICULTY 53 | { 54 | MissingCrewsRespawn = True 55 | } 56 | } 57 | SCENARIO 58 | { 59 | // the name of the ScenarioModule class to spawn 60 | name = TutorialEditor 61 | // the scene in which the module gets spawned (7 = flight) 62 | scene = 5, 6 63 | } 64 | FLIGHTSTATE 65 | { 66 | version = 0.22.0 67 | UT = 0.84 68 | activeVessel = 0 69 | } 70 | ROSTER 71 | { 72 | KERBAL 73 | { 74 | name = Jebediah Kerman 75 | gender = Male 76 | type = Crew 77 | trait = Pilot 78 | brave = 0.5 79 | dumb = 0.5 80 | badS = True 81 | tour = False 82 | state = Available 83 | ToD = 0 84 | idx = 0 85 | CAREER_LOG 86 | { 87 | flight = 1 88 | 0 = Recover 89 | } 90 | FLIGHT_LOG 91 | { 92 | flight = 1 93 | } 94 | } 95 | KERBAL 96 | { 97 | name = Bill Kerman 98 | gender = Male 99 | type = Crew 100 | trait = Engineer 101 | brave = 0.5 102 | dumb = 0.8 103 | badS = False 104 | tour = False 105 | state = Available 106 | ToD = 0 107 | idx = -1 108 | CAREER_LOG 109 | { 110 | flight = 0 111 | } 112 | FLIGHT_LOG 113 | { 114 | flight = 0 115 | } 116 | } 117 | KERBAL 118 | { 119 | name = Bob Kerman 120 | gender = Male 121 | type = Crew 122 | trait = Scientist 123 | brave = 0.3 124 | dumb = 0.1 125 | badS = False 126 | tour = False 127 | state = Available 128 | ToD = 0 129 | idx = -1 130 | CAREER_LOG 131 | { 132 | flight = 0 133 | } 134 | FLIGHT_LOG 135 | { 136 | flight = 0 137 | } 138 | } 139 | KERBAL 140 | { 141 | name = Valentina Kerman 142 | gender = Female 143 | type = Crew 144 | trait = Pilot 145 | brave = 0.55 146 | dumb = 0.4 147 | badS = True 148 | tour = False 149 | state = Available 150 | ToD = 0 151 | idx = -1 152 | CAREER_LOG 153 | { 154 | flight = 0 155 | } 156 | FLIGHT_LOG 157 | { 158 | flight = 0 159 | } 160 | } 161 | } 162 | } -------------------------------------------------------------------------------- /resource/saves/training/B_fmidEditor.sfs: -------------------------------------------------------------------------------- 1 | GAME 2 | { 3 | version = 1.0.0 4 | Title = 中级火箭建造 5 | Description = 本教程还是由著名航天科学家Wernher von Kerman亲自指导,介绍如何建造能逃脱Kerbin大气层并安全返回的飞行器。 6 | Mode = SANDBOX 7 | // scene to load when starting this save. 8 | scene = 5 9 | flag = Squad/Flags/default 10 | PARAMETERS 11 | { 12 | preset = Custom 13 | EDITOR 14 | { 15 | CanLeaveToSpaceCenter = False 16 | CanLeaveToMainMenu = True 17 | } 18 | FLIGHT 19 | { 20 | CanQuickSave = False 21 | CanQuickLoad = False 22 | CanAutoSave = True 23 | CanUseMap = True 24 | CanSwitchVesselsNear = False 25 | CanSwitchVesselsFar = False 26 | CanTimeWarpHigh = False 27 | CanTimeWarpLow = False 28 | CanEVA = False 29 | CanIVA = True 30 | CanBoard = False 31 | CanRestart = True 32 | CanLeaveToEditor = True 33 | CanLeaveToTrackingStation = False 34 | CanLeaveToSpaceCenter = False 35 | CanLeaveToMainMenu = True 36 | } 37 | SPACECENTER 38 | { 39 | CanGoInVAB = True 40 | CanGoInSPH = False 41 | CanGoInTrackingStation = False 42 | CanLaunchAtPad = False 43 | CanLaunchAtRunway = False 44 | CanLeaveToMainMenu = True 45 | CanGoToRnD = False 46 | CanGoToAstronautC = False 47 | CanGoToAdmin = False 48 | CanGoToMissionControl = False 49 | CanSelectFlag = False 50 | 51 | } 52 | DIFFICULTY 53 | { 54 | MissingCrewsRespawn = True 55 | } 56 | } 57 | SCENARIO 58 | { 59 | // the name of the ScenarioModule class to spawn 60 | name = TutorialEditorMid 61 | // the scene in which the module gets spawned (7 = flight) 62 | scene = 5, 6 63 | } 64 | FLIGHTSTATE 65 | { 66 | version = 0.22.0 67 | UT = 0.84 68 | activeVessel = 0 69 | } 70 | ROSTER 71 | { 72 | KERBAL 73 | { 74 | name = Jebediah Kerman 75 | gender = Male 76 | type = Crew 77 | trait = Pilot 78 | brave = 0.5 79 | dumb = 0.5 80 | badS = True 81 | tour = False 82 | state = Available 83 | ToD = 0 84 | idx = 0 85 | CAREER_LOG 86 | { 87 | flight = 1 88 | 0 = Recover 89 | } 90 | FLIGHT_LOG 91 | { 92 | flight = 1 93 | } 94 | } 95 | KERBAL 96 | { 97 | name = Bill Kerman 98 | gender = Male 99 | type = Crew 100 | trait = Engineer 101 | brave = 0.5 102 | dumb = 0.8 103 | badS = False 104 | tour = False 105 | state = Available 106 | ToD = 0 107 | idx = -1 108 | CAREER_LOG 109 | { 110 | flight = 0 111 | } 112 | FLIGHT_LOG 113 | { 114 | flight = 0 115 | } 116 | } 117 | KERBAL 118 | { 119 | name = Bob Kerman 120 | gender = Male 121 | type = Crew 122 | trait = Scientist 123 | brave = 0.3 124 | dumb = 0.1 125 | badS = False 126 | tour = False 127 | state = Available 128 | ToD = 0 129 | idx = -1 130 | CAREER_LOG 131 | { 132 | flight = 0 133 | } 134 | FLIGHT_LOG 135 | { 136 | flight = 0 137 | } 138 | } 139 | KERBAL 140 | { 141 | name = Valentina Kerman 142 | gender = Female 143 | type = Crew 144 | trait = Pilot 145 | brave = 0.55 146 | dumb = 0.4 147 | badS = True 148 | tour = False 149 | state = Available 150 | ToD = 0 151 | idx = -1 152 | CAREER_LOG 153 | { 154 | flight = 0 155 | } 156 | FLIGHT_LOG 157 | { 158 | flight = 0 159 | } 160 | } 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /resource/saves/training/B_gadvancedConstr.sfs: -------------------------------------------------------------------------------- 1 | GAME 2 | { 3 | version = 1.0.0 4 | Title = 高级火箭建造 5 | Description = 本教程,由著名火箭专家Wernher von Kerman介绍如何设计可以进入Kerbin轨道并安全返回的飞行器。 6 | Mode = SANDBOX 7 | // scene to load when starting this save. 8 | scene = 5 9 | flag = Squad/Flags/default 10 | PARAMETERS 11 | { 12 | preset = Custom 13 | EDITOR 14 | { 15 | CanLeaveToSpaceCenter = False 16 | CanLeaveToMainMenu = True 17 | } 18 | FLIGHT 19 | { 20 | CanQuickSave = False 21 | CanQuickLoad = False 22 | CanAutoSave = True 23 | CanUseMap = True 24 | CanSwitchVesselsNear = False 25 | CanSwitchVesselsFar = False 26 | CanTimeWarpHigh = False 27 | CanTimeWarpLow = False 28 | CanEVA = False 29 | CanIVA = True 30 | CanBoard = False 31 | CanRestart = True 32 | CanLeaveToEditor = True 33 | CanLeaveToTrackingStation = False 34 | CanLeaveToSpaceCenter = False 35 | CanLeaveToMainMenu = True 36 | } 37 | SPACECENTER 38 | { 39 | CanGoInVAB = True 40 | CanGoInSPH = False 41 | CanGoInTrackingStation = False 42 | CanLaunchAtPad = False 43 | CanLaunchAtRunway = False 44 | CanLeaveToMainMenu = True 45 | CanGoToRnD = False 46 | CanGoToAstronautC = False 47 | CanGoToAdmin = False 48 | CanGoToMissionControl = False 49 | CanSelectFlag = False 50 | 51 | } 52 | DIFFICULTY 53 | { 54 | MissingCrewsRespawn = True 55 | } 56 | } 57 | SCENARIO 58 | { 59 | // the name of the ScenarioModule class to spawn 60 | name = TutorialEditorAdvanced 61 | // the scene in which the module gets spawned (7 = flight) 62 | scene = 5, 6 63 | } 64 | FLIGHTSTATE 65 | { 66 | version = 0.22.0 67 | UT = 0.84 68 | activeVessel = 0 69 | } 70 | ROSTER 71 | { 72 | KERBAL 73 | { 74 | name = Jebediah Kerman 75 | gender = Male 76 | type = Crew 77 | trait = Pilot 78 | brave = 0.5 79 | dumb = 0.5 80 | badS = True 81 | tour = False 82 | state = Available 83 | ToD = 0 84 | idx = 0 85 | CAREER_LOG 86 | { 87 | flight = 1 88 | 0 = Recover 89 | } 90 | FLIGHT_LOG 91 | { 92 | flight = 1 93 | } 94 | } 95 | KERBAL 96 | { 97 | name = Bill Kerman 98 | gender = Male 99 | type = Crew 100 | trait = Engineer 101 | brave = 0.5 102 | dumb = 0.8 103 | badS = False 104 | tour = False 105 | state = Available 106 | ToD = 0 107 | idx = -1 108 | CAREER_LOG 109 | { 110 | flight = 0 111 | } 112 | FLIGHT_LOG 113 | { 114 | flight = 0 115 | } 116 | } 117 | KERBAL 118 | { 119 | name = Bob Kerman 120 | gender = Male 121 | type = Crew 122 | trait = Scientist 123 | brave = 0.3 124 | dumb = 0.1 125 | badS = False 126 | tour = False 127 | state = Available 128 | ToD = 0 129 | idx = -1 130 | CAREER_LOG 131 | { 132 | flight = 0 133 | } 134 | FLIGHT_LOG 135 | { 136 | flight = 0 137 | } 138 | } 139 | KERBAL 140 | { 141 | name = Valentina Kerman 142 | gender = Female 143 | type = Crew 144 | trait = Pilot 145 | brave = 0.55 146 | dumb = 0.4 147 | badS = True 148 | tour = False 149 | state = Available 150 | ToD = 0 151 | idx = -1 152 | CAREER_LOG 153 | { 154 | flight = 0 155 | } 156 | FLIGHT_LOG 157 | { 158 | flight = 0 159 | } 160 | } 161 | } 162 | } -------------------------------------------------------------------------------- /resource/saves/training/D_Science.sfs: -------------------------------------------------------------------------------- 1 | GAME 2 | { 3 | version = 1.0.0 4 | Title = 科研基础操作 5 | Description = 在本教程中Wernher von Kerman将引导您学习 Kerbal 的科研方法,同时您会认可实验工作是那么酷的一件事情 ! 6 | Mode = CAREER 7 | // scene to load when starting this save. 8 | scene = 5 9 | flag = Squad/Flags/default 10 | PARAMETERS 11 | { 12 | preset = Custom 13 | FLIGHT 14 | { 15 | CanQuickSave = False 16 | CanQuickLoad = False 17 | CanAutoSave = True 18 | CanUseMap = True 19 | CanSwitchVesselsNear = True 20 | CanSwitchVesselsFar = False 21 | CanTimeWarpHigh = True 22 | CanTimeWarpLow = True 23 | CanEVA = True 24 | CanIVA = True 25 | CanBoard = True 26 | CanRestart = False 27 | CanLeaveToEditor = False 28 | CanLeaveToTrackingStation = True 29 | CanLeaveToSpaceCenter = True 30 | CanLeaveToMainMenu = False 31 | } 32 | SPACECENTER 33 | { 34 | CanGoInVAB = False 35 | CanGoInSPH = False 36 | CanGoInTrackingStation = False 37 | CanLaunchAtPad = False 38 | CanLaunchAtRunway = False 39 | CanLeaveToMainMenu = True 40 | CanGoToRnD = False 41 | CanGoToAstronautC = False 42 | CanGoToAdmin = False 43 | CanGoToMissionControl = False 44 | CanSelectFlag = False 45 | 46 | } 47 | RESEARCHANDDEVELOPMENT 48 | { 49 | 50 | CanLeaveToSpaceCenter = True 51 | 52 | } 53 | DIFFICULTY 54 | { 55 | MissingCrewsRespawn = True 56 | } 57 | } 58 | SCENARIO 59 | { 60 | // the name of the ScenarioModule class to spawn 61 | name = TutorialScience 62 | // the scene in which the module gets spawned (7 = flight) 63 | scene = 5 64 | } 65 | SCENARIO 66 | { 67 | name = ProgressTracking 68 | scene = 5, 7, 8 69 | Progress 70 | { 71 | FirstLaunch 72 | { 73 | completed = 324.879999999994 74 | } 75 | FirstCrewToSurvive 76 | { 77 | completed = 537.6999999998 78 | crew 79 | { 80 | crews = 0 81 | } 82 | } 83 | Kerbin 84 | { 85 | reached = 533.299999999804 86 | Splashdown 87 | { 88 | completed = 533.299999999804 89 | } 90 | ReturnFromSurface 91 | { 92 | completed = 534.339999999803 93 | vessel 94 | { 95 | name = Meego 96 | flag = Squad/Flags/default 97 | } 98 | crew 99 | { 100 | crews = 0 101 | } 102 | } 103 | } 104 | } 105 | } 106 | SCENARIO 107 | { 108 | name = ResearchAndDevelopment 109 | scene = 5, 6, 7, 8, 9 110 | sci = 5 111 | Tech 112 | { 113 | id = start 114 | state = Available 115 | part = mk1pod 116 | part = liquidEngine 117 | part = solidBooster 118 | part = fuelTankSmall 119 | part = trussPiece1x 120 | part = longAntenna 121 | part = parachuteSingle 122 | } 123 | Science 124 | { 125 | id = recovery@KerbinFlew 126 | title = Recovery of a vessel that survived a flight. 127 | dsc = 1 128 | scv = 0.1666667 129 | sbv = 5 130 | sci = 5 131 | cap = 6 132 | } 133 | } 134 | FLIGHTSTATE 135 | { 136 | version = 0.22.0 137 | UT = 0.84 138 | activeVessel = 0 139 | } 140 | ROSTER 141 | { 142 | CREW 143 | { 144 | name = Jebediah Kerman 145 | brave = 0.5 146 | dumb = 0.5 147 | badS = True 148 | state = 0 149 | ToD = 7663.07999999987 150 | idx = 0 151 | } 152 | CREW 153 | { 154 | name = Bill Kerman 155 | brave = 0.5 156 | dumb = 0.8 157 | badS = False 158 | state = 0 159 | ToD = 13100736.3688264 160 | idx = 1 161 | } 162 | CREW 163 | { 164 | name = Bob Kerman 165 | brave = 0.3 166 | dumb = 0.1 167 | badS = False 168 | state = 0 169 | ToD = 7838.27999999971 170 | idx = 1 171 | } 172 | APPLICANTS 173 | { 174 | } 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /resource/使用方法.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/resource/使用方法.txt -------------------------------------------------------------------------------- /resource/版本说明.txt: -------------------------------------------------------------------------------- 1 | 2016.07.30V0.21.1 2 | 添加64位支持 3 | V0.21 4 | 仅对v1.1.3.1289版提供支持 5 | V0.17 6 | 仅对v1.0.5版提供支持 7 | V0.14 8 | 1.修正了策略大厅中数值滑块不能正常显示的bug; 9 | 10 | 2015.06.20 V0.13版 11 | 1.修正了营救和环绕轨道任务中标记轨道近、远拱点显示方块的bug; 12 | 2.对游客旅行任务进行了润色; 13 | 14 | 2015.06.16 V0.12版 15 | 1.修正了既往任务不能正确显示和丢失的bug; 16 | 2.修正了任务难度不正常显示的bug; 17 | 18 | 2015.06.13 V0.11版 19 | 1.修正了宇航员不能获得经验和升级的bug; 20 | 2.润色了部分翻译错误 21 | 22 | 2015.06.10 V0.10版 23 | 1.修正了矿机伸缩不正常的bug; 24 | 2.修复了全部发电机、引擎不能正常发电的bug; 25 | 3.修复开始游戏时旗帜显示不全的bug; 26 | 4.润色和修正了部分翻译错误。 27 | 28 | 2015.06.09 V0.9版 29 | 1.修正了载具状态不正常的bug; 30 | 2.修正了部分组件发射脱离的bug; 31 | 3.修正了工程师报告不能正确显示的bug; 32 | 4.修正了游戏再次启动不能的bug; 33 | 5.修正了游戏模式不正常显示的bug; 34 | 6.修正了游戏中资金、声望、科研点数、任务次数被重置的bug; 35 | 7.增加了部分汉化; 36 | 8.润色和修正了部分翻译错误。 37 | 38 | 2015.06.06 V0.8版 39 | 1.修正了卡加载和分类图标不正确的bug; 40 | 2.修正了编辑界面火箭自启动的bug; 41 | 3.修正了教程汉化第一场景卡在指令仓的bug; 42 | 4.修正了部分部件不启动的bug; 43 | 5.改善了编辑界面第一次进入时中文不显示的问题; 44 | 6.完成了训练和教程、场景的汉化; 45 | 7.增加了大量的汉化内容和少量bug。 46 | 47 | 2015.05.31 v0.7版 48 | 1.大量的任务汉化,现在发射第一艘载具终于显示汉字了; 49 | 2.增加了大量教程汉化; 50 | 3.增加了小行星任务汉化; 51 | 4.增加组装间错误提示、普通任务汉化、完成任务提示等; 52 | 5.增加了大量汉化和数不清的bug。 53 | 54 | 55 | 2015.05.23 v0.6版 56 | 1.增加了更多部门和公司的汉化介绍; 57 | 2.润色了大量翻译,从机翻走向人翻; 58 | 3.添加了新版本游戏中加入的组件并汉化; 59 | 4.汉化了策略描述和方式; 60 | 5.加入了大量的汉化内容; 61 | 6.修正了因中英文标点不同引起的显示不正常bug; 62 | 7.修正了汉化引起的图片显示不正常的bug; 63 | 8.修正了宇航员不能招募的bug。 64 | 65 | 2015.05.19 v0.5版 66 | 1.已经汉化的科技树现在被正确加入汉化文件了; 67 | 2.游戏部门和公司介绍汉化统一并被加入了汉化文件; 68 | 3.加入了大量游戏内的汉化文字,包括稳定器,引擎推力,教程和训练模式; 69 | 4.修复了无法正确读取、保存载具的bug; 70 | 5.修复了无法继续游戏的bug; 71 | 6.修复了部分游戏菜单失效的bug; 72 | 7.因为汉化又加入了大量bug。 73 | 74 | 2015.05.09 v0.4版 75 | 1.加入了游戏内部门、公司、策略、人员和其他部件未汉化文件的支持 76 | 2.加入了合同文本的支持。 77 | 3.完整汉化了科技树。 78 | 4.修正了组装界面不显示升力的bug 79 | 80 | 2015.05.07 v0.3版 81 | 1.重新定位dll文件,修正md文件引导,明确了中英文文本的对应关系 82 | 2.修正了游戏内公司的名称,添加了科技树汉化和部分组件汉化。 83 | 3.移植了合同文本和故事背景文字 84 | 85 | 2015.05.06 v0.2版 86 | 1.汉化了大量训练模式、场景,增加了原始合同、任务文本,; 87 | 2.升级xconfig汉化,支持多文件,现在汉化条目更加清晰了; 88 | 3.插入字库,现在游戏内可以正确显示汉字了; 89 | 4.调整了图片ui,包括节流阀在内的图片文字可以正确显示了; 90 | 5.优化了显示方式,降低资源消耗; 91 | 6.不再支持KSPV1.00及1.01版,仅支持1.02版。 92 | 93 | 2015.05.03 v0.1版 94 | 采用原0.24版深度时空汉化方式,采用DLL开源、xml汉化方式 95 | 已汉化菜单、设置界面、部分组件、部分场景和训练模式 -------------------------------------------------------------------------------- /src/.vs/KSP_zh/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/src/.vs/KSP_zh/v14/.suo -------------------------------------------------------------------------------- /src/DTS_Addon/DTS_Addon.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {7E05DC0C-7DA6-4691-B258-109AB54617F9} 8 | Library 9 | Properties 10 | DTS_Addon 11 | DTS_Addon 12 | v4.5 13 | 512 14 | 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | false 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | false 35 | 36 | 37 | true 38 | bin\x64\ 39 | DEBUG;TRACE 40 | full 41 | AnyCPU 42 | prompt 43 | MinimumRecommendedRules.ruleset 44 | false 45 | 46 | 47 | true 48 | bin\x32\ 49 | DEBUG;TRACE 50 | full 51 | AnyCPU 52 | prompt 53 | MinimumRecommendedRules.ruleset 54 | false 55 | 56 | 57 | 58 | ..\..\..\..\..\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll 59 | 60 | 61 | ..\..\..\..\..\..\..\..\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\System.dll 62 | 63 | 64 | ..\..\..\..\..\..\..\..\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\System.Xml.dll 65 | False 66 | True 67 | 68 | 69 | ..\..\..\..\..\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll 70 | 71 | 72 | ..\..\..\..\..\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.UI.dll 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | DTS_zh\cnfont\cn10.png 102 | 103 | 104 | DTS_zh\cnfont\cn12.png 105 | 106 | 107 | DTS_zh\cnfont\cn14.png 108 | 109 | 110 | DTS_zh\cnfont\cn14b.png 111 | 112 | 113 | DTS_zh\cnfont\cn16.png 114 | 115 | 116 | DTS_zh\cnfont\cn16b.png 117 | 118 | 119 | DTS_zh\en.xml 120 | 121 | 122 | DTS_zh\Image\Buttons_TimeMode_StateMap.png 123 | 124 | 125 | DTS_zh\Image\EditorAtlas.png 126 | 127 | 128 | DTS_zh\Image\EditorButtons_stageReset.png 129 | 130 | 131 | DTS_zh\Image\flightUI_linearQuadrantFrame_bg.png 132 | 133 | 134 | DTS_zh\Image\FlightUI_RotQuadrant.png 135 | 136 | 137 | DTS_zh\Image\FlightUI_RotQuadrant_bg.png 138 | 139 | 140 | DTS_zh\Image\Gauge_Atmos.png 141 | 142 | 143 | DTS_zh\Image\Gauge_Gee.png 144 | 145 | 146 | DTS_zh\Image\Gauge_Throttle.png 147 | 148 | 149 | DTS_zh\Image\gauge_Vs.png 150 | 151 | 152 | DTS_zh\Image\GUI_TimeQuadrant.png 153 | 154 | 155 | DTS_zh\Image\LED_lin_off.png 156 | 157 | 158 | DTS_zh\Image\LED_lin_on.png 159 | 160 | 161 | DTS_zh\Image\LED_rot_off.png 162 | 163 | 164 | DTS_zh\Image\LED_rot_on.png 165 | 166 | 167 | DTS_zh\Image\navBall_headingPane.png 168 | 169 | 170 | DTS_zh\Image\RecoveryButton.png 171 | 172 | 173 | DTS_zh\Image\ResearchAndDevelopment.png 174 | 175 | 176 | DTS_zh\Image\StagingQuadrant_bg.png 177 | 178 | 179 | DTS_zh\Image\StagingQuadrant_Frame.png 180 | 181 | 182 | DTS_zh\Image\VesselSpawnDialog.png 183 | 184 | 185 | DTS_zh\xSquad\Agents.xml 186 | 187 | 188 | DTS_zh\xSquad\Departments.xml 189 | 190 | 191 | DTS_zh\xSquad\Parts.xml 192 | 193 | 194 | DTS_zh\xSquad\ScienceDefs.xml 195 | 196 | 197 | DTS_zh\xSquad\StoryDefs.xml 198 | 199 | 200 | DTS_zh\xSquad\Strategies.xml 201 | 202 | 203 | DTS_zh\xSquad\TechTree.xml 204 | 205 | 206 | DTS_zh\xSquad\Traits.xml 207 | 208 | 209 | DTS_zh\zh.xml 210 | 211 | 212 | DTS_zh\zhConfig.xml 213 | Designer 214 | 215 | 216 | DTS_zh\zhField.xml 217 | 218 | 219 | DTS_zh\zhFont.xml 220 | Designer 221 | 222 | 223 | DTS_zh\zhImage.xml 224 | 225 | 226 | DTS_zh\zhItem.xml 227 | 228 | 229 | DTS_zh\zhLoadingTips.xml 230 | 231 | 232 | DTS_zh\zhText.xml 233 | 234 | 235 | 236 | 237 | DTS_zh\cnfont\cn10.fnt.unity3d 238 | 239 | 240 | DTS_zh\cnfont\cn12.fnt.unity3d 241 | 242 | 243 | DTS_zh\cnfont\cn14.fnt.unity3d 244 | 245 | 246 | DTS_zh\cnfont\cn14b.fnt.unity3d 247 | 248 | 249 | DTS_zh\cnfont\cn16.fnt.unity3d 250 | 251 | 252 | DTS_zh\cnfont\cn16b.fnt.unity3d 253 | 254 | 255 | 256 | 257 | {71de13ea-3237-47e3-bfe7-7b12ad946d73} 258 | DTS_zh 259 | 260 | 261 | 262 | 269 | -------------------------------------------------------------------------------- /src/DTS_Addon/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DTS_Addon")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DTS_Addon")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("e8b8670e-2a6a-475e-bd39-153bc6ba1ad9")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/DTS_Addon/README.md: -------------------------------------------------------------------------------- 1 | #项目介绍 2 | 3 | 汉化插件,可以通过插件功能汉化的代码放置于此,同时附带了便于汉化调试的SuperTool工具 4 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xCredits.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Text; 5 | 6 | using UnityEngine; 7 | 8 | namespace DTS_Addon.Scene 9 | { 10 | [KSPAddon(KSPAddon.Startup.Credits, false)] 11 | public class xCredits : MonoBehaviour 12 | { 13 | [Conditional("DEBUG")] 14 | void OnGUI() 15 | { 16 | GUI.Label(new Rect(10, 10, 200, 20), "Credits"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xEditorAny.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Text; 5 | 6 | using UnityEngine; 7 | 8 | namespace DTS_Addon.Scene 9 | { 10 | [KSPAddon(KSPAddon.Startup.EditorAny, false)] 11 | public class xEditorAny : MonoBehaviour 12 | { 13 | [Conditional("DEBUG")] 14 | void OnGUI() 15 | { 16 | GUI.Label(new Rect(10, 10, 200, 20), "EditorAny"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xEditorSPH.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Text; 5 | 6 | using UnityEngine; 7 | 8 | namespace DTS_Addon.Scene 9 | { 10 | [KSPAddon(KSPAddon.Startup.EditorSPH, false)] 11 | public class xEditorSPH : MonoBehaviour 12 | { 13 | [Conditional("DEBUG")] 14 | void OnGUI() 15 | { 16 | // GUI.Label(new Rect(10, 10, 200, 20), "EditorSPH"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xEditorVAB.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using UnityEngine; 5 | using System.Diagnostics; 6 | 7 | namespace DTS_Addon.Scene 8 | { 9 | [KSPAddon(KSPAddon.Startup.EditorVAB, false)] 10 | public class xEditorVAB : MonoBehaviour 11 | { 12 | [Conditional("DEBUG")] 13 | void OnGUI() 14 | { 15 | GUI.Label(new Rect(10, 10, 200, 20), "EditorVAB"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xEveryScene.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using TMPro; 7 | using UnityEngine; 8 | 9 | namespace DTS_Addon.Scene 10 | { 11 | [KSPAddon(KSPAddon.Startup.EveryScene, false)] 12 | public class xEveryScene : MonoBehaviour 13 | { 14 | 15 | 16 | void Start() 17 | { 18 | 19 | 20 | } 21 | 22 | 23 | 24 | 25 | void Update() 26 | { 27 | 28 | } 29 | 30 | 31 | //void OnGUI() 32 | //{ 33 | // if (mat !=null ) 34 | // { 35 | // GUI.Label(new Rect(10, 10, 200, 30), ms); 36 | // GUI.DrawTexture(new Rect(10, 50, 200, 200), mat.mainTexture); 37 | // GUI.DrawTexture(new Rect(10, 250, 200, 200), mat2.mainTexture); 38 | 39 | // } 40 | // //GUI.Label(new Rect(10, 50, 300, 2000), a); 41 | 42 | 43 | // if (GUI.Button(new Rect(210, 10, 100, 20), "")) 44 | // { 45 | // Load("cn10", "Arial10"); 46 | // Load("cn10", "Arial11"); 47 | // Load("cn12", "Arial12"); 48 | // Load("cn14", "Arial14"); 49 | // Load("cn14b", "Arial14Bold"); 50 | // Load("cn16", "Arial16"); 51 | // Load("cn16b", "Arial16_Mk2"); 52 | // Load("cn12", "Calibri12"); 53 | // Load("cn14", "Calibri14"); 54 | // Load("cn16", "Calibri16"); 55 | // } 56 | 57 | //} 58 | //Material mat; 59 | //Material mat2; 60 | //string ms = ""; 61 | //public void Load(string cnFont, string enFont) 62 | //{ 63 | // try 64 | // { 65 | // if (DTS_zh.xFont.FontList.Count == 0) 66 | // { 67 | // DTS_zh.xFont.loadFontList(); 68 | // } 69 | 70 | // var mats = Resources.FindObjectsOfTypeAll(); 71 | // foreach (var item in mats) 72 | // { //便利所有材质 73 | 74 | // if (item.name == enFont) 75 | // { 76 | // item.SetTexture("_MainTex", DTS_zh.xFont.FontList[cnFont].fontMat.mainTexture); 77 | // Debug.LogWarning("LoadedFont:" + item.name); 78 | // mat = item; 79 | // mat2 = DTS_zh.xFont.FontList[cnFont].fontMat; 80 | // ms = enFont + " : " + cnFont; 81 | // } 82 | // } 83 | // } 84 | // catch (Exception ex) 85 | // { 86 | 87 | // Debug.LogError(ex.ToString()); 88 | // } 89 | //} 90 | 91 | void OnGUI() 92 | { 93 | 94 | } 95 | } 96 | 97 | 98 | 99 | } 100 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xFlight.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using UnityEngine; 5 | using System.Diagnostics; 6 | namespace DTS_Addon.Scene 7 | { 8 | [KSPAddon(KSPAddon.Startup.Flight, false)] 9 | public class xFlight : MonoBehaviour 10 | { 11 | void Start() 12 | { 13 | 14 | } 15 | 16 | void Update() 17 | { 18 | 19 | } 20 | [Conditional("DEBUG")] 21 | void OnGUI() 22 | { 23 | GUI.Label(new Rect(10, 10, 200, 20), "Flight"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xInstantly.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace DTS_Addon.Scene 8 | { 9 | [KSPAddon(KSPAddon.Startup.Instantly, false)] 10 | public class xInstantly : MonoBehaviour 11 | { 12 | [Conditional("DEBUG")] 13 | void OnGUI() 14 | { 15 | GUI.Label(new Rect(10, 10, 200, 20), "Instantly"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xMainMenu.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Text; 5 | 6 | using UnityEngine; 7 | 8 | namespace DTS_Addon.Scene 9 | { 10 | [KSPAddon(KSPAddon.Startup.MainMenu, false)] 11 | public class xMainMenu : MonoBehaviour 12 | { 13 | [Conditional("DEBUG")] 14 | void OnGUI() 15 | { 16 | GUI.Label(new Rect(10, 10, 200, 20), "MainMenu"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xPSystemSpawn.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using System.Text; 5 | 6 | using UnityEngine; 7 | 8 | namespace DTS_Addon.Scene 9 | { 10 | [KSPAddon(KSPAddon.Startup.PSystemSpawn, false)] 11 | public class xPSystemSpawn : MonoBehaviour 12 | { 13 | void OnGUI() 14 | { 15 | //GUI.Label(new Rect(10, 10, 200, 20), "PSystemSpawn"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using System.Text; 5 | using System.Diagnostics; 6 | using UnityEngine; 7 | 8 | namespace DTS_Addon.Scene 9 | { 10 | [KSPAddon(KSPAddon.Startup.Settings, false)] 11 | public class xSettings : MonoBehaviour 12 | { 13 | [Conditional("DEBUG")] 14 | void OnGUI() 15 | { 16 | GUI.Label(new Rect(10, 10, 200, 20), "Settings"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xSpaceCentre.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using System.Text; 5 | 6 | using UnityEngine; 7 | 8 | namespace DTS_Addon.Scene 9 | { 10 | [KSPAddon(KSPAddon.Startup.SpaceCentre, false)] 11 | public class xSpaceCentre : MonoBehaviour 12 | { 13 | 14 | void Start() 15 | { 16 | 17 | } 18 | 19 | 20 | void Update() 21 | { 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/DTS_Addon/Scene/xTrackingStation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using System.Text; 5 | 6 | using UnityEngine; 7 | 8 | namespace DTS_Addon.Scene 9 | { 10 | [KSPAddon(KSPAddon.Startup.TrackingStation, false)] 11 | public class xTrackingStation : MonoBehaviour 12 | { 13 | 14 | 15 | void Start() 16 | { 17 | //ScreenSafeUI ssui = new ScreenSafeUI(); 18 | 19 | 20 | 21 | 22 | } 23 | 24 | 25 | void Update() 26 | { 27 | // var go=GameObject.Find("description"); 28 | //if (go!=null ) 29 | //{ 30 | // var st = go.GetComponent(); 31 | // if (st != null) st.Text = DateTime.Now.ToString(); 32 | //} 33 | } 34 | 35 | void OnGUI() 36 | { 37 | 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/DTS_Addon/SuperTool/ConfigTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using UnityEngine; 6 | namespace DTS_Addon 7 | { 8 | [KSPAddon(KSPAddon.Startup.EveryScene, false)] 9 | public class ConfigTest : MonoBehaviour 10 | { 11 | Vector2 hc; 12 | 13 | int h = 0; 14 | Rect window = new Rect(100, 100, 600, 600); 15 | 16 | 17 | string find = ""; 18 | 19 | string tp = ""; 20 | 21 | string findvalue = ""; 22 | string fvalue = ""; 23 | string urlvalue = ""; 24 | string maxLevel = "3"; 25 | 26 | void OnGUI() 27 | { 28 | if (SuperTools.ConfigTest == false) return; 29 | window = GUI.Window(104, window, CNodeWindow, "资源"); 30 | } 31 | 32 | static bool testMody = false; 33 | 34 | bool isOut = false; 35 | 36 | void CNodeWindow(int id) 37 | { 38 | GUI.DragWindow(new Rect(0, 0, 580, 30)); 39 | 40 | GUI.Label(new Rect(5, 20, 100, 20), "最大深度"); 41 | maxLevel = GUI.TextField(new Rect(105, 20, 100, 25), maxLevel); 42 | 43 | GUI.Label(new Rect(5, 60, 100, 20), "检索"); 44 | GUI.Label(new Rect(105, 40, 100, 20), "name"); 45 | GUI.Label(new Rect(205, 40, 100, 20), "type"); 46 | GUI.Label(new Rect(305, 40, 100, 20), "value1"); 47 | GUI.Label(new Rect(405, 40, 100, 20), "value2"); 48 | GUI.Label(new Rect(505, 40, 100, 20), "url"); 49 | 50 | find = GUI.TextField(new Rect(105, 60, 100, 25), find); 51 | tp = GUI.TextField(new Rect(205, 60, 100, 25), tp); 52 | fvalue = GUI.TextField(new Rect(305, 60, 100, 25), fvalue); 53 | findvalue = GUI.TextField(new Rect(405, 60, 100, 25), findvalue); 54 | urlvalue = GUI.TextField(new Rect(505, 60, 100, 25), urlvalue); 55 | 56 | h = 0; 57 | hc = GUI.BeginScrollView(new Rect(0, 90, 600, 600), hc, new Rect(0, 0, 590, 40000)); 58 | 59 | //sht("GameDatabase.Instance.root"); 60 | sht("name", GameDatabase.Instance.root.name, 0); 61 | //sht("path", GameDatabase.Instance.root.path); 62 | sht("url", GameDatabase.Instance.root.url, 0); 63 | sht("type", GameDatabase.Instance.root.type.ToString(), 0); 64 | 65 | GUI.Label(new Rect(0, h * 20, 200, 20), " "); 66 | h++; 67 | 68 | //sht("GameDatabase.Instance.root.AllConfigs"); 69 | foreach (UrlDir.UrlConfig config in GameDatabase.Instance.root.AllConfigs) 70 | { 71 | if (config.name.Contains(find) == false) continue; 72 | if (config.type.Contains(tp) == false) continue; 73 | if (config.url.Contains(urlvalue) == false) continue; 74 | 75 | sht("name", config.name, 0); 76 | sht("type", config.type, 0);//AGENT,PART,PROP,RESOURCE_DEFINITION,EXPERIMENT_DEFINITION,STORY_DEF,INTERNAL, 77 | sht("url", config.url, 0); 78 | 79 | sht("parent.name", config.parent.name, 0); 80 | sht("parent.url", config.parent.url, 0); 81 | sht("parent.fileType", config.parent.fileType.ToString(), 0); 82 | 83 | //sht("GameDatabase.Instance.root.AllConfigs.config"); 84 | 85 | shlabel("values.Count", config.config.values.Count.ToString(), 0); 86 | 87 | //if (config.url == "Squad/Parts/Command/advSasModule/part/advSasModule" && testMody == false) 88 | //{ 89 | // testMody = true; 90 | // config.config.AddValue("--description", "这个系统使用一组以'相当'高速旋转的圆盘来产生控制飞船必需的扭矩.还包含"); 91 | //} 92 | 93 | foreach (ConfigNode.Value value in config.config.values) 94 | { 95 | shValue(value, 0); 96 | } 97 | 98 | shlabel("nodes.Count", config.config.nodes.Count.ToString(), 0); 99 | 100 | showNode(config.config.nodes, 1); 101 | 102 | shh1(); 103 | } 104 | GUI.EndScrollView(); 105 | 106 | isOut = false; 107 | } 108 | 109 | 110 | public void showNode(ConfigNode.ConfigNodeList nodes, int level) 111 | { 112 | 113 | foreach (ConfigNode node in nodes) 114 | { 115 | GUI.Label(new Rect(0 + level * 30, h * 20, 200, 20), "--------------------------"); 116 | h++; 117 | 118 | sht("node.id", node.id, level); 119 | sht("node.name", node.name, level); 120 | 121 | shlabel("values.Count", node.values.Count.ToString(), level); 122 | 123 | if (level > System.Convert.ToInt32(maxLevel)) return; 124 | foreach (ConfigNode.Value value in node.values) 125 | { 126 | shValue(value, level); 127 | } 128 | 129 | shlabel("nodes.Count", node.nodes.Count.ToString(), level); 130 | showNode(node.nodes, level + 1); 131 | 132 | } 133 | } 134 | 135 | 136 | void sht(string name) 137 | { 138 | if (findvalue != "") return; 139 | GUI.Label(new Rect(0, h * 20, 590, 20), name); 140 | 141 | h++; 142 | 143 | if (isOut == true) 144 | File.AppendAllText("GameData/DTS_zh/Debug.txt", "".PadRight(0) + name + "\r\n"); 145 | } 146 | 147 | void sht(string name, string value, int level) 148 | { 149 | if (findvalue != "") return; 150 | GUI.Label(new Rect(5 + level * 30, h * 20, 140 - level * 30, 20), name); 151 | GUI.TextField(new Rect(140 + level * 30, h * 20, 450 - level * 30, 20), value); 152 | h++; 153 | if (isOut == true) 154 | File.AppendAllText("GameData/DTS_zh/Debug.txt", "".PadRight(level * 4) + name + "\t" + value + "\r\n"); 155 | } 156 | 157 | void shlabel(string name, string value, int level) 158 | { 159 | if (findvalue != "") return; 160 | GUI.Label(new Rect(5 + level * 30, h * 20, 140 - level * 30, 20), name); 161 | GUI.Label(new Rect(140 + level * 30, h * 20, 450 - level * 30, 20), value); 162 | h++; 163 | if (isOut == true) 164 | File.AppendAllText("GameData/DTS_zh/Debug.txt", "".PadRight(level * 4) + name + "\t" + value + "\r\n"); 165 | } 166 | 167 | void shh1() 168 | { 169 | if (findvalue != "") return; 170 | GUI.Label(new Rect(0, h * 20, 200, 20), " "); 171 | h++; 172 | GUI.Label(new Rect(0, h * 20, 200, 20), "=========================="); 173 | h++; 174 | if (isOut == true) 175 | File.AppendAllText("GameData/DTS_zh/Debug.txt", "==========================\r\n"); 176 | } 177 | 178 | 179 | void shValue(ConfigNode.Value value, int level) 180 | { 181 | if (value.value.Contains(findvalue) == false) return; 182 | if (value.value.Contains(fvalue) == false) return; 183 | GUI.Label(new Rect(5 + level * 30, h * 20, 140 - level * 30, 20), value.name); 184 | value.value = GUI.TextField(new Rect(140 + level * 30, h * 20, 450 - level * 30, 20), value.value); 185 | 186 | h++; 187 | if (isOut == true) 188 | File.AppendAllText("GameData/DTS_zh/Debug.txt", "".PadRight(level * 4) + value.name + "\t" + value.value + "\r\n"); 189 | } 190 | } 191 | } -------------------------------------------------------------------------------- /src/DTS_Addon/SuperTool/SuperTools.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using System.Text; 5 | 6 | using UnityEngine; 7 | 8 | namespace DTS_Addon 9 | { 10 | [KSPAddon(KSPAddon.Startup.EveryScene, false)] 11 | public class SuperTools : MonoBehaviour 12 | { 13 | public static bool ConfigTest = false; 14 | public static bool UITree = false; 15 | public static bool UICapture = false; 16 | public static bool UIxFontTool = false; 17 | 18 | public bool ShowSuperTools = false; 19 | 20 | void Start() 21 | { 22 | //GameObject.DontDestroyOnLoad(this); 23 | } 24 | 25 | 26 | void Update() 27 | { 28 | if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.LeftAlt) && Input.GetKeyDown(KeyCode.F11)) 29 | { 30 | ShowSuperTools = !ShowSuperTools; 31 | } 32 | 33 | } 34 | Rect window = new Rect(100, 100, 250, 190); 35 | 36 | void OnGUI() 37 | { 38 | if (ShowSuperTools == false) return; 39 | window = GUI.Window(99, window, SuperWindow, "Super Debug Tools"); 40 | 41 | } 42 | 43 | void SuperWindow(int id) 44 | { 45 | 46 | if (GUI.Button(new Rect(10, 20, 50, 50), "资源")) 47 | { 48 | ConfigTest = !ConfigTest; 49 | } 50 | else if (GUI.Button(new Rect(70, 20, 50, 50), "对象树")) 51 | { 52 | UITree = !UITree; 53 | } 54 | else if (GUI.Button(new Rect(130, 20, 50, 50), "对象\r\n捕捉")) 55 | { 56 | UICapture = !UICapture; 57 | } 58 | else if (GUI.Button(new Rect(190, 20, 50, 50), "汉化\r\n监视")) 59 | { 60 | UIxFontTool = !UIxFontTool; 61 | } 62 | else if (GUI.Button(new Rect(10, 80, 50, 50), "重新载入\r\nxConfig")) 63 | { 64 | DTS_zh.xConfg.XConfg.HzConfig(); 65 | } 66 | else if (GUI.Button(new Rect(130, 80, 50, 50), "重新载入\r\nzhItem")) 67 | { 68 | DTS_Addon.xItem.Load(); 69 | } 70 | else if (GUI.Button(new Rect(190, 80, 50, 50), "测试")) 71 | { 72 | DTS_zh.xRead.Loadzh(); 73 | // try 74 | // { 75 | 76 | 77 | //var rd= UnityEngine.Resources.FindObjectsOfTypeAll()[0]; 78 | 79 | // foreach (RDNode item in rd.nodes) 80 | // { 81 | // Debug.LogWarning("[Debug]" + item.name + " " + item.description); 82 | // item.description = "12345"; 83 | // } 84 | // } 85 | // catch (Exception ex) 86 | // { 87 | // Debug.LogError("[Debug]" + ex.ToString()); 88 | // } 89 | } 90 | 91 | GUI.Label(new Rect(10, 150, 170, 20), HighLogic.LoadedScene.ToString()); 92 | 93 | 94 | GUI.DragWindow(new Rect(0, 0, 190, 140)); 95 | 96 | } 97 | 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/DTS_Addon/SuperTool/xFontTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | using System.Text; 6 | 7 | using UnityEngine; 8 | 9 | namespace DTS_Addon.SuperTool 10 | { 11 | [KSPAddon(KSPAddon.Startup.EveryScene, false)] 12 | public class xFontTool : MonoBehaviour 13 | { 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DTS_Addon/VegaTextureReplacer.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | //using System.Collections.Generic; 3 | //using System.Runtime.CompilerServices; 4 | //using UnityEngine; 5 | 6 | //[KSPAddon(KSPAddon.Startup.Instantly, true)] 7 | //public class VegaTextureReplacer : MonoBehaviour 8 | //{ 9 | // [CompilerGenerated] 10 | // private static Predicate PPkno; 11 | // private static readonly string DIR_PREFIX = "TextureReplacer/Textures/"; 12 | // private bool isInitialised; 13 | // private bool isReplaceScheduled; 14 | // private bool isTextureCompressorDetected; 15 | // private int lastCrewCount; 16 | // private int lastMaterialsCount; 17 | // private int lastTextureCount; 18 | // private Vessel lastVessel; 19 | // private Dictionary mappedTextures = new Dictionary(); 20 | // private int memorySpared; 21 | // private int updateCounter; 22 | 23 | // private void compressTextures() 24 | // { 25 | // List databaseTexture = GameDatabase.Instance.databaseTexture; 26 | // if (this.lastTextureCount != databaseTexture.Count) 27 | // { 28 | // for (int i = this.lastTextureCount; i < databaseTexture.Count; i++) 29 | // { 30 | // Texture2D texture = databaseTexture[i].texture; 31 | // UnityEngine.TextureFormat format = texture.format; 32 | // switch (format) 33 | // { 34 | // case UnityEngine.TextureFormat.DXT1: 35 | // case UnityEngine.TextureFormat.DXT5: 36 | // break; 37 | 38 | // default: 39 | // { 40 | // try 41 | // { 42 | // texture.filterMode = FilterMode.Trilinear; 43 | // texture.GetPixel(0, 0); 44 | // texture.Compress(true); 45 | // } 46 | // catch (UnityException) 47 | // { 48 | // break; 49 | // } 50 | // int num2 = texture.width * texture.height; 51 | // int num3 = (texture.format != UnityEngine.TextureFormat.Alpha8) ? ((texture.format != UnityEngine.TextureFormat.RGB24) ? (num2 * 4) : (num2 * 3)) : num2; 52 | // int num4 = (texture.format != UnityEngine.TextureFormat.DXT1) ? num2 : (num2 / 2); 53 | // int num5 = num3 - num4; 54 | // this.memorySpared += num5; 55 | // object[] args = new object[] { texture.name, format, texture.width, texture.height, ((double)num5) / 1024.0 }; 56 | // MonoBehaviour.print(string.Format("[TextureReplacer] Compressed {0} [{1} {2}x{3}], spared {4:0.0} KiB", args)); 57 | // break; 58 | // } 59 | // } 60 | // } 61 | // this.lastTextureCount = databaseTexture.Count; 62 | // } 63 | // } 64 | 65 | 66 | // private void initialiseReplacer() 67 | // { 68 | // if (PPkno == null) 69 | // {//定义查找条件 70 | // PPkno = texInfo => texInfo.name.StartsWith(DIR_PREFIX); 71 | // } 72 | // //对所有贴图进行替换 73 | // foreach (GameDatabase.TextureInfo info in GameDatabase.Instance.databaseTexture.FindAll(PPkno)) 74 | // { 75 | // if (info.texture != null) 76 | // { 77 | // string key = info.texture.name.Substring(DIR_PREFIX.Length); 78 | // if (this.mappedTextures.ContainsKey(key)) 79 | // { 80 | // MonoBehaviour.print("[TextureReplacer] Corrupted GameDatabase! Problematic TGA? " + info.texture.name); 81 | // } 82 | // else 83 | // { 84 | // MonoBehaviour.print("[TextureReplacer] Mapping " + key + " -> " + info.texture.name); 85 | // this.mappedTextures.Add(key, info.texture); 86 | // } 87 | // } 88 | // } 89 | // this.replaceTextures((Material[])Resources.FindObjectsOfTypeAll(typeof(Material))); 90 | // } 91 | 92 | // private void replaceTextures(Material[] materials) 93 | // { 94 | // MonoBehaviour.print("[TextureReplacer] Replacing textures and setting trilinear filter ..."); 95 | // foreach (Material material in materials) 96 | // { 97 | // Texture mainTexture = material.mainTexture; 98 | // if (((mainTexture != null) && (mainTexture.name.Length != 0)) && !mainTexture.name.StartsWith("Temp")) 99 | // { 100 | // if (!this.mappedTextures.ContainsKey(mainTexture.name)) 101 | // { 102 | // if (mainTexture.filterMode == FilterMode.Bilinear) 103 | // { 104 | // mainTexture.filterMode = FilterMode.Trilinear; 105 | // } 106 | // } 107 | // else 108 | // { 109 | // Texture2D textured = this.mappedTextures[mainTexture.name]; 110 | // if (textured != mainTexture) 111 | // { 112 | // material.mainTexture = textured; 113 | // Resources.UnloadAsset(mainTexture); 114 | // MonoBehaviour.print("[TextureReplacer] " + mainTexture.name + " replaced"); 115 | // Texture texture = material.GetTexture("_BumpMap"); 116 | // if ((texture != null) && this.mappedTextures.ContainsKey(texture.name)) 117 | // { 118 | // Texture2D textured2 = this.mappedTextures[texture.name]; 119 | // if (textured2 != texture) 120 | // { 121 | // material.SetTexture("_BumpMap", textured2); 122 | // Resources.UnloadAsset(texture); 123 | // MonoBehaviour.print("[TextureReplacer] " + texture.name + " [normal map] replaced"); 124 | // } 125 | // } 126 | // } 127 | // } 128 | // } 129 | // } 130 | // } 131 | 132 | // protected void Start() 133 | // { 134 | // UnityEngine.Object.DontDestroyOnLoad(this); 135 | // foreach (GameObject obj2 in UnityEngine.Object.FindObjectsOfType(typeof(GameObject))) 136 | // { 137 | // if (obj2.name == "TextureCompressor") 138 | // { 139 | // MonoBehaviour.print("[TextureReplacer] Detected TextureCompressor, disabling texture compression"); 140 | // this.isTextureCompressorDetected = true; 141 | // break; 142 | // } 143 | // } 144 | // } 145 | 146 | // protected void Update() 147 | // { 148 | // if (!this.isInitialised) 149 | // { 150 | // if (!this.isTextureCompressorDetected) 151 | // { 152 | // this.compressTextures(); 153 | // } 154 | // if (GameDatabase.Instance.IsReady()) 155 | // { 156 | // MonoBehaviour.print(string.Format("[TextureReplacer] Texture compression spared total {0:0.0} MiB = {1:0.0} MB", (((double)this.memorySpared) / 1024.0) / 1024.0, (((double)this.memorySpared) / 1000.0) / 1000.0)); 157 | // this.initialiseReplacer(); 158 | // this.isInitialised = true; 159 | // } 160 | // } 161 | // else if (HighLogic.LoadedSceneIsFlight) 162 | // { 163 | // this.lastMaterialsCount = 0; 164 | // this.updateCounter = 0; 165 | // if ((FlightGlobals.ActiveVessel != this.lastVessel) || (this.lastVessel.GetCrewCount() != this.lastCrewCount)) 166 | // { 167 | // this.lastVessel = FlightGlobals.ActiveVessel; 168 | // this.lastCrewCount = this.lastVessel.GetCrewCount(); 169 | // this.isReplaceScheduled = true; 170 | // } 171 | // else if (this.isReplaceScheduled) 172 | // { 173 | // this.isReplaceScheduled = false; 174 | // this.replaceTextures((Material[])Resources.FindObjectsOfTypeAll(typeof(Material))); 175 | // } 176 | // } 177 | // else if (HighLogic.LoadedScene == GameScenes.MAINMENU) 178 | // { 179 | // this.lastVessel = null; 180 | // this.lastCrewCount = 0; 181 | // this.isReplaceScheduled = false; 182 | // this.updateCounter--; 183 | // if (this.updateCounter <= 0) 184 | // { 185 | // this.updateCounter = 10; 186 | // Material[] materials = (Material[])Resources.FindObjectsOfTypeAll(typeof(Material)); 187 | // if (materials.Length != this.lastMaterialsCount) 188 | // { 189 | // this.lastMaterialsCount = materials.Length; 190 | // this.replaceTextures(materials); 191 | // } 192 | // } 193 | // } 194 | // else 195 | // { 196 | // this.lastMaterialsCount = 0; 197 | // this.updateCounter = 0; 198 | // this.lastVessel = null; 199 | // this.lastCrewCount = 0; 200 | // this.isReplaceScheduled = false; 201 | // } 202 | // } 203 | //} 204 | 205 | -------------------------------------------------------------------------------- /src/DTS_Addon/xConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | using System.Text; 6 | using System.Xml; 7 | using UnityEngine; 8 | 9 | namespace DTS_zh 10 | { 11 | [KSPAddon(KSPAddon.Startup.Instantly, false)] 12 | public class xConfg : MonoBehaviour 13 | { 14 | void OnGUI() 15 | { 16 | } 17 | 18 | public static xConfg XConfg; 19 | 20 | 21 | private bool loaded = false; 22 | 23 | public void Start() 24 | { 25 | XConfg = this; 26 | } 27 | 28 | 29 | public void Update() 30 | { 31 | if (loaded == true) return; 32 | HzConfig(); 33 | loaded = true; 34 | } 35 | 36 | //汉化 37 | public void HzConfig() 38 | { 39 | try 40 | { 41 | List configs = LoadXml(); 42 | 43 | foreach (var config in configs) 44 | { 45 | var kspConfig = GetUrlConfig(GameDatabase.Instance.root.AllConfigs, config); 46 | if (kspConfig == null) 47 | { 48 | continue; 49 | } 50 | var nodecopy = DeepCopy(kspConfig.config); 51 | HzValues(nodecopy.values, config.Values); 52 | HzNodes(nodecopy.nodes, config.Nodes); 53 | 54 | kspConfig.config.ClearData(); 55 | nodecopy.CopyTo(kspConfig.config); 56 | } 57 | 58 | } 59 | catch (Exception ex) 60 | { 61 | Debug.LogError(ex.ToString()); 62 | } 63 | 64 | } 65 | 66 | private static ConfigNode DeepCopy(ConfigNode from) 67 | { 68 | ConfigNode to = new ConfigNode(from.name); 69 | foreach (ConfigNode.Value value in from.values) 70 | to.AddValue(value.name, value.value); 71 | foreach (ConfigNode node in from.nodes) 72 | { 73 | ConfigNode newNode = DeepCopy(node); 74 | to.nodes.Add(newNode); 75 | } 76 | return to; 77 | } 78 | 79 | //linq支持有问题,就用这个替代 80 | public UrlDir.UrlConfig GetUrlConfig(IEnumerable AllConfigs, Config config) 81 | { 82 | foreach (UrlDir.UrlConfig item in AllConfigs) 83 | { 84 | bool ItsYou = false; 85 | if (config.Url != null && item.url == config.Url) 86 | ItsYou = true; 87 | else if (config.Name != null && item.name == config.Name) 88 | ItsYou = true; 89 | 90 | if (ItsYou == true) 91 | { 92 | //如果没有id就直接返回 93 | if (config.Id == null || config.Id == "") return item; 94 | //如果有ID,那么就多增加ID方面的判断-----//此处逻辑要修改,让他更加灵活 95 | foreach (ConfigNode.Value kspValue in item.config.values) 96 | { 97 | if (kspValue.name == "id" && kspValue.value == config.Id) 98 | { 99 | return item; 100 | } 101 | } 102 | } 103 | } 104 | return null; 105 | } 106 | 107 | //汉化参数 108 | public void HzValues(ConfigNode.ValueList valueList, List values) 109 | { 110 | foreach (ConfigNode.Value kspValue in valueList) 111 | { 112 | var hzValue = GetValue(values, kspValue.name); 113 | if (hzValue != null) 114 | { 115 | kspValue.value = hzValue.value; 116 | values.Remove(hzValue); 117 | } 118 | } 119 | } 120 | 121 | //linq支持有问题,就用这个替代 122 | public Value GetValue(List values, string name) 123 | { 124 | foreach (var item in values) 125 | { 126 | if (item.name == name) return item; 127 | } 128 | return null; 129 | } 130 | 131 | //汉化节点 132 | public void HzNodes(ConfigNode.ConfigNodeList nodeList, List nodes) 133 | { 134 | foreach (ConfigNode kspNode in nodeList) 135 | { 136 | var hzNode = GetNode(nodes, kspNode); 137 | if (hzNode != null) 138 | { 139 | HzValues(kspNode.values, hzNode.Values); 140 | HzNodes(kspNode.nodes, hzNode.Nodes); 141 | nodes.Remove(hzNode); 142 | } 143 | } 144 | } 145 | 146 | //linq支持有问题,就用这个替代 147 | public Node GetNode(List nodes, ConfigNode kspNode) 148 | { 149 | if (kspNode == null) 150 | { 151 | Debug.LogWarning(nodes.Count + "::kspNode is Null"); 152 | return null; 153 | } 154 | foreach (var item in nodes) 155 | { 156 | if (item.Id != null && item.Id != "" && item.Id == kspNode.id) return item; 157 | if (item.Name != null && item.Name != "" && item.Name == kspNode.name) return item; 158 | //如果Node的values中有Id,并且匹配的话就同样操作当前node 159 | if (item.Id != null && item.Id != "") 160 | { 161 | foreach (ConfigNode.Value value in kspNode.values) 162 | { 163 | if (value.name == "id" && value.value == item.Id) return item; 164 | } 165 | } 166 | } 167 | return null; 168 | } 169 | 170 | 171 | //载入汉化资源 172 | public List LoadXml() 173 | { 174 | List configs = new List(); 175 | 176 | Debug.Log("[xConfig]Load:zhConfig.xml"); 177 | XmlDocument doc = new XmlDocument(); 178 | doc.Load("GameData/DTS_zh/zhConfig.xml"); 179 | foreach (XmlNode item in doc.ChildNodes) 180 | { 181 | if (item.Name == "Configs") 182 | { 183 | LoadConfigs(item, configs); 184 | } 185 | } 186 | Debug.Log("[xConfig]Loaded:" + configs.Count.ToString()); 187 | 188 | //支持多配置文件 189 | foreach (string file in Directory.GetFiles("GameData/DTS_zh/xSquad", "*.xml")) 190 | { 191 | Debug.Log("[xConfig]Load:" + file); 192 | XmlDocument docXML = new XmlDocument(); 193 | docXML.Load(file); 194 | foreach (XmlNode item in docXML.ChildNodes) 195 | { 196 | if (item.Name == "Configs") 197 | { 198 | LoadConfigs(item, configs); 199 | } 200 | } 201 | Debug.Log("[xConfig]Loaded:" + configs.Count.ToString()); 202 | } 203 | 204 | return configs; 205 | } 206 | 207 | //载入所有配置节点 208 | public void LoadConfigs(XmlNode parentNode, List configs) 209 | { 210 | foreach (XmlNode sitem in parentNode.ChildNodes) 211 | { 212 | if (!(sitem is XmlElement)) continue; 213 | var item = sitem as XmlElement; 214 | 215 | Config config = new Config(); 216 | config.Name = item.GetAttribute("name"); 217 | //config.Type = item.GetAttribute("type"); 218 | config.Url = item.GetAttribute("url"); 219 | config.Id = item.GetAttribute("id"); 220 | 221 | if (config.Name == "") config.Name = null; 222 | if (config.Url == "") config.Url = null; 223 | 224 | foreach (XmlNode sonNode in item.ChildNodes) 225 | { 226 | if (sonNode.Name == "Values") 227 | LoadValues(sonNode, config.Values); 228 | else if (sonNode.Name == "Nodes") 229 | LoadNodes(sonNode, config.Nodes); 230 | } 231 | configs.Add(config); 232 | } 233 | 234 | 235 | } 236 | 237 | //载入子配置节点 238 | public void LoadNodes(XmlNode parentNode, List nodes) 239 | { 240 | foreach (XmlNode sitem in parentNode.ChildNodes) 241 | { 242 | if (!(sitem is XmlElement)) continue; 243 | var item = sitem as XmlElement; 244 | 245 | Node node = new Node(); 246 | node.Id = item.GetAttribute("id"); 247 | node.Name = item.GetAttribute("name"); 248 | 249 | foreach (XmlNode sonNode in item.ChildNodes) 250 | { 251 | if (sonNode.Name == "Values") 252 | LoadValues(sonNode, node.Values); 253 | else if (sonNode.Name == "Nodes") 254 | LoadNodes(sonNode, node.Nodes); 255 | } 256 | nodes.Add(node); 257 | } 258 | 259 | 260 | } 261 | //载入值的配置节点 262 | public void LoadValues(XmlNode parentNode, List values) 263 | { 264 | foreach (XmlNode sitem in parentNode.ChildNodes) 265 | { 266 | if (!(sitem is XmlElement)) continue; 267 | var item = sitem as XmlElement; 268 | 269 | Value value = new Value(); 270 | value.name = item.GetAttribute("name"); 271 | value.value = item.InnerText; 272 | values.Add(value); 273 | } 274 | } 275 | 276 | } 277 | 278 | 279 | //配置 280 | public class Config 281 | { 282 | public Config() 283 | { 284 | Values = new List(); 285 | Nodes = new List(); 286 | } 287 | 288 | public string Id { get; set; } 289 | public string Name { get; set; } 290 | //public string Type { get; set; } 291 | public string Url { get; set; } 292 | 293 | public List Values { get; set; } 294 | public List Nodes { get; set; } 295 | } 296 | 297 | public class Value 298 | { 299 | public string name { get; set; } 300 | public string value { get; set; } 301 | } 302 | 303 | public class Node 304 | { 305 | public Node() 306 | { 307 | Values = new List(); 308 | Nodes = new List(); 309 | } 310 | 311 | public string Id { get; set; } 312 | public string Name { get; set; } 313 | 314 | public List Values { get; set; } 315 | public List Nodes { get; set; } 316 | } 317 | } -------------------------------------------------------------------------------- /src/DTS_Addon/xImage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | using System.Text; 6 | 7 | using System.Xml; 8 | using UnityEngine; 9 | 10 | namespace DTS_Addon 11 | { 12 | [KSPAddon(KSPAddon.Startup.EveryScene, false)] 13 | public class xImage : MonoBehaviour 14 | { 15 | //private static Dictionary config; 16 | 17 | 18 | ////记录是否载入 19 | 20 | //static List LoadedLevels; 21 | 22 | //static Dictionary ImageFiles;//文件列表 23 | 24 | //bool IsOver = false; 25 | 26 | //void Start() 27 | //{ 28 | // if (ImageFiles != null) return; 29 | // ImageFiles = new Dictionary(); 30 | // foreach (var item in Directory.GetFiles("GameData/DTS_zh/Image/").ToList()) 31 | // {//载入所有图片资源 32 | // ImageFiles.Add(Path.GetFileNameWithoutExtension(item), item); 33 | // } 34 | 35 | // if (config == null) LoadConfig();//载入配置 36 | 37 | // LoadedLevels = new List(); 38 | //} 39 | 40 | //void Update() 41 | //{ 42 | 43 | // if (IsOver == true) return; 44 | // if (LoadedLevels.Contains(Application.loadedLevel)) return; 45 | // LoadedLevels.Add(Application.loadedLevel); 46 | 47 | 48 | // var mats = Resources.FindObjectsOfTypeAll(); 49 | 50 | // foreach (var item in mats) 51 | // { //遍历所有材质 52 | // var texture = item.GetTexture("_MainTex"); 53 | // if (texture == null) continue; 54 | 55 | // if (ImageFiles.ContainsKey(texture.name) == true) 56 | // {//找到可以替换的材质并替换 57 | // Texture2D t2D = new Texture2D(config[texture.name], config[texture.name], TextureFormat.ARGB32, false); 58 | // t2D.LoadImage(System.IO.File.ReadAllBytes(ImageFiles[texture.name])); 59 | // item.SetTexture("_MainTex", t2D); 60 | // ImageFiles.Remove(texture.name); 61 | 62 | // GameObject go = new GameObject("DDOL_" + texture.name); 63 | // go.AddComponent().material = item; 64 | // GameObject.DontDestroyOnLoad(go); 65 | // } 66 | // } 67 | // IsOver = true; 68 | //} 69 | 70 | //public static void LoadConfig() 71 | //{ 72 | // XmlDocument doc = new XmlDocument(); 73 | // config = new Dictionary(); 74 | // doc.Load(File.OpenRead("GameData/DTS_zh/zhImage.xml")); 75 | // foreach (XmlElement item in doc.DocumentElement.ChildNodes) 76 | // { 77 | // config[item.GetAttribute("id")] = int.Parse(item.InnerText); 78 | // } 79 | //} 80 | } 81 | } -------------------------------------------------------------------------------- /src/DTS_Addon/xItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using System.Text; 5 | using System.Xml; 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | using TMPro; 9 | 10 | 11 | namespace DTS_Addon 12 | { 13 | [KSPAddon(KSPAddon.Startup.EveryScene, false)] 14 | public class xItem : MonoBehaviour 15 | { 16 | static List zItems;//所有需要汉化的对象 17 | 18 | List NzItems;//当前屏幕的对象 19 | 20 | GameObject _UI; 21 | 22 | 23 | 24 | 25 | void Start() 26 | { 27 | if (zItems == null) 28 | Load(); 29 | 30 | _UI = GameObject.Find("_UI"); 31 | 32 | if (_UI != null) 33 | { 34 | Debug.Log("UI.................................................."); 35 | } 36 | if (zItems != null) 37 | { 38 | NzItems = new List(); 39 | foreach (var item in zItems) 40 | { 41 | if (item.Scene == HighLogic.LoadedScene) 42 | { 43 | NzItems.Add(item); 44 | } 45 | 46 | } 47 | } 48 | } 49 | 50 | void Update() 51 | { 52 | if (_UI == null) return; 53 | foreach (var item in NzItems) 54 | { 55 | if (item.NowObject == null) 56 | { 57 | item.NowObject = _UI.transform.Find(item.Path); 58 | } 59 | if (item.NowObject != null) 60 | { 61 | switch (item.Type) 62 | { 63 | case "TMP_Text": 64 | var st = item.NowObject.gameObject.GetComponent(); 65 | if (st == null) continue; 66 | if (item.zDict.ContainsKey(st.text)) 67 | { 68 | st.text = item.zDict[st.text]; 69 | } 70 | break; 71 | } 72 | } 73 | } 74 | } 75 | 76 | void OnGUI() 77 | { 78 | //p = GUI.TextField(new Rect(10, 50, 300, 20), p); 79 | 80 | //if (GUI.Button(new Rect(10, 100, 100, 20), "ABC")) 81 | //{ 82 | // tf = _UI.transform.Find(p); 83 | //} 84 | 85 | //if (tf != null) 86 | //{ 87 | // GUI.Label(new Rect(10, 150, 200, 20), tf.gameObject.name); 88 | //} 89 | } 90 | 91 | 92 | public static void Load() 93 | { 94 | //载入资源 95 | XmlDocument doc = new XmlDocument(); 96 | doc.Load("GameData/DTS_zh/zhItem.xml"); 97 | 98 | zItems = new List(); 99 | foreach (XmlNode items in doc.ChildNodes) 100 | { 101 | if (items.Name == "Items") 102 | { 103 | foreach (XmlNode item in items.ChildNodes) 104 | { 105 | if (!(item is XmlElement)) continue; 106 | var itemElement = item as XmlElement; 107 | 108 | zItem zitem = new zItem(); 109 | zitem.Scene = ToGameScenes(itemElement.GetAttribute("scene")); 110 | zitem.Path = itemElement.GetAttribute("path"); 111 | zitem.Type = itemElement.GetAttribute("type"); 112 | 113 | zitem.zDict = new Dictionary(); 114 | foreach (XmlNode itemString in item.ChildNodes) 115 | { 116 | if (!(itemString is XmlElement)) continue; 117 | zitem.zDict[((XmlElement)itemString).GetAttribute("name")] = itemString.InnerText; 118 | } 119 | zItems.Add(zitem); 120 | } 121 | } 122 | } 123 | 124 | Debug.Log("xItem Loaded:" + zItems.Count.ToString()); 125 | 126 | 127 | } 128 | 129 | public static GameScenes ToGameScenes(string scene) 130 | { 131 | switch (scene.ToUpper()) 132 | { 133 | case "LOADING": 134 | return GameScenes.LOADING; 135 | case "LOADINGBUFFER": 136 | return GameScenes.LOADINGBUFFER; 137 | case "MAINMENU": 138 | return GameScenes.MAINMENU; 139 | case "SETTINGS": 140 | return GameScenes.SETTINGS; 141 | case "CREDITS": 142 | return GameScenes.CREDITS; 143 | case "SPACECENTER": 144 | return GameScenes.SPACECENTER; 145 | case "EDITOR": 146 | return GameScenes.EDITOR; 147 | case "FLIGHT": 148 | return GameScenes.FLIGHT; 149 | case "TRACKSTATION": 150 | return GameScenes.TRACKSTATION; 151 | //case "SPH": 152 | // return GameScenes.SPH; 153 | case "PSYSTEM": 154 | return GameScenes.PSYSTEM; 155 | 156 | default: 157 | return GameScenes.LOADING; 158 | } 159 | 160 | } 161 | 162 | 163 | public class zItem 164 | { 165 | public GameScenes Scene { get; set; } 166 | 167 | public string Path { get; set; } 168 | 169 | public string Type { get; set; } 170 | 171 | //需要修改的对象 172 | public Transform NowObject { get; set; } 173 | 174 | public Dictionary zDict { get; set; } 175 | 176 | 177 | } 178 | 179 | } 180 | } -------------------------------------------------------------------------------- /src/DTS_Addon/xLoading.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | using System.Text; 6 | using TMPro; 7 | using System.Xml; 8 | using UnityEngine; 9 | 10 | namespace DTS_Addon 11 | { 12 | [KSPAddon(KSPAddon.Startup.Instantly, true)] 13 | public class xMenu : MonoBehaviour 14 | { 15 | List mytips = new List(); 16 | 17 | void Start() 18 | { 19 | XmlDocument doc = new XmlDocument(); 20 | doc.Load(File.OpenRead("GameData/DTS_zh/zhLoadingTips.xml")); 21 | foreach (XmlElement item in doc.DocumentElement.ChildNodes) 22 | { 23 | mytips.Add("" + (String)item.InnerText); 24 | } 25 | } 26 | 27 | 28 | string nowText = ""; 29 | TextMeshPro loadText; 30 | System.Random random = new System.Random(); 31 | 32 | void Update() 33 | { 34 | if (loadText == null) 35 | { 36 | var go = GameObject.Find("TMP_Text"); 37 | if (go == null) return; 38 | 39 | loadText = go.GetComponent(); 40 | loadText.fontSize = 16; 41 | } 42 | 43 | if (nowText != loadText.text) 44 | { 45 | int c = random.Next(mytips.Count); 46 | loadText.text = "" + mytips[c]; 47 | nowText = loadText.text; 48 | if (mytips.Count > 1) 49 | mytips.RemoveAt(c); 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/DTS_zh/DTS_zh.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {71DE13EA-3237-47E3-BFE7-7B12AD946D73} 8 | Library 9 | Properties 10 | DTS_zh 11 | DTS_zh 12 | v4.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | false 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | false 34 | 35 | 36 | true 37 | bin\x64\ 38 | TRACE;DEBUG;x64 39 | full 40 | AnyCPU 41 | prompt 42 | MinimumRecommendedRules.ruleset 43 | false 44 | 45 | 46 | true 47 | bin\x32\ 48 | TRACE;DEBUG;x32 49 | full 50 | AnyCPU 51 | prompt 52 | MinimumRecommendedRules.ruleset 53 | false 54 | 55 | 56 | 57 | ..\..\..\..\..\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll 58 | 59 | 60 | E:\SteamLibrary\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp-firstpass.dll 61 | 62 | 63 | 64 | 65 | 66 | ..\..\..\..\..\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll 67 | 68 | 69 | ..\..\..\..\..\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.UI.dll 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 89 | -------------------------------------------------------------------------------- /src/DTS_zh/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DTS_zh")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DTS_zh")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("7a86f531-94e3-4c6e-a058-f58bae619c98")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/DTS_zh/README.md: -------------------------------------------------------------------------------- 1 | #项目介绍 2 | 3 | 汉化核心,用于解决字库,资源汉化等一些无法在插件中实现汉化的事情。 4 | -------------------------------------------------------------------------------- /src/DTS_zh/TimDebug.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | using UnityEngine; 6 | 7 | public class TimDebug 8 | { 9 | 10 | public void OnGUI(MainMenu mainMenu) 11 | { 12 | 13 | // GUIStyle gs = new GUIStyle(GUI.skin.GetStyle("Label")); 14 | // gs.fontSize = 28; 15 | // gs.fontStyle = FontStyle.Bold; 16 | //// gs.font.material = mainMenu .backBtn.renderer.material; 17 | 18 | // GUI.Label(new Rect(220, 220, 500, 500), "深度时空荣誉汉化", gs); 19 | 20 | // GUI.Label(new Rect(300, 300, 500, 500), "深度时空荣誉汉化", gs); 21 | // GUI.Label(new Rect(400, 200, 500, 500), "深度时空荣誉汉化", gs); 22 | // GUI.Label(new Rect(200, 400, 500, 500), "深度时空荣誉汉化", gs); 23 | 24 | sss = "ccc"; 25 | } 26 | 27 | private string sss = "dddd"; 28 | //public static void getText(String text) 29 | //{ 30 | // logout(String.Format("This Text is '{0}'",text)); 31 | //} 32 | // public static void logout(String text) 33 | // { 34 | // text = text + System.Environment.NewLine; 35 | // FileStream fs = new FileStream("logout.log", FileMode.Append); //获得字节数组 36 | // byte [] data =new UTF8Encoding().GetBytes(text); //开始写入 37 | // fs.Write (data, 0, data.Length); //清空缓冲区、关闭流 fs.Flush(); 38 | // fs.Close(); 39 | // } 40 | 41 | } -------------------------------------------------------------------------------- /src/DTS_zh/xDice.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | //using System.Collections.Generic; 3 | // 4 | //using System.Text; 5 | //using System.Xml; 6 | //using System.IO; 7 | //using UnityEngine; 8 | 9 | //namespace DTS_zh 10 | //{ 11 | // class xDice 12 | // { 13 | // //EditorTooltip.ShowToolTip(String, MonoBehaviour) : Void //开头 传参数1 14 | // public static string TooltipText(String text) 15 | // { 16 | // //TimDebug.logout(text); 17 | // switch (text) 18 | // { 19 | // case "Parts": 20 | // return "组件"; 21 | // case "Action Groups": 22 | // return "功能组管理"; 23 | // case "Crew": 24 | // return "成员管理"; 25 | // case "Mission Flag": 26 | // return "任务旗帜"; 27 | // case "New": 28 | // return "新建"; 29 | // case "Load": 30 | // return "读取"; 31 | // case "Save": 32 | // return "保存"; 33 | // case "Launch": 34 | // return "发射"; 35 | // case "Exit": 36 | // return "退出"; 37 | // case "Angle Snap": 38 | // return "角度捕捉"; 39 | // case "Symmetry Mode": 40 | // return "对称模式"; 41 | // case "Center of Mass": 42 | // return "质量中心"; 43 | // case "Center of Lift": 44 | // return "气动中心"; 45 | // case "Center of Thrust": 46 | // return "推力中心"; 47 | // } 48 | 49 | // return text; 50 | // } 51 | 52 | // public static void setSpaceTrackingTime(SpaceTracking st) 53 | // { 54 | 55 | // Debug.Log("============" + st.guiSkin.customStyles[3].font.name); 56 | // st.guiSkin.customStyles[3].font = st.guiSkin.customStyles[2].font; 57 | // st.guiSkin.customStyles[3].fontSize = 16; 58 | // } 59 | 60 | 61 | // // 62 | 63 | // } 64 | 65 | 66 | //} 67 | -------------------------------------------------------------------------------- /src/DTS_zh/xField.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | //using System.Collections.Generic; 3 | //using System.IO; 4 | // 5 | //using System.Text; 6 | // 7 | //using System.Xml; 8 | //using UnityEngine; 9 | 10 | //namespace DTS_zh 11 | //{ 12 | // //ac BaseField.ctor(KSPField, FieldInfo, Object)//传参数1 13 | // public class xField 14 | // { 15 | // private static Dictionary dict_Field; 16 | 17 | // public static void Trans(KSPField actionAttr) 18 | // { 19 | // if (dict_Field == null) 20 | // { 21 | // LoadDict(); 22 | // } 23 | // if (dict_Field.ContainsKey(actionAttr.guiName)) 24 | // { 25 | // actionAttr.guiName = dict_Field[actionAttr.guiName]; 26 | // } 27 | // else 28 | // { 29 | // // Debug.Log("[xField]Not find guiName:" + actionAttr.guiName); 30 | // } 31 | // } 32 | 33 | // public static void LoadDict() 34 | // { 35 | // XmlDocument doc = new XmlDocument(); 36 | // dict_Field = new Dictionary(); 37 | // doc.Load(File.OpenRead("GameData/DTS_zh/zhField.xml")); 38 | // foreach (XmlElement item in doc.DocumentElement.ChildNodes) 39 | // { 40 | // dict_Field[item.GetAttribute("name")] = ((XmlCDataSection)item.FirstChild).InnerText; 41 | // } 42 | // } 43 | // } 44 | //} 45 | -------------------------------------------------------------------------------- /src/DTS_zh/xFont.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | using UnityEngine; 6 | using TMPro; 7 | 8 | namespace DTS_zh 9 | { 10 | //已经被DTS_Addon.xFont替代 11 | public static class xFont 12 | { 13 | // Fields 14 | //private const string Font_10 = "cn10"; 15 | //private const string Font_12 = "cn12"; 16 | //private const string Font_14 = "cn14"; 17 | //private const string Font_14b = "cn14b"; 18 | //private const string Font_16 = "cn16"; 19 | //private const string Font_16b = "cn16b"; 20 | //public static Dictionary FontList = new Dictionary(); 21 | 22 | //// Methods 23 | //public static void loadFontList() 24 | //{ 25 | // string[] strArray = new string[] { "cn10", "cn12", "cn14", "cn14b", "cn16", "cn16b" }; 26 | // foreach (string str in strArray) 27 | // { 28 | // Font2Font font = new Font2Font(); 29 | // font.Load(str); 30 | // FontList.Add(str, font); 31 | // } 32 | //} 33 | 34 | 35 | //private static Dictionary SSList = new Dictionary(); 36 | 37 | 38 | 39 | 40 | public static void getFontInfo(TMP_Text ST) 41 | { 42 | return; 43 | //if (FontList.Count == 0) 44 | //{ 45 | // loadFontList(); 46 | //} 47 | ////Debug.LogWarning("[xFont:getFontInfo]font.name:" + ST.font.name); 48 | 49 | //string str = ""; 50 | //switch (ST.font.name) 51 | //{ 52 | // case "Arial, Fancy": 53 | // str = "cn12"; 54 | // break; 55 | 56 | // case "Arial10": 57 | // str = "cn10"; 58 | // break; 59 | 60 | // case "Arial11": 61 | // str = "cn10"; 62 | // break; 63 | 64 | // case "Arial12": 65 | // str = "cn12"; 66 | // break; 67 | 68 | // case "Arial14": 69 | // str = "cn14"; 70 | // break; 71 | 72 | // case "Arial14Bold": 73 | // str = "cn14b"; 74 | // break; 75 | 76 | // case "Arial16": 77 | // str = "cn16"; 78 | // break; 79 | 80 | // case "Arial16_Mk2": 81 | // str = "cn16b"; 82 | // break; 83 | 84 | // case "Calibri12": 85 | // str = "cn12"; 86 | // break; 87 | 88 | // case "Calibri14": 89 | // str = "cn14"; 90 | // break; 91 | 92 | // case "Calibri16": 93 | // str = "cn16"; 94 | // break; 95 | 96 | // default: 97 | // str = "cn12"; 98 | // Debug.LogWarning("[xFont]" + ST.font.name + " is Null"); 99 | // break; 100 | //} 101 | //if (ST.font.name != str) 102 | //{ 103 | 104 | // ST.SetFont(FontList[str].fontDef, FontList[str].fontMat); 105 | //} 106 | } 107 | 108 | //public struct Font2Font 109 | //{ 110 | // public string Name; 111 | // //private string sFilePath; 112 | // public TextAsset fontDef; 113 | // public Material fontMat; 114 | // public void Load(string fontName) 115 | // { 116 | // this.Name = fontName; 117 | // //查找指定着色器 118 | // this.fontMat = new Material(Shader.Find("Sprite/Vertex Colored")); 119 | 120 | 121 | // //载入贴图(题外话:KSP做的资源载入感觉不错,可以考虑收纳) 122 | 123 | // //Debug.Log("fontName:" + fontName + " fontPath" + fontName); 124 | 125 | // Texture texture = GameDatabase.Instance.GetTexture("DTS_zh/cnfont/" + fontName, false); 126 | // if (texture == null) 127 | // { 128 | // MonoBehaviour.print("[FontReplacer] Error:Texture Assert Failed ."); 129 | // } 130 | // //设置材质球贴图 131 | // //"_MainTex"是主要的漫反射纹理,也能通过 mainTexture 属性访问 132 | // this.fontMat.SetTexture("_MainTex", texture); 133 | // //创建不卸载的资源 134 | // UnityEngine.Object.DontDestroyOnLoad(this.fontMat); 135 | // if (this.fontMat == null) 136 | // { 137 | // MonoBehaviour.print("[FontReplacer] Error:fontMat Assert Failed ."); 138 | // } 139 | // string fontPath = System.IO.Directory.GetCurrentDirectory() + "/GameData/DTS_zh/cnfont/" + fontName; 140 | // var www = new WWW("file:///" + fontPath + ".fnt.unity3d"); 141 | 142 | // this.fontDef = www.assetBundle.mainAsset as TextAsset; 143 | // if (this.fontDef == null) 144 | // { 145 | // MonoBehaviour.print("[FontReplacer] Error:sptFont Assert Failed ."); 146 | // } 147 | // } 148 | //} 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /src/DTS_zh/xRead.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using System.Xml; 6 | using UnityEngine; 7 | namespace DTS_zh 8 | { 9 | public class xRead 10 | { 11 | private static Dictionary dict_zh; 12 | private static Dictionary dict_en; 13 | 14 | //A.倒数第4个.(Int32) : String//传参数1 15 | public static string Trans(int id) 16 | { 17 | //Debug.LogWarning("[Trans]" + id.ToString()); 18 | 19 | if (dict_zh == null) 20 | { 21 | Load(); 22 | } 23 | if (dict_zh.ContainsKey(id)) 24 | { 25 | return dict_zh[id]; 26 | } 27 | 28 | 29 | if (dict_en == null) 30 | { 31 | Load(); 32 | } 33 | if (dict_en.ContainsKey(id)) 34 | { 35 | return dict_en[id]; 36 | } 37 | return "[Not Find " + id.ToString() + "]"; 38 | } 39 | public static void Load() 40 | { 41 | Loaden(); 42 | Loadzh(); 43 | } 44 | 45 | 46 | public static void Loadzh() 47 | { 48 | XmlDocument doc = new XmlDocument(); 49 | dict_zh = new Dictionary(); 50 | 51 | //#if x32 52 | doc.Load(File.OpenRead("GameData/DTS_zh/zh.xml")); 53 | //#else //x64 54 | // doc.Load(File.OpenRead("GameData/DTS_zh/zh_x64.xml")); 55 | //#endif 56 | 57 | foreach (XmlNode item in doc.DocumentElement.ChildNodes) 58 | { 59 | if (!(item is XmlElement)) continue; 60 | 61 | if (((XmlElement)item).HasAttribute("noT") == true) 62 | { 63 | dict_zh[int.Parse(((XmlElement)item).GetAttribute("id"))] = dict_en[int.Parse(((XmlElement)item).GetAttribute("id"))]; 64 | } 65 | else 66 | { 67 | dict_zh[int.Parse(((XmlElement)item).GetAttribute("id"))] = ((XmlCDataSection)item.FirstChild).InnerText; 68 | } 69 | } 70 | 71 | Debug.Log("[xRead]Loaded:" + dict_zh.Count.ToString()); 72 | } 73 | 74 | public static void Loaden() 75 | { 76 | XmlDocument doc = new XmlDocument(); 77 | dict_en = new Dictionary(); 78 | //#if x32 79 | doc.Load(File.OpenRead("GameData/DTS_zh/en.xml")); 80 | //#else //x64 81 | // doc.Load(File.OpenRead("GameData/DTS_zh/en_x64.xml")); 82 | //#endif 83 | foreach (XmlNode item in doc.DocumentElement.ChildNodes) 84 | { 85 | if (!(item is XmlElement)) continue; 86 | dict_en[int.Parse(((XmlElement)item).GetAttribute("id"))] = ((XmlCDataSection)item.FirstChild).InnerText; 87 | } 88 | 89 | } 90 | 91 | public string Test(int a) 92 | { 93 | string zh = DTS_zh.xRead.Trans(a); 94 | if (zh != null) return zh; 95 | 96 | 97 | return null; 98 | } 99 | } 100 | } -------------------------------------------------------------------------------- /src/DTS_zh/xText.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | using System.Text; 6 | 7 | using System.Xml; 8 | using UnityEngine; 9 | 10 | namespace DTS_zh 11 | { 12 | //已经被DTS_Addon.xText替代 13 | public class xText 14 | { 15 | private static Dictionary dict_Field; 16 | 17 | //Assembly-CSharp-firstpass\TMP_Text.ProcessString 18 | //str = xText.Trans(str); 19 | public static string Trans(string value) 20 | { 21 | return value; 22 | //if (dict_Field == null) 23 | //{ 24 | // LoadDict(); 25 | //} 26 | //if (dict_Field.ContainsKey(value)) 27 | //{ 28 | // return dict_Field[value]; 29 | //} 30 | //else 31 | //{ 32 | // // Debug.Log("[xText]Not find Text:" + value); 33 | // return value; 34 | //} 35 | } 36 | 37 | //public static void LoadDict() 38 | //{ 39 | // XmlDocument doc = new XmlDocument(); 40 | // dict_Field = new Dictionary(); 41 | // doc.Load(File.OpenRead("GameData/DTS_zh/zhText.xml")); 42 | // foreach (XmlElement item in doc.DocumentElement.ChildNodes) 43 | // { 44 | // dict_Field[item.GetAttribute("name")] = ((XmlCDataSection)item.FirstChild).InnerText; 45 | // } 46 | //} 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/KSP_zh.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KSP_zh", "KSP_zh\KSP_zh.csproj", "{B9C139F7-399B-4148-9DC1-2B3A1518C826}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DTS_zh", "DTS_zh\DTS_zh.csproj", "{71DE13EA-3237-47E3-BFE7-7B12AD946D73}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DTS_Addon", "DTS_Addon\DTS_Addon.csproj", "{7E05DC0C-7DA6-4691-B258-109AB54617F9}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {B9C139F7-399B-4148-9DC1-2B3A1518C826}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {B9C139F7-399B-4148-9DC1-2B3A1518C826}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {B9C139F7-399B-4148-9DC1-2B3A1518C826}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {B9C139F7-399B-4148-9DC1-2B3A1518C826}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {71DE13EA-3237-47E3-BFE7-7B12AD946D73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {71DE13EA-3237-47E3-BFE7-7B12AD946D73}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {71DE13EA-3237-47E3-BFE7-7B12AD946D73}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {71DE13EA-3237-47E3-BFE7-7B12AD946D73}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {7E05DC0C-7DA6-4691-B258-109AB54617F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {7E05DC0C-7DA6-4691-B258-109AB54617F9}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {7E05DC0C-7DA6-4691-B258-109AB54617F9}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {7E05DC0C-7DA6-4691-B258-109AB54617F9}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /src/KSP_zh.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TimChen44/KSP_zh/3a4296f8947193ffb6be8dfde3cf2fee5abce747/src/KSP_zh.v12.suo -------------------------------------------------------------------------------- /src/KSP_zh/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/KSP_zh/ConvertText.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | using System.Windows.Forms; 8 | using System.Xml; 9 | 10 | namespace KSP_zh 11 | { 12 | public static class ConvertText 13 | { 14 | public static void ConvertTxt() 15 | { 16 | OpenFileDialog xmlDig = new OpenFileDialog(); 17 | xmlDig.Filter = "*.xml|*.xml"; 18 | if (xmlDig.ShowDialog() == DialogResult.Cancel) return; 19 | 20 | var xml = LoadDict(xmlDig.FileName); 21 | 22 | string temp = @"{0} = {1}"; 23 | StringBuilder txt = new StringBuilder(); 24 | foreach (var item in xml) 25 | { 26 | txt.AppendLine(string.Format(temp, item.Key.ToString(), item.Value.Replace("\r", @"\r").Replace("\n", @"\n"))); 27 | } 28 | 29 | File.WriteAllText(xmlDig.FileName + ".txt", txt.ToString()); 30 | 31 | } 32 | 33 | public static Dictionary LoadDict(string xmlPath) 34 | { 35 | XmlDocument doc = new XmlDocument(); 36 | Dictionary dict = new Dictionary(); 37 | doc.Load(File.OpenRead(xmlPath)); 38 | foreach (XmlElement item in doc.DocumentElement.ChildNodes) 39 | { 40 | dict[int.Parse(item.GetAttribute("id"))] = ((XmlCDataSection)item.FirstChild).InnerText; 41 | } 42 | return dict; 43 | } 44 | 45 | 46 | 47 | public static void ConvertXml() 48 | { 49 | OpenFileDialog txtDig = new OpenFileDialog(); 50 | txtDig.Filter="*.txt|*.txt"; 51 | if (txtDig.ShowDialog() == DialogResult.Cancel) return; 52 | 53 | StringBuilder xml = new StringBuilder(); 54 | string temp = @""; 55 | xml.AppendLine(""); 56 | var aa = File.ReadAllLines(txtDig.FileName); 57 | foreach (var item in File.ReadAllLines(txtDig.FileName)) 58 | { 59 | string key = item.Substring(0, item.IndexOf("=") - 1).TrimEnd(); 60 | string value = item.Substring(item.IndexOf("=") + 1).TrimStart().Replace(@"\r", "\r").Replace(@"\n", "\n"); 61 | 62 | xml.AppendLine(string.Format(temp, key, value)); 63 | } 64 | xml.AppendLine(""); 65 | 66 | File.WriteAllText(txtDig.FileName + ".xml", xml.ToString()); 67 | 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/KSP_zh/ExtractCfg.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using System.Windows.Forms; 7 | using System.IO; 8 | 9 | namespace KSP_zh 10 | { 11 | class ExtractCfg 12 | { 13 | public static void Extract(string ksppath, string vel) 14 | { 15 | string Parts = ksppath + @"\GameData\Squad\Parts"; 16 | 17 | StringBuilder en = new StringBuilder(); 18 | StringBuilder zh = new StringBuilder(); 19 | 20 | 21 | 22 | foreach (var item in System.IO.Directory.GetFiles(Parts, "*.cfg", System.IO.SearchOption.AllDirectories)) 23 | { 24 | IEnumerable lines = System.IO.File.ReadLines(item, Encoding.Default); 25 | 26 | string nameline = lines.FirstOrDefault(x => x.IndexOf("name") == 0); 27 | 28 | if (nameline == null) continue; 29 | 30 | string name = nameline.Substring(nameline.IndexOf("=") + 1).Trim(); 31 | //en.AppendLine(name); 32 | //zh.AppendLine(name); 33 | 34 | string titleline = lines.FirstOrDefault(x => x.IndexOf("title") == 0); 35 | if (string.IsNullOrWhiteSpace(titleline) == false) 36 | { 37 | en.AppendLine(GetValue(name, titleline)); 38 | zh.AppendLine(GetValue(name, titleline)); 39 | } 40 | 41 | string descriptionline = lines.FirstOrDefault(x => x.IndexOf("description") == 0); 42 | if (string.IsNullOrWhiteSpace(descriptionline) == false) 43 | { 44 | en.AppendLine(GetValue(name, descriptionline)); 45 | zh.AppendLine(GetValue(name, descriptionline)); 46 | } 47 | 48 | string manufacturerline = lines.FirstOrDefault(x => x.IndexOf("manufacturer") == 0); 49 | if (string.IsNullOrWhiteSpace(manufacturerline) == false) 50 | { 51 | en.AppendLine(GetValue(name, manufacturerline)); 52 | zh.AppendLine(GetValue(name, manufacturerline)); 53 | } 54 | 55 | 56 | 57 | en.AppendLine(); 58 | zh.AppendLine(); 59 | 60 | } 61 | 62 | if (System.IO.Directory.Exists(Application.StartupPath + "\\" + vel) == false) 63 | System.IO.Directory.CreateDirectory(Application.StartupPath + "\\" + vel); 64 | 65 | File.WriteAllText(Application.StartupPath + "\\" + vel + @"\zh.txt", zh.ToString()); 66 | File.WriteAllText(Application.StartupPath + "\\" + vel + @"\en.txt", zh.ToString()); 67 | 68 | 69 | } 70 | 71 | public static string GetValue(string name, string line) 72 | { 73 | string temp = "{0}.{1}={2}"; 74 | return string.Format(temp, name, 75 | line.Substring(0, line.IndexOf("=") - 1).Trim(), 76 | line.Substring(line.IndexOf("=") + 1).Trim()); 77 | } 78 | 79 | 80 | public static void Injection(string ksppath, string zhPath) 81 | { 82 | string Parts = ksppath + @"\GameData\Squad\Parts"; 83 | 84 | IEnumerable zhs = File.ReadLines(zhPath, Encoding.Default); 85 | foreach (var item in System.IO.Directory.GetFiles(Parts, "*.cfg", System.IO.SearchOption.AllDirectories)) 86 | { 87 | List lines = System.IO.File.ReadLines(item, Encoding.Default).ToList(); 88 | //查找名称所在行 89 | string nameline = lines.FirstOrDefault(x => x.IndexOf("name") == 0); 90 | 91 | if (nameline == null) continue; 92 | //获得名称 93 | string name = nameline.Substring(nameline.IndexOf("=") + 1).Trim(); 94 | 95 | //查看这个名称是否有汉化文件 96 | if (zhs.Any(x => x.IndexOf(name) == 0) == false) continue; 97 | 98 | //title的汉化 99 | int titleLN = GetLineNumber(lines, "title"); 100 | if (titleLN != -1)//存在这个属性就对他汉化 101 | { 102 | //找到汉化的信息 103 | var titleZh = zhs.FirstOrDefault(x => x.IndexOf(name + ".title=") == 0); 104 | if (!string.IsNullOrWhiteSpace(titleZh))//存在汉化信息 105 | { 106 | //更新文件中的信息 107 | lines[titleLN] = lines[titleLN].Substring(0, lines[titleLN].IndexOf("=") + 1) 108 | + " " + titleZh.Substring(titleZh.IndexOf("=") + 1).Trim(); 109 | } 110 | } 111 | 112 | //description的汉化 113 | int descriptionLN = GetLineNumber(lines, "description"); 114 | if (descriptionLN != -1)//存在这个属性就对他汉化 115 | { 116 | //找到汉化的信息 117 | var descriptionZh = zhs.FirstOrDefault(x => x.IndexOf(name + ".description=") == 0); 118 | if (!string.IsNullOrWhiteSpace(descriptionZh))//存在汉化信息 119 | { 120 | //更新文件中的信息 121 | lines[descriptionLN] = lines[descriptionLN].Substring(0, lines[descriptionLN].IndexOf("=") + 1) 122 | + " " + descriptionZh.Substring(descriptionZh.IndexOf("=") + 1).Trim(); 123 | } 124 | } 125 | 126 | //description的汉化 127 | int manufacturerLN = GetLineNumber(lines, "manufacturer"); 128 | if (manufacturerLN != -1)//存在这个属性就对他汉化 129 | { 130 | //找到汉化的信息 131 | var manufacturerZh = zhs.FirstOrDefault(x => x.IndexOf(name + ".manufacturer=") == 0); 132 | if (!string.IsNullOrWhiteSpace(manufacturerZh))//存在汉化信息 133 | { 134 | //更新文件中的信息 135 | lines[manufacturerLN] = lines[manufacturerLN].Substring(0, lines[manufacturerLN].IndexOf("=") + 1) 136 | + " " + manufacturerZh.Substring(manufacturerZh.IndexOf("=") + 1).Trim(); 137 | } 138 | } 139 | 140 | System.IO.File.WriteAllLines(item, lines,Encoding.Unicode ); 141 | } 142 | 143 | 144 | } 145 | 146 | public static int GetLineNumber(List lines, string text) 147 | { 148 | for (int i = 0; i < lines.Count(); i++) 149 | { 150 | if (lines[i].IndexOf(text) == 0) return i; 151 | } 152 | return -1; 153 | } 154 | 155 | 156 | 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /src/KSP_zh/ExtractText.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using System.IO; 7 | using System.Windows.Forms; 8 | 9 | namespace KSP_zh 10 | { 11 | public class ExtractText 12 | { 13 | public static void GetText(string ksppath,string vel) 14 | { 15 | 16 | string s = "QXNzZW1ibHktQ1NoYXJwQXNzZW1ibHktQ1NoYXJw"; 17 | byte[] bytes = Convert.FromBase64String(s); 18 | s = Encoding.UTF8.GetString(bytes, 0, bytes.Length); 19 | System.Reflection.Assembly dll = System.Reflection.Assembly.LoadFile(ksppath + @"\KSP_Data\Managed\Assembly-CSharp.dll"); 20 | Stream stream = dll.GetManifestResourceStream(s); 21 | byte[] num = Getbyte(stream); 22 | 23 | 24 | Encoding encoding2 = Encoding.Unicode; 25 | 26 | StringBuilder en = new StringBuilder(); 27 | StringBuilder zh = new StringBuilder(); 28 | int count = 0; 29 | int id = 0x1; 30 | 31 | string temp = @""; 32 | // 33 | 34 | en.AppendLine(""); 35 | zh.AppendLine(""); 36 | 37 | while (id < num.Length) 38 | { 39 | string strID = id.ToString(); 40 | count = num[id]; 41 | if (count == 0x80) 42 | { 43 | count = num[id + 1]; 44 | id += 1; 45 | } 46 | else if (count > 0x80) 47 | { 48 | count = (count & -129) << 8; 49 | count |= num[id + 1]; 50 | id += 1; 51 | } 52 | string str1 = encoding2.GetString(num, id + 1, count); 53 | en.AppendLine(string.Format(temp, strID, str1)); 54 | zh.AppendLine(string.Format(temp, strID, str1)); 55 | id = id + 1 + count; 56 | } 57 | en.AppendLine(""); 58 | zh.AppendLine(""); 59 | 60 | if (System.IO.Directory.Exists(Application.StartupPath + "\\" + vel) == false) 61 | System.IO.Directory.CreateDirectory(Application.StartupPath + "\\" + vel); 62 | 63 | File.WriteAllText(Application.StartupPath + "\\" + vel + @"\zh.xml", zh.ToString()); 64 | File.WriteAllText(Application.StartupPath + "\\" + vel + @"\en.xml", en.ToString()); 65 | 66 | return; 67 | 68 | 69 | } 70 | 71 | public static void GetText64(string ksppath, string vel) 72 | { 73 | 74 | string s = "QXNzZW1ibHktQ1NoYXJwJA=="; 75 | byte[] bytes = Convert.FromBase64String(s); 76 | s = Encoding.UTF8.GetString(bytes, 0, bytes.Length); 77 | System.Reflection.Assembly dll = System.Reflection.Assembly.LoadFile(ksppath + @"\KSP_x64_Data\Managed\Assembly-CSharp.dll"); 78 | Stream stream = dll.GetManifestResourceStream(s); 79 | byte[] num = ReferenceProvider.UncheckMemory(0x61L ,stream); 80 | 81 | 82 | Encoding encoding2 = Encoding.Unicode; 83 | 84 | StringBuilder en = new StringBuilder(); 85 | StringBuilder zh = new StringBuilder(); 86 | int count = 0; 87 | int id = 0x1; 88 | 89 | string temp = @""; 90 | //< string id = "1" >< ![CDATA[Detonator]] > 91 | 92 | en.AppendLine(""); 93 | zh.AppendLine(""); 94 | 95 | while (id < num.Length) 96 | { 97 | string strID = id.ToString(); 98 | if ((num[id] & 0x80) == 0) 99 | { 100 | count = num[id]; 101 | id++; 102 | } 103 | else if ((num[id] & 0x40) == 0) 104 | { 105 | count = (num[id] & -129) << 8; 106 | count |= num[id + 1]; 107 | id += 2; 108 | } 109 | else 110 | { 111 | count = (num[id] & -193) << 0x18; 112 | count |= num[id + 1] << 0x10; 113 | count |= num[id + 2] << 8; 114 | count |= num[id + 3]; 115 | id += 4; 116 | } 117 | string str1 = null; 118 | if (count < 1) 119 | { 120 | str1 = string.Empty; 121 | } 122 | else 123 | { 124 | str1 = encoding2.GetString(num, id, count); 125 | } 126 | en.AppendLine(string.Format(temp, strID, str1)); 127 | zh.AppendLine(string.Format(temp, strID, str1)); 128 | id = id + count; 129 | } 130 | en.AppendLine(""); 131 | zh.AppendLine(""); 132 | 133 | if (System.IO.Directory.Exists(Application.StartupPath + "\\" + vel) == false) 134 | System.IO.Directory.CreateDirectory(Application.StartupPath + "\\" + vel); 135 | 136 | File.WriteAllText(Application.StartupPath + "\\" + vel + @"\zh_x64.xml", zh.ToString()); 137 | File.WriteAllText(Application.StartupPath + "\\" + vel + @"\en_x64.xml", en.ToString()); 138 | 139 | return; 140 | 141 | 142 | } 143 | 144 | 145 | internal static byte[] Getbyte(Stream steam) 146 | { 147 | byte[] buffer; 148 | int num8 = steam.ReadByte(); 149 | byte num = (byte)num8; 150 | num = (byte)~num; 151 | for (int i = 1; i < 2; i++) 152 | { 153 | int num9 = steam.ReadByte(); 154 | } 155 | Label_0023: 156 | switch (1) 157 | { 158 | case 0: 159 | goto Label_0023; 160 | 161 | default: 162 | { 163 | if (1 == 0) 164 | { 165 | } 166 | long length = steam.Length; 167 | long position = steam.Position; 168 | buffer = new byte[length - position]; 169 | int num12 = steam.Read(buffer, 0, buffer.Length); 170 | if ((num & 0x20) == 0) 171 | { 172 | return buffer; 173 | } 174 | break; 175 | } 176 | } 177 | Label_0062: 178 | switch (6) 179 | { 180 | case 0: 181 | goto Label_0062; 182 | 183 | default: 184 | for (int j = 0; j < buffer.Length; j++) 185 | { 186 | buffer[j] = (byte)~buffer[j]; 187 | } 188 | break; 189 | } 190 | Label_0082: 191 | switch (6) 192 | { 193 | case 0: 194 | goto Label_0082; 195 | } 196 | return buffer; 197 | } 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /src/KSP_zh/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace KSP_zh 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 false。 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows 窗体设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.label1 = new System.Windows.Forms.Label(); 32 | this.button1 = new System.Windows.Forms.Button(); 33 | this.button2 = new System.Windows.Forms.Button(); 34 | this.textBox1 = new System.Windows.Forms.TextBox(); 35 | this.label2 = new System.Windows.Forms.Label(); 36 | this.button3 = new System.Windows.Forms.Button(); 37 | this.button4 = new System.Windows.Forms.Button(); 38 | this.oldvel = new System.Windows.Forms.TextBox(); 39 | this.label3 = new System.Windows.Forms.Label(); 40 | this.label4 = new System.Windows.Forms.Label(); 41 | this.button5 = new System.Windows.Forms.Button(); 42 | this.button6 = new System.Windows.Forms.Button(); 43 | this.button7 = new System.Windows.Forms.Button(); 44 | this.button8 = new System.Windows.Forms.Button(); 45 | this.button9 = new System.Windows.Forms.Button(); 46 | this.button10 = new System.Windows.Forms.Button(); 47 | this.SuspendLayout(); 48 | // 49 | // label1 50 | // 51 | this.label1.AutoSize = true; 52 | this.label1.Location = new System.Drawing.Point(115, 20); 53 | this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); 54 | this.label1.Name = "label1"; 55 | this.label1.Size = new System.Drawing.Size(41, 12); 56 | this.label1.TabIndex = 0; 57 | this.label1.Text = "label1"; 58 | this.label1.Click += new System.EventHandler(this.label1_Click); 59 | // 60 | // button1 61 | // 62 | this.button1.Location = new System.Drawing.Point(15, 8); 63 | this.button1.Margin = new System.Windows.Forms.Padding(2); 64 | this.button1.Name = "button1"; 65 | this.button1.Size = new System.Drawing.Size(95, 36); 66 | this.button1.TabIndex = 1; 67 | this.button1.Text = "设置路径"; 68 | this.button1.UseVisualStyleBackColor = true; 69 | this.button1.Click += new System.EventHandler(this.button1_Click); 70 | // 71 | // button2 72 | // 73 | this.button2.Location = new System.Drawing.Point(15, 55); 74 | this.button2.Margin = new System.Windows.Forms.Padding(2); 75 | this.button2.Name = "button2"; 76 | this.button2.Size = new System.Drawing.Size(95, 30); 77 | this.button2.TabIndex = 2; 78 | this.button2.Text = "提取文本x32"; 79 | this.button2.UseVisualStyleBackColor = true; 80 | this.button2.Click += new System.EventHandler(this.button2_Click); 81 | // 82 | // textBox1 83 | // 84 | this.textBox1.Location = new System.Drawing.Point(438, 18); 85 | this.textBox1.Margin = new System.Windows.Forms.Padding(2); 86 | this.textBox1.Name = "textBox1"; 87 | this.textBox1.Size = new System.Drawing.Size(68, 21); 88 | this.textBox1.TabIndex = 3; 89 | this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); 90 | // 91 | // label2 92 | // 93 | this.label2.AutoSize = true; 94 | this.label2.Location = new System.Drawing.Point(393, 20); 95 | this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); 96 | this.label2.Name = "label2"; 97 | this.label2.Size = new System.Drawing.Size(41, 12); 98 | this.label2.TabIndex = 0; 99 | this.label2.Text = "版本号"; 100 | this.label2.Click += new System.EventHandler(this.label1_Click); 101 | // 102 | // button3 103 | // 104 | this.button3.Location = new System.Drawing.Point(117, 55); 105 | this.button3.Margin = new System.Windows.Forms.Padding(2); 106 | this.button3.Name = "button3"; 107 | this.button3.Size = new System.Drawing.Size(95, 30); 108 | this.button3.TabIndex = 2; 109 | this.button3.Text = "导入文本"; 110 | this.button3.UseVisualStyleBackColor = true; 111 | this.button3.Click += new System.EventHandler(this.button3_Click); 112 | // 113 | // button4 114 | // 115 | this.button4.Location = new System.Drawing.Point(15, 240); 116 | this.button4.Margin = new System.Windows.Forms.Padding(2); 117 | this.button4.Name = "button4"; 118 | this.button4.Size = new System.Drawing.Size(118, 30); 119 | this.button4.TabIndex = 2; 120 | this.button4.Text = "汉化新版资源x32"; 121 | this.button4.UseVisualStyleBackColor = true; 122 | this.button4.Click += new System.EventHandler(this.button4_Click); 123 | // 124 | // oldvel 125 | // 126 | this.oldvel.Location = new System.Drawing.Point(89, 217); 127 | this.oldvel.Margin = new System.Windows.Forms.Padding(2); 128 | this.oldvel.Name = "oldvel"; 129 | this.oldvel.Size = new System.Drawing.Size(68, 21); 130 | this.oldvel.TabIndex = 5; 131 | // 132 | // label3 133 | // 134 | this.label3.AutoSize = true; 135 | this.label3.Location = new System.Drawing.Point(19, 219); 136 | this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); 137 | this.label3.Name = "label3"; 138 | this.label3.Size = new System.Drawing.Size(65, 12); 139 | this.label3.TabIndex = 4; 140 | this.label3.Text = "比对版本号"; 141 | // 142 | // label4 143 | // 144 | this.label4.AutoSize = true; 145 | this.label4.Location = new System.Drawing.Point(197, 249); 146 | this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); 147 | this.label4.Name = "label4"; 148 | this.label4.Size = new System.Drawing.Size(41, 12); 149 | this.label4.TabIndex = 6; 150 | this.label4.Text = "label4"; 151 | // 152 | // button5 153 | // 154 | this.button5.Location = new System.Drawing.Point(15, 129); 155 | this.button5.Margin = new System.Windows.Forms.Padding(2); 156 | this.button5.Name = "button5"; 157 | this.button5.Size = new System.Drawing.Size(95, 34); 158 | this.button5.TabIndex = 7; 159 | this.button5.Text = "xml=>txt"; 160 | this.button5.UseVisualStyleBackColor = true; 161 | this.button5.Click += new System.EventHandler(this.button5_Click); 162 | // 163 | // button6 164 | // 165 | this.button6.Location = new System.Drawing.Point(117, 129); 166 | this.button6.Margin = new System.Windows.Forms.Padding(2); 167 | this.button6.Name = "button6"; 168 | this.button6.Size = new System.Drawing.Size(95, 34); 169 | this.button6.TabIndex = 8; 170 | this.button6.Text = "txt=>xml"; 171 | this.button6.UseVisualStyleBackColor = true; 172 | this.button6.Click += new System.EventHandler(this.button6_Click); 173 | // 174 | // button7 175 | // 176 | this.button7.Location = new System.Drawing.Point(15, 89); 177 | this.button7.Margin = new System.Windows.Forms.Padding(2); 178 | this.button7.Name = "button7"; 179 | this.button7.Size = new System.Drawing.Size(95, 30); 180 | this.button7.TabIndex = 2; 181 | this.button7.Text = "提取文本x64"; 182 | this.button7.UseVisualStyleBackColor = true; 183 | this.button7.Click += new System.EventHandler(this.button7_Click); 184 | // 185 | // button8 186 | // 187 | this.button8.Location = new System.Drawing.Point(15, 275); 188 | this.button8.Margin = new System.Windows.Forms.Padding(2); 189 | this.button8.Name = "button8"; 190 | this.button8.Size = new System.Drawing.Size(118, 30); 191 | this.button8.TabIndex = 9; 192 | this.button8.Text = "汉化新版资源x64"; 193 | this.button8.UseVisualStyleBackColor = true; 194 | this.button8.Click += new System.EventHandler(this.button8_Click); 195 | // 196 | // button9 197 | // 198 | this.button9.Location = new System.Drawing.Point(308, 129); 199 | this.button9.Margin = new System.Windows.Forms.Padding(2); 200 | this.button9.Name = "button9"; 201 | this.button9.Size = new System.Drawing.Size(139, 30); 202 | this.button9.TabIndex = 10; 203 | this.button9.Text = "汉化资源x32->x64"; 204 | this.button9.UseVisualStyleBackColor = true; 205 | this.button9.Click += new System.EventHandler(this.button9_Click); 206 | // 207 | // button10 208 | // 209 | this.button10.Location = new System.Drawing.Point(308, 238); 210 | this.button10.Name = "button10"; 211 | this.button10.Size = new System.Drawing.Size(184, 23); 212 | this.button10.TabIndex = 11; 213 | this.button10.Text = "提出英文条目(用于找BUG)"; 214 | this.button10.UseVisualStyleBackColor = true; 215 | this.button10.Click += new System.EventHandler(this.button10_Click); 216 | // 217 | // Form1 218 | // 219 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 220 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 221 | this.ClientSize = new System.Drawing.Size(521, 322); 222 | this.Controls.Add(this.button7); 223 | this.Controls.Add(this.button10); 224 | this.Controls.Add(this.button9); 225 | this.Controls.Add(this.button8); 226 | this.Controls.Add(this.button6); 227 | this.Controls.Add(this.button5); 228 | this.Controls.Add(this.label4); 229 | this.Controls.Add(this.oldvel); 230 | this.Controls.Add(this.label3); 231 | this.Controls.Add(this.textBox1); 232 | this.Controls.Add(this.button4); 233 | this.Controls.Add(this.button3); 234 | this.Controls.Add(this.button2); 235 | this.Controls.Add(this.button1); 236 | this.Controls.Add(this.label2); 237 | this.Controls.Add(this.label1); 238 | this.Margin = new System.Windows.Forms.Padding(2); 239 | this.Name = "Form1"; 240 | this.Text = "Form1"; 241 | this.ResumeLayout(false); 242 | this.PerformLayout(); 243 | 244 | } 245 | 246 | #endregion 247 | 248 | private System.Windows.Forms.Label label1; 249 | private System.Windows.Forms.Button button1; 250 | private System.Windows.Forms.Button button2; 251 | private System.Windows.Forms.TextBox textBox1; 252 | private System.Windows.Forms.Label label2; 253 | private System.Windows.Forms.Button button3; 254 | private System.Windows.Forms.Button button4; 255 | private System.Windows.Forms.TextBox oldvel; 256 | private System.Windows.Forms.Label label3; 257 | private System.Windows.Forms.Label label4; 258 | private System.Windows.Forms.Button button5; 259 | private System.Windows.Forms.Button button6; 260 | private System.Windows.Forms.Button button7; 261 | private System.Windows.Forms.Button button8; 262 | private System.Windows.Forms.Button button9; 263 | private System.Windows.Forms.Button button10; 264 | } 265 | } 266 | 267 | -------------------------------------------------------------------------------- /src/KSP_zh/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | 9 | using System.Windows.Forms; 10 | 11 | namespace KSP_zh 12 | { 13 | public partial class Form1 : Form 14 | { 15 | static string KSPPath = @"E:\SteamLibrary\SteamApps\common\Kerbal Space Program"; 16 | static string vel = "0.0"; 17 | 18 | public Form1() 19 | { 20 | InitializeComponent(); 21 | } 22 | 23 | private void label1_Click(object sender, EventArgs e) 24 | { 25 | 26 | } 27 | 28 | private void button1_Click(object sender, EventArgs e) 29 | { 30 | if (textBox1.Text == "") 31 | { 32 | MessageBox.Show("版本不能为空"); 33 | return; 34 | } 35 | OpenFileDialog kspOpen = new OpenFileDialog(); 36 | kspOpen.FileName = "KSP.exe"; 37 | if (kspOpen.ShowDialog() == DialogResult.Cancel) return; 38 | 39 | vel = textBox1.Text; 40 | 41 | KSPPath = System.IO.Path.GetDirectoryName(kspOpen.FileName); 42 | label1.Text = System.IO.Path.GetDirectoryName(kspOpen.FileName); 43 | } 44 | 45 | private void button2_Click(object sender, EventArgs e) 46 | { 47 | ExtractText.GetText(KSPPath, vel); 48 | // ExtractCfg.Extract(KSPPath, vel); 49 | MessageBox.Show("OK"); 50 | } 51 | 52 | private void button3_Click(object sender, EventArgs e) 53 | { 54 | OpenFileDialog cfgzhOpen = new OpenFileDialog(); 55 | if (cfgzhOpen.ShowDialog() == DialogResult.Cancel) return; 56 | ExtractCfg.Injection(KSPPath, cfgzhOpen.FileName); 57 | MessageBox.Show("OK"); 58 | } 59 | 60 | private void button4_Click(object sender, EventArgs e) 61 | { 62 | if (oldvel.Text == "") 63 | { 64 | MessageBox.Show("比对版本不能为空"); 65 | return; 66 | } 67 | UpXml.CreateXmlUP(KSPPath, vel, oldvel.Text,label4); 68 | 69 | //UpXml.CreateXmlLose(KSPPath, vel, oldvel.Text, label4); 70 | 71 | MessageBox.Show("OK"); 72 | } 73 | 74 | private void button5_Click(object sender, EventArgs e) 75 | { 76 | ConvertText.ConvertTxt(); 77 | MessageBox.Show("OK"); 78 | } 79 | 80 | private void button6_Click(object sender, EventArgs e) 81 | { 82 | ConvertText.ConvertXml(); 83 | MessageBox.Show("OK"); 84 | } 85 | 86 | private void button8_Click(object sender, EventArgs e) 87 | { 88 | //if (oldvel.Text == "") 89 | //{ 90 | // MessageBox.Show("比对版本不能为空"); 91 | // return; 92 | //} 93 | //UpXml.CreateXmlUP_x64(KSPPath, vel, oldvel.Text, label4); 94 | 95 | //UpXml.CreateXmlLose_x64(KSPPath, vel, oldvel.Text, label4); 96 | 97 | //MessageBox.Show("OK"); 98 | } 99 | 100 | private void button9_Click(object sender, EventArgs e) 101 | { 102 | if (oldvel.Text == "") 103 | { 104 | MessageBox.Show("比对版本不能为空"); 105 | return; 106 | } 107 | vel = textBox1.Text; 108 | UpXml.CreateXmlUP_x32to64(KSPPath, vel, label4); 109 | 110 | MessageBox.Show("OK"); 111 | } 112 | 113 | private void button7_Click(object sender, EventArgs e) 114 | { 115 | ExtractText.GetText64(KSPPath, vel); 116 | ExtractCfg.Extract(KSPPath, vel); 117 | MessageBox.Show("OK"); 118 | } 119 | 120 | private void button10_Click(object sender, EventArgs e) 121 | { 122 | UpXml.GetZH(); 123 | MessageBox.Show("OK"); 124 | } 125 | 126 | private void textBox1_TextChanged(object sender, EventArgs e) 127 | { 128 | 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/KSP_zh/Form1.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | 133 | True 134 | 135 | 136 | True 137 | 138 | 139 | True 140 | 141 | 142 | True 143 | 144 | 145 | True 146 | 147 | 148 | True 149 | 150 | 151 | True 152 | 153 | 154 | True 155 | 156 | 157 | True 158 | 159 | 160 | True 161 | 162 | 163 | True 164 | 165 | 166 | True 167 | 168 | 169 | True 170 | 171 | -------------------------------------------------------------------------------- /src/KSP_zh/KSP_zh.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {B9C139F7-399B-4148-9DC1-2B3A1518C826} 8 | WinExe 9 | Properties 10 | KSP_zh 11 | KSP_zh 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | true 36 | bin\x64\ 37 | DEBUG;TRACE 38 | full 39 | AnyCPU 40 | prompt 41 | MinimumRecommendedRules.ruleset 42 | true 43 | 44 | 45 | true 46 | bin\x32\ 47 | DEBUG;TRACE 48 | full 49 | AnyCPU 50 | prompt 51 | MinimumRecommendedRules.ruleset 52 | true 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Form 72 | 73 | 74 | Form1.cs 75 | 76 | 77 | 78 | 79 | 80 | 81 | Form1.cs 82 | 83 | 84 | ResXFileCodeGenerator 85 | Resources.Designer.cs 86 | Designer 87 | 88 | 89 | True 90 | Resources.resx 91 | 92 | 93 | SettingsSingleFileGenerator 94 | Settings.Designer.cs 95 | 96 | 97 | True 98 | Settings.settings 99 | True 100 | 101 | 102 | 103 | 104 | 105 | 106 | 113 | -------------------------------------------------------------------------------- /src/KSP_zh/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using System.Windows.Forms; 6 | 7 | namespace KSP_zh 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// 应用程序的主入口点。 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/KSP_zh/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("KSP_zh")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("KSP_zh")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("31c294e0-3857-46e4-bcf4-13d15998aaa7")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/KSP_zh/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.34003 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace KSP_zh.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的、缓存的 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KSP_zh.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 为所有资源查找重写当前线程的 CurrentUICulture 属性, 56 | /// 方法是使用此强类型资源类。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/KSP_zh/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /src/KSP_zh/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34003 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace KSP_zh.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/KSP_zh/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/KSP_zh/README.md: -------------------------------------------------------------------------------- 1 | #项目介绍 2 | 3 | 此项目用于从KSP程序中提取文本资源 4 | -------------------------------------------------------------------------------- /src/KSP_zh/ReferenceProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | internal class ReferenceProvider 5 | { 6 | internal static byte[] UncheckMemory(long childValues, Stream currentManager) 7 | { 8 | byte num8 = (byte)currentManager.ReadByte(); 9 | byte num = (byte)num8; 10 | num = (byte)~num; 11 | for (int i = 1; i < 3; i++) 12 | { 13 | currentManager.ReadByte(); 14 | } 15 | byte[] buffer = new byte[currentManager.Length - currentManager.Position]; 16 | currentManager.Read(buffer, 0, buffer.Length); 17 | if ((num & 0x20) != 0) 18 | { 19 | for (int j = 0; j < buffer.Length; j++) 20 | { 21 | buffer[j] = (byte)~buffer[j]; 22 | } 23 | } 24 | return buffer; 25 | } 26 | } 27 | --------------------------------------------------------------------------------