简化和优化代码,添加新 JSON 文件

此次提交主要对代码进行了简化和优化,具体更改如下:

1. 在 `App.xaml` 中,将 `ConCernItem` 的 `DataTemplate` 从 `StackPanel` 改为 `Grid`,并添加了 `Grid.ColumnDefinitions` 和 `Grid.RowDefinitions`。
2. 在 `App.xaml.cs` 中,删除了创建和解压缩 `RustCode` 目录的代码,改为直接从 `Assets` 目录获取 `DataBaseManifest` 文件,并更新了异常处理逻辑。
3. 在 `RustTools.csproj` 中,添加了新的 `PackageReference`,更新了 `RestSharp` 的版本,并注释掉了 `squirrel.windows` 的引用。
4. 在 `PostRwmod.xaml.cs` 中,删除了 `SharpCompress.Common` 和 `TinyPinyin` 的引用。
5. 在 `CodeDataPage.xaml.cs` 中,更新了 `filePath` 的路径,从 `ApplicationData.Current.LocalFolder.Path` 改为 `AppContext.BaseDirectory`。
6. 在 `ConcernPage.xaml` 中,调整了 `StackPanelA` 的 `MinWidth` 属性,并删除了 `StackPanel` 的 `Background` 属性。
7. 在 `ConcernPage.xaml.cs` 中,更新了 `Getlist` 方法的逻辑,增加了对 `response` 的空值和错误码检查。
8. 在 `ModulePage.xaml.cs` 中,删除了 `SharpCompress.Common` 和 `WinRT.Interop` 的引用。
9. 在 `SettingsPage.xaml` 中,更新了 `PersonPicture` 的 `ToolTipService.ToolTip` 属性。
10. 在 `IniHelper.cs` 中,更新了 `Load` 方法的 `filePath` 路径,并添加了目录不存在时创建目录的逻辑。
11. 在 `wj.cs` 中,更新了 `CD` 的路径为 `AppContext.BaseDirectory`,并注释掉了废弃的路径。
12. 在 `config.ini` 中,添加了 `[Settings]` 节点和 `SystemBackdrop=Mica` 设置。

此外,添加了以下新 JSON 文件:
1. `DataBaseManifest.json`:包含数据集的基本信息和数据表的映射。
2. `game_version.json`:包含游戏版本数据。
3. `section.json`:包含铁锈助手节名数据。
4. `value_type.json`:定义了一个名为 "值类型表" 的数据结构,包含多个值类型及其详细信息。
This commit is contained in:
muqing 2025-01-20 22:43:40 +08:00
parent 9c6b6f24ed
commit 7735738c3d
17 changed files with 11138 additions and 81 deletions

View File

@ -17,11 +17,20 @@
<!-- 用于动态界面的关注用户视图 -->
<DataTemplate x:Key="ConCernItem">
<StackPanel Padding="5" Orientation="Horizontal">
<Border Margin="0,0,0,0" CornerRadius="9">
<Grid Padding="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
Grid.Column="0"
Padding="0,0,0,0"
CornerRadius="9">
<Image
Width="56"
Height="56"
@ -30,11 +39,13 @@
Stretch="UniformToFill" />
</Border>
<TextBlock
Margin="3,0,0,0"
Grid.Column="1"
Margin="9,0,0,0"
VerticalAlignment="Center"
MaxLines="1"
Style="{ThemeResource SubtitleTextBlockStyle}"
Text="{Binding UserName}" />
</StackPanel>
</Grid>
</DataTemplate>
<!-- 模组列表的视图 -->

View File

@ -108,55 +108,20 @@ public partial class App : Microsoft.UI.Xaml.Application
UnhandledException += App_UnhandledException;
var path = ApplicationData.Current.LocalFolder.Path;
var v = Path.Combine(path, "CodeTable");
gj.sc(path);
if (Directory.Exists(v) == false)
{
Directory.CreateDirectory(v);
}
var RustCode = Path.Combine(v, "RustCode");
if (Directory.Exists(RustCode) == false)
{
new Thread(() =>
{
var zipFilePath = Path.Combine(AppContext.BaseDirectory, "Assets\\RustCode.zip");
gj.sc(zipFilePath);
try
{
ZipFile.ExtractToDirectory(zipFilePath, RustCode);
var iniHelper = new IniHelper(IniHelper.FILE.Config);
iniHelper.SetValue("CodeTable", "Dir", RustCode);
iniHelper.Save();
var vr = Path.Combine(RustCode, "DataBaseManifest.json");
if (File.Exists(vr))
{
var json = JsonConvert.DeserializeObject<DataBaseManifest>(File.ReadAllText(vr));
json.Dir = RustCode;
CodeDataPage.codetable = json;
}
Debug.WriteLine("ZIP文件已成功解压缩并复制到目标目录。");
}
catch (FileNotFoundException)
{
Debug.WriteLine("源文件未找到。");
}
catch (IOException ex)
{
Debug.WriteLine("发生IO异常: " + ex.Message);
}
catch (Exception ex)
{
//获取当前路径
Debug.WriteLine("发生未知错误: " + ex.Message);
}
}).Start();
}
else
//Debug.WriteLine();
try
{
var DataBaseManifest = Path.Combine(AppContext.BaseDirectory, "Assets\\CodeTable\\RustCode");
var iniHelper = new IniHelper(IniHelper.FILE.Config);
var v1 = iniHelper.GetValue("CodeTable", "Dir");
if (string.IsNullOrEmpty(v1)) { v1 = RustCode; }
if (string.IsNullOrEmpty(v1)||!wj.cz(Path.Combine(v1," DataBaseManifest.json")))
{
v1 = DataBaseManifest;
iniHelper.SetValue("CodeTable", "Dir", v1);
iniHelper.Save();
}
var vr = Path.Combine(v1, "DataBaseManifest.json");
if (File.Exists(vr))
{
@ -164,6 +129,11 @@ public partial class App : Microsoft.UI.Xaml.Application
json.Dir = v1;
CodeDataPage.codetable = json;
}
}
catch (Exception e)
{
Debug.WriteLine(e);
}
}

View File

@ -0,0 +1,17 @@
{
"id": "muqing",
"name": "用户自定义数据集",
"author": "RustTools",
"describe": "铁锈助手PC版本数据集经过助手导入并编译为数据库后即可使用。",
"versionName": "2.2.0",
"updateLog": [
"2024-8-19 铁锈助手PC版本首次编译"
],
"tables": {
"code": "code.json",
"chain_inspection": "chain_inspection.json",
"section": "section.json",
"value_type": "value_type.json",
"game_version": "game_version.json"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,41 @@
{
"name":"游戏版本数据",
"data": [
{
"versionName": "1.12",
"versionNumber": 1
},
{
"versionName": "1.13",
"versionNumber": 2
},
{
"versionName": "1.14",
"versionNumber": 3
},
{
"versionName": "1.15",
"versionNumber": 4
},
{
"versionName": "1.15-p6",
"versionNumber": 5
},
{
"versionName": "1.15-p7",
"versionNumber": 6
},
{
"versionName": "1.15-p8",
"versionNumber": 7
},
{
"versionName": "1.15-p9",
"versionNumber": 8
},
{
"versionName": "1.15-p10",
"versionNumber": 9
}
]
}

View File

@ -0,0 +1,171 @@
{
"name": "铁锈助手节名数据",
"data": [
{
"code": "core",
"translate": "核心",
"needName": false
},
{
"code": "graphics",
"translate": "图像",
"needName": false
},
{
"code": "attack",
"translate": "攻击",
"needName": false
},
{
"code": "turret",
"translate": "炮塔",
"needName": true
},
{
"code": "projectile",
"translate": "抛射体",
"needName": true
},
{
"code": "movement",
"translate": "运动",
"needName": false
},
{
"code": "ai",
"translate": "人机",
"needName": false
},
{
"code": "leg",
"translate": "腿",
"needName": true
},
{
"code": "arm",
"translate": "脚",
"needName": true
},
{
"code": "effect",
"translate": "效果",
"needName": true
},
{
"code": "animation",
"translate": "动画",
"needName": true
},
{
"code": "action",
"translate": "行动",
"needName": true
},
{
"code": "canBuild",
"translate": "可建造",
"needName": true
},
{
"code": "attachment",
"translate": "附属",
"needName": true
},
{
"code": "hiddenAction",
"translate": "隐藏行动",
"needName": true
},
{
"code": "global_resource",
"translate": "全局资源",
"needName": true,
"isVisible": "true"
},
{
"code": "template",
"translate": "模板",
"needName": true
},
{
"code": "resource",
"translate": "资源",
"needName": true,
"isVisible": true
},
{
"code": "placementRule",
"translate": "放置规则",
"needName": true,
"isVisible": true
},
{
"code": "vanillaUnit",
"translate": "原版单位对照表",
"needName": true,
"isVisible": true
},
{
"code": "vanillaDexUnit",
"translate": "特殊单位对照表",
"needName": true,
"isVisible": true
},
{
"code": "logicBoolean",
"translate": "逻辑值",
"needName": false,
"isAvailable": false,
"isVisible":true
},
{
"code": "comment",
"translate": "注解",
"needName": false,
"isAvailable": false,
"isVisible":false
},
{
"code": "boolean",
"translate": "布尔值",
"needName": false,
"isAvailable": false
},
{
"code": "Specific",
"translate": "特定值",
"needName": false,
"isAvailable": false
},
{
"code":"array",
"translate":"数组",
"needName": true,
"isVisible": true
},
{
"code":"memory",
"translate":"内存",
"needName": true,
"isVisible": true
},
{
"code":"reloadArmy",
"translate":"刷兵",
"needName": true,
"isVisible": false
},
{
"code":"decal",
"translate":"贴花",
"needName": true,
"isVisible": true
},
{
"code":"misc",
"translate":"杂项",
"needName": true,
"isVisible": false
}
]
}

View File

@ -0,0 +1,665 @@
{
"name": "值类型表",
"data": [
{
"name": "键",
"type": "key",
"rule": "^[^#:]+:",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "节",
"type": "section",
"rule": "^\\[.+\\]",
"external": "",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "整数",
"type": "int",
"rule": "^\\$\\{[^.]+\\.?[^.]+\\}|^-?\\d+",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": "不包含小数点的数,可以为负。"
},
{
"name": "布尔值",
"type": "boolean",
"rule": "true|false",
"external": ":",
"offset": "",
"list": "true,false",
"tag": "",
"describe": "布尔值又叫逻辑值,只能设置为“真”或“假”。"
},
{
"name": "路径",
"type": "path",
"rule": "\\S+\\.\\S+|ROOT:\\S+\\.\\S+",
"external": ":",
"offset": "",
"list": "@file(ini)",
"tag": "@file",
"describe": "文件名或者以ROOT开头的文件路径。"
},
{
"name": "代码",
"type": "code",
"rule": "[^:]+:.+",
"external": "",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "注释",
"type": "notes",
"rule": "^#.*",
"external": "",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "字符串",
"type": "string",
"rule": ".+",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "常量",
"type": "constant",
"rule": ".+",
"external": "",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "资源",
"type": "resource",
"rule": ".+=-?\\d+|-?\\d+",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": "以“资源名=整数”的形式引用自定义资源,整数引用原版资金。"
},
{
"name": "浮点值",
"type": "float",
"rule": "^\\$\\{[^.]+\\.?[^.]+\\}|^-?\\d+\\.?\\d*",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": "带有小数点的数,可以理解为小数。"
},
{
"name": "颜色",
"type": "color",
"rule": "#[\\dA-Fa-f]{8}|#[\\dA-Fa-f]{6}",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": "以#号开头的颜色代码。"
},
{
"name": "共享",
"type": "share",
"rule": ".+\\.png",
"external": ":",
"offset": "",
"list": "@apk(/assets/units/shared/)",
"tag": "",
"describe": "@search(code)"
},
{
"name": "标签",
"type": "tags",
"rule": ".+",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "队伍",
"type": "teams",
"rule": ".+",
"external": ":",
"offset": "",
"list": "own,neutral,allyNotOwn,ally,enemy,any",
"tag": "@lineRule",
"describe": ""
},
{
"name": "贴花图层",
"type": "decallayer",
"rule": ".+",
"external": ":",
"offset": "",
"list": "shadow,beforeBody,afterBody,onTop,beforeUI",
"tag": "@lineRule",
"describe": ""
},
{
"name": "图像",
"type": "image",
"rule": "NONE|AUTO|.+\\.png",
"external": ":",
"offset": "",
"list": "NONE,AUTO,SHARED,ROOT:,CORE,@file(png),@file(jpg)",
"tag": "@file",
"describe": "使用文件名或者以ROOT开头的路径引用图像可设置为NONE或者AUTO自动。"
},
{
"name": "音频",
"type": "audio",
"rule": ".+",
"external": ":",
"offset": "",
"list": "@file(ogg)",
"tag": "@file(apk{res/raw/}type{ogg,wav})",
"describe": "使用文件名或者以ROOT开头的路径引用音频。"
},
{
"name": "枚举",
"type": "enum",
"rule": ".+",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "值",
"type": "value",
"rule": ":.+",
"external": "",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "逻辑条件",
"type": "logicBoolean",
"rule": "true|false|if.*",
"external": ":",
"offset": "",
"list": "true,false,if,@type(logicQuantityStatement),@type(logicTimeStatement),@type(simpleLogicalConditionStatement),@type(self.transportingCount),@type(self.isResourceLargerThan),@type(self.isOverPassableTile),@type(noParameterLogicStatement)",
"tag": "",
"describe": "以“真”或“假”,设置逻辑。也可以填写以“如果”开头的逻辑表达式。"
},
{
"name": "单位",
"type": "unit",
"rule": ".+",
"external": ":",
"offset": "",
"list": "@type(internalUnits),@customType(unitName)",
"tag": "",
"describe": "模组单位名或内置单位名。"
},
{
"name": "时间",
"type": "time",
"rule": "-?\\d+\\.?\\d*s?",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": "以“s”结尾的秒数."
},
{
"name": "范围",
"type": "range",
"rule": "-?\\d+,-?\\d+,-?\\d+,-?\\d+",
"external": ":0,0,0,0",
"offset": "",
"list": "",
"tag": "",
"describe": "规定范围,必须是四组数字,在不同方向上延伸。"
},
{
"name": "效果",
"type": "effect",
"rule": "[nN][oO][nN][eE]|[cC][uU][sS][tT][oO][mM]:.+",
"external": ":",
"offset": "",
"list": "@section(effect)",
"tag": "@section(effect)",
"describe": "引用效果可以是NONE(无)。"
},
{
"name": "炮塔",
"type": "turret",
"rule": ".+",
"external": ":",
"offset": "",
"list": "@section(turret)",
"tag": "@section(turret)",
"describe": "填炮塔节名。"
},
{
"name": "定义",
"type": "define",
"rule": "^@.+\\s[^:]+:.+",
"external": "",
"offset": "",
"list": "",
"tag": "@define",
"describe": ""
},
{
"name": "引用",
"type": "quote",
"rule": "^\\$\\{.+\\}",
"external": "",
"offset": "",
"list": "",
"tag": "@define",
"describe": "引用类型"
},
{
"name": "添加路径点动作类型",
"type": "addWaypoint_type",
"rule": "move|attackMove|guard|loadInto|loadUp|attack|reclaim|repair|touchTarget|build|follow",
"external": ":",
"offset": "",
"list": "move,attackMove,guard,loadInto,loadUp,attack,reclaim,repair,touchTarget,build,follow",
"tag": "",
"describe": "@search(code)"
},
{
"name": "移动类型",
"type": "movementType",
"rule": "NONE|LAND|BUILDING|AIR|WATER|HOVER|OVER_CLIFF|OVER_CLIFF_WATER",
"external": ":",
"offset": "",
"list": "NONE,LAND,BUILDING,AIR,WATER,HOVER,OVER_CLIFF,OVER_CLIFF_WATER",
"tag": "",
"describe": "@search(code)"
},
{
"name": "攻击移动类型",
"type": "attackMovement",
"rule": "normal|bomber",
"external": ":",
"offset": "",
"list": "normal,bomber",
"tag": "",
"describe": "@search(code)"
},
{
"name": "类",
"type": "class",
"rule": "CustomUnitMetadata",
"external": ":",
"offset": "",
"list": "CustomUnitMetadata",
"tag": "",
"describe": "@search(code)"
},
{
"name": "抛射体",
"type": "projectile",
"rule": ".+",
"external": ":",
"offset": "",
"list": "@section(projectile)",
"tag": "@section(projectile)",
"describe": ""
},
{
"name": "主体图像",
"type": "baseImage",
"rule": ".+\\.png|.+\\.jpg",
"external": ":",
"offset": "",
"list": "@file(png),@file(jpg)",
"tag": "@file",
"describe": "@search(code)"
},
{
"name": "前缀键",
"type": "prefixKey",
"rule": "^[^#:]+_",
"external": "_",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "坐标",
"type": "position",
"rule": "-?\\d+,-?\\d+",
"external": "x,y",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "如果",
"type": "if",
"rule": ".+",
"external": " ",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "未知",
"type": "unknown",
"rule": ".+",
"external": "",
"offset": "",
"list": "",
"tag": "",
"describe": "未知类型"
},
{
"name": "宏",
"type": "macro",
"rule": ".+",
"external": "",
"offset": "",
"list": "",
"tag": "",
"describe": "批处理类型,宏"
},
{
"name": "内存",
"type": "memory",
"rule": ".+",
"external": "",
"offset": "",
"list": "",
"tag": "",
"describe": "内存特定类型"
},
{
"name": "内置单位",
"type": "internalUnits",
"rule": ".+",
"external": "",
"offset": "",
"list": "",
"tag": "",
"describe": "通常来源数据集内可通过助手游戏同步功能扩充内置单位数据。此类型标识符不能更改永远为internalUnits。"
},
{
"name": "友伤",
"type": "friendlyFire",
"rule": "only-ignoreEnemy|false|true",
"external": ":",
"offset": "",
"list": "only-ignoreEnemy,false,true",
"tag": "",
"describe": "@search(code)"
},
{
"name": "地图位置产生指定单位",
"type": "onNewMapSpawn",
"rule": "emptyResourcePools_asNeutral|emptyOrOccupiedResourcePools_asNeutral|mapCenter_asNeutral|mapCenter_eachActiveTeam|spawnPoint_eachActiveTeam",
"external": ":",
"offset": "",
"list": "emptyResourcePools_asNeutral,emptyOrOccupiedResourcePools_asNeutral,mapCenter_asNeutral,mapCenter_eachActiveTeam,spawnPoint_eachActiveTeam",
"tag": "",
"describe": "@search(code)"
},
{
"name": "逻辑数量语句",
"type": "logicQuantityStatement",
"rule": ".+",
"external": "()",
"offset": "@length(-1)",
"list": "withTag,greaterThan,lessThan,withinRange,incompleteBuildings,factoryQueue",
"tag": "",
"describe": "以“单位数量”结尾的逻辑语句常规提示。"
},
{
"name": "逻辑时间语句",
"type": "logicTimeStatement",
"rule": ".+",
"external": "()",
"offset": "@length(-1)",
"list": "withinSeconds,laterThanSeconds",
"tag": "",
"describe": ""
},
{
"name": "简单逻辑条件语句",
"type": "simpleLogicalConditionStatement",
"rule": ".+",
"external": "()",
"offset": "@length(-1)",
"list": "greaterThan,lessThan,equalTo",
"tag": "",
"describe": ""
},
{
"name": "逻辑条件语句",
"type": "logicalConditionStatement",
"rule": ".+",
"external": "()",
"offset": "@length(-1)",
"list": "greaterThan,lessThan,equalTo,empty,full",
"tag": "",
"describe": ""
},
{
"name": "自身运输数量",
"type": "self.transportingCount",
"rule": ".+",
"external": "()",
"offset": "@length(-1)",
"list": "greaterThan,lessThan,equalTo,empty",
"tag": "",
"describe": ""
},
{
"name": "自身资源大于",
"type": "self.isResourceLargerThan",
"rule": ".+",
"external": "()",
"offset": "@length(-1)",
"list": "source,compareTarget,byMoreThan,multiplyTargetBy",
"tag": "",
"describe": ""
},
{
"name": "自身在地块类型上",
"type": "self.isOverPassableTile",
"rule": ".+",
"external": "()",
"offset": "@length(-1)",
"list": "NONE,LAND,BUILDING,AIR,WATER,HOVER,OVER_CLIFF,OVER_CLIFF_WATER",
"tag": "",
"describe": "@search(code)"
},
{
"name": "无参逻辑语句",
"type": "noParameterLogicStatement",
"rule": ".+",
"external": "()",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "逻辑常量",
"type": "logicConstants",
"rule": ".+",
"external": "=",
"offset": "",
"list": "true,false",
"tag": "",
"describe": ""
},
{
"name": "无提示逻辑常量",
"type": "noPromptLogicConstant",
"rule": ".+",
"external": "=",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "有标签",
"type": "withTag",
"rule": ".+",
"external": "=",
"offset": "",
"list": "@type(tags)",
"tag": "",
"describe": ""
},
{
"name": "距离",
"type": "distance",
"rule": "-?\\d+,-?\\d+,-?\\d+,-?\\d+",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": "距离,填写两个坐标(x1,y1,x2,y2)"
},
{
"name": "显示类型",
"type": "displayType",
"rule": "NONE|rally|upgrade|queueUnit|building|action|infoOnly|infoOnlyNoBox",
"external": ":",
"offset": "",
"list": "NONE,rally,upgrade,queueUnit,building,action,infoOnly,infoOnlyNoBox",
"tag": "",
"describe": "@search(code)"
},
{
"name": "语言",
"type": "language",
"rule": ".+",
"external": "_",
"offset": "",
"list": "@type(countryCode)",
"tag": "",
"describe": ""
},
{
"name": "国家代码",
"type": "countryCode",
"rule": ".+",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": ""
},
{
"name": "动画触发条件",
"type": "onActions",
"rule": "move|attack|idle|underConstruction|underConstructionWithLinkedBuiltTime|queuedUnits|Unknown",
"external": ":",
"offset": "",
"list": "move,attack,idle,underConstruction,underConstructionWithLinkedBuiltTime,queuedUnits,Unknown",
"tag": "",
"describe": "@search(code)"
},
{
"name": "提取资源队伍",
"type": "takeResources_includeUnitsWithinRange_team",
"rule": "own|neutral|ally|enemy|any|allyNotOwn",
"external": ":",
"offset": "",
"list": "own,neutral,ally,enemy,any,allyNotOwn",
"tag": "",
"describe": "@search(code)"
},
{
"name": "自动触发检查率",
"type": "autoTriggerCheckRate",
"rule": "everyFrame|every4Frames|every8Frames",
"external": ":",
"offset": "",
"list": "everyFrame,every4Frames,every8Frames",
"tag": "",
"describe": "@search(code)"
},
{
"name": "建造自语句",
"type": "buildFrom",
"rule": "#[\\dA-Fa-f]{8}|#[\\dA-Fa-f]{6}",
"external": "",
"offset": "",
"list": "",
"tag": "@lineRule",
"describe": "建造自代码格式提示"
},
{
"name": "覆盖单位",
"type": "copyDexunit",
"rule": ".+",
"external": ":",
"offset": "",
"list": "commandCenter,c_turret_t1,c_antiAirTurret,landFactory,seaFactory,airFactory,extractorT1,fabricatorT1,experimentalLandFactory,nukeLauncherC,antiNukeLauncherC,laboratory,outpostT1,laserDefence,repairbay,mechFactory,aaBeamGunship,amphibiousJet,bomber,c_interceptor,heavyInterceptor,c_helicopter,lightGunship,gunShip,dropship,missileAirship,fireBee,experimentalDropship,combatEngineer,c_laserTank,c_mammothTank,mechEngineer,missileTank,plasmaTank,scout,c_artillery,heavyArtillery,c_tank,builder,hoverTank,hovercraft,heavyTank,heavyHoverTank,mechGun,mechMissile,mechArtillery,mechBunker,mechFlame,mechHeavyMissile,mechLaser,mechLightning,mechMinigun,experimentalHoverTank,modularSpider,c_experimentalTank,experimentalSpider,experimentalGunship,creditsCrates,crystal_mid",
"tag": "@lineRule",
"describe": "覆盖单位补齐规则"
},
{
"name": "标记",
"type": "marker",
"rule": ".+",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": "临时标记。"
},
{
"name": "自身腿",
"type": "leg",
"rule": ".+",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": "检查自身的腿作为逻辑条件"
},
{
"name": "自身炮塔",
"type": "turret",
"rule": ".+",
"external": ":",
"offset": "",
"list": "",
"tag": "",
"describe": "检查自身的炮塔作为逻辑条件"
}
]
}

View File

@ -19,6 +19,7 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<DefaultLanguage>zh-cn</DefaultLanguage>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.0.240109" />
@ -26,15 +27,13 @@
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231008000" />
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageReference Include="RestClient" Version="3.1024.23771" />
<PackageReference Include="RestSharp" Version="111.4.0" />
<PackageReference Include="squirrel.windows" Version="2.0.1" />
<PackageReference Include="RestSharp" Version="112.1.0" />
<!--<PackageReference Include="squirrel.windows" Version="2.0.1" />-->
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="TinyPinyin" Version="1.1.0" />
<PackageReference Include="WinUIEx" Version="2.3.2" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.7" />
<!--<PackageReference
Include="Microsoft.WindowsAppSDK" Version="1.5.240227000" />-->
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" />
<Manifest Include="$(ApplicationManifest)" />
@ -48,8 +47,7 @@
</Content>
</ItemGroup>
<ItemGroup
Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<ProjectCapability Include="Msix" />
</ItemGroup>

View File

@ -1,8 +1,6 @@
using System.Globalization;
using Microsoft.UI.Xaml.Controls;
using RustTools.muqing;
using SharpCompress.Common;
using TinyPinyin;
using static IniHelper;

View File

@ -27,7 +27,7 @@ public sealed partial class CodeDataPage : Page
ViewModel = new CodeDataViewModel();
InitializeComponent();
var filePath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "CodeTable");
var filePath = Path.Combine(AppContext.BaseDirectory, "Assets\\CodeTable");
if (!Directory.Exists(filePath)) { return; }
var directoryInfo = new DirectoryInfo(filePath);
var directoryInfos = directoryInfo.GetDirectories();
@ -121,15 +121,15 @@ public sealed partial class CodeDataPage : Page
else if (v == "1")
{
//´ò¿ª
var v1 = Path.Combine(wj.LocalFolder, "CodeTable");
if (Directory.Exists(v1))
{
wj.OpenFileExplorer(v1);
}
else
{
await Dialog.DialogWarn("不存在文件夹", XamlRoot);
}
//var v1 = Path.Combine(wj.LocalFolder, "CodeTable");
//if (Directory.Exists(v1))
//{
// wj.OpenFileExplorer(v1);
//}
//else
//{
// await Dialog.DialogWarn("不存在文件夹", XamlRoot);
//}
}
else if (v == "2")
{

View File

@ -31,7 +31,8 @@
</Grid.ColumnDefinitions>
<StackPanel
Name="StackPanelA"
MinWidth="95"
Grid.Column="0"
MinWidth="100"
MaxWidth="300"
Margin="0,9,9,9"
Padding="9">
@ -51,7 +52,6 @@
Grid.Column="2"
Margin="9"
Padding="9"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="9">
<ListView
Name="ListViewB"

View File

@ -123,10 +123,13 @@ public sealed partial class ConcernPage : Page
var value = task.Result;
if (value == string.Empty) return;
var response = JsonConvert.DeserializeObject<MovingInfo>(value);
foreach (var item in response.Data)
if (response != null && response.Code == 0 && response.Data != null)
{
item.HeadIcon = item.HeadIcon.Replace("..", wl.api);
MovingInfoList.Add(item);
foreach (var item in response.Data)
{
item.HeadIcon = item.HeadIcon.Replace("..", wl.api);
MovingInfoList.Add(item);
}
}
},TaskScheduler.FromCurrentSynchronizationContext());

View File

@ -6,8 +6,6 @@ using Microsoft.VisualBasic.FileIO;
using RustTools.muqing;
using RustTools.Themes;
using RustTools.ViewModels;
using SharpCompress.Common;
using WinRT.Interop;
namespace RustTools.Views;
/// <summary>
/// 模组碎片

View File

@ -116,7 +116,7 @@
Height="56"
Margin="6"
ProfilePicture="http://q.qlogo.cn/headimg_dl?dst_uin=2923268971&amp;spec=640&amp;img_type=jpg"
ToolTipService.ToolTip="感谢薄荷对本软件后端的帮助,也希望薄荷能尽快出来官方的电脑版" />
ToolTipService.ToolTip="感谢薄荷对本软件后端的帮助" />
</StackPanel>
</StackPanel>
</Grid>

3
config.ini Normal file
View File

@ -0,0 +1,3 @@
[Settings]
SystemBackdrop=Mica

View File

@ -78,11 +78,15 @@ public class IniHelper
/// <exception cref="FileNotFoundException"></exception>
public void Load(string a)
{
filePath = Path.Combine(ApplicationData.Current.LocalFolder.Path, a);
//Debug.WriteLine($"加载配置文件: {filePath}");
filePath = Path.Combine(wj.CD, a);
Debug.WriteLine($"加载配置文件: {filePath}");
if (!Directory.Exists(wj.CD))
{
Directory.CreateDirectory(wj.CD);
}
if (!File.Exists(filePath))
{// 使用 File.Create 创建文件并立即关闭
using var fs = File.Create(filePath);
using (File.Create(filePath)) { }
// 文件创建成功,但在这里不做任何操作 文件已经关闭
return;
}

View File

@ -10,11 +10,14 @@ namespace RustTools.muqing;
public class wj
{
//存储主要文件的路径
public static string CD = "";
public static readonly string CD =
Path.Combine(AppContext.BaseDirectory, "RustTools");
//@"D:\RustTools\";
//缓存路径
public const string Cache = "";
public static string LocalFolder = ApplicationData.Current.LocalFolder.Path;
//废弃的路径
//public static string LocalFolder = ApplicationData.Current.LocalFolder.Path;
//ApplicationData.Current.LocalFolder.Path
//不知道为什么会保存到这里的路径 废弃了 找到了新的文件夹路径