Compare commits

..

No commits in common. "master" and "V1.01" have entirely different histories.

11 changed files with 4 additions and 225 deletions

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="H5MotaUpdate.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<H5MotaUpdate.Properties.Settings1>
<setting name="LastSourceFolderPath" serializeAs="String">
<value />
</setting>
<setting name="LastDestFolderPath" serializeAs="String">
<value />
</setting>
</H5MotaUpdate.Properties.Settings1>
</userSettings>
</configuration>

View File

@ -13,19 +13,4 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
</Project>

View File

@ -1,50 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace H5MotaUpdate.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.11.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string LastSourceFolderPath {
get {
return ((string)(this["LastSourceFolderPath"]));
}
set {
this["LastSourceFolderPath"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string LastDestFolderPath {
get {
return ((string)(this["LastDestFolderPath"]));
}
set {
this["LastDestFolderPath"] = value;
}
}
}
}

View File

@ -1,12 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="H5MotaUpdate.Properties" GeneratedClassName="Settings1">
<Profiles />
<Settings>
<Setting Name="LastSourceFolderPath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="LastDestFolderPath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View File

@ -91,17 +91,10 @@ namespace H5MotaUpdate.ViewModels
{
using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
{
// 设置初始路径为上一次选择的路径
folderBrowserDialog.SelectedPath = Properties.Settings.Default.LastSourceFolderPath;
if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
SourceRootDirectory = folderBrowserDialog.SelectedPath;
// 保存本次选择的路径
Properties.Settings.Default.LastSourceFolderPath = SourceRootDirectory;
Properties.Settings.Default.Save();
}
VersionString = VersionUtils.GetVersion(SourceRootDirectory);
}
}
@ -113,15 +106,9 @@ namespace H5MotaUpdate.ViewModels
{
using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
{
// 设置初始路径为上一次选择的路径
folderBrowserDialog.SelectedPath = Properties.Settings.Default.LastDestFolderPath;
if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
DestRootDirectory = folderBrowserDialog.SelectedPath;
// 保存本次选择的路径
Properties.Settings.Default.LastDestFolderPath = DestRootDirectory;
Properties.Settings.Default.Save();
}
}
}

View File

@ -192,9 +192,7 @@ namespace H5MotaUpdate.ViewModels
shopId = shop["id"].ToString(),
flagName_Time = "flag:" + shopId + "_times"; // 新设的购买次数变量flag:xxx
string priceStr = shopNeed.Replace("times", flagName_Time); //商店价格字符串用新变量名取代times
shop["text"] = StringUtils.ReplaceInBetweenCurlyBraces(shopText, "times", flagName_Time);
shop["text"] = StringUtils.ReplaceInBetweenCurlyBraces(shopText, "need", priceStr);
shop["disablePreview"] = false;
if (use == "experience")

View File

@ -120,14 +120,6 @@ namespace H5MotaUpdate.ViewModels
enemy["breakArmor"] = enemy["defValue"];
enemy.Remove("defValue");
break;
case 9: //净化
enemy["purify"] = enemy["n"];
enemy.Remove("purify");
break;
case 11://吸血
enemy["vampire"] = enemy["value"];
enemy.Remove("value");
break;
case 15://领域
enemy["zone"] = enemy["value"];
enemy.Remove("value");
@ -144,9 +136,6 @@ namespace H5MotaUpdate.ViewModels
enemy["haloRange"] = enemy["range"];
enemy["haloSquare"] = enemy["zoneSquare"];
enemy["haloAdd"] = enemy["add"];
enemy["hpBuff"] = enemy["value"];
enemy["atkBuff"] = enemy["atkValue"];
enemy["defBuff"] = enemy["defValue"];
enemy.Remove("range");
enemy.Remove("zoneSquare");
enemy.Remove("add");
@ -181,16 +170,6 @@ namespace H5MotaUpdate.ViewModels
enemy["breakArmor"] = enemy["defValue"];
if (!foundSpecialValues.Contains(21)) enemy.Remove("defValue");
}
if (foundSpecialValues.Contains(9))
{
enemy["purify"] = enemy["n"];
if (!foundSpecialValues.Contains(6)) enemy.Remove("purify");
}
if (foundSpecialValues.Contains(11))
{
enemy["vampire"] = enemy["value"];
if (!foundSpecialValues.Contains(21)) enemy.Remove("value");
}
if (foundSpecialValues.Contains(15))
{
enemy["zone"] = enemy["value"];
@ -211,9 +190,6 @@ namespace H5MotaUpdate.ViewModels
enemy["haloRange"] = enemy["range"];
enemy["haloSquare"] = enemy["zoneSquare"];
enemy["haloAdd"] = enemy["add"];
enemy["hpBuff"] = enemy["value"];
enemy["atkBuff"] = enemy["atkValue"];
enemy["defBuff"] = enemy["defValue"];
if (!foundSpecialValues.Contains(11)) enemy.Remove("add");
if (!foundSpecialValues.Contains(15))
{

View File

@ -1,5 +1,4 @@
using H5MotaUpdate.ViewModels.Utils;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Linq;
using System.IO;
using System.Text;
@ -93,12 +92,6 @@ namespace H5MotaUpdate.ViewModels
// 设置每张地图的尺寸。如果自己有就用自己的,否则设为默认长宽。
foreach (JProperty posEvent in jsonObject["events"])
{
JToken posEventValue = posEvent.Value;
MotaEventParser.parseMotaEvent(posEventValue);
}
int width, height;
if (jsonObject["width"] != null && jsonObject["width"].Type == JTokenType.Integer)
@ -152,7 +145,7 @@ namespace H5MotaUpdate.ViewModels
jsonObject["images"] = new JArray(newImages);
#endregion
#region
#region
JArray mapMatrix = (JArray)jsonObject["map"];
JArray zeroBgMatrix = StringUtils.CreateMatrix(width, height);
for (int i = 0; i < mapMatrix.Count; i++)

View File

@ -89,41 +89,11 @@ namespace H5MotaUpdate.ViewModels
{
string key = prop.Name;
JObject perData = (JObject)prop.Value;
if (perData["cls"]?.ToString() == "keys")
if (perData["cls"].ToString() == "keys")
{
perData["cls"] = "tools";
perData["hideInToolbox"] = true;
}
if (perData["cls"]?.ToString() == "equips")
{
JObject equipValue = (JObject)perData["equip"];
if (equipValue != null)
{
JObject valueObj = new JObject();
// 装备属性的名字
string[] keysToMove = { "atk", "def", "mdef", "hp" };
foreach (string keyToMove in keysToMove)
{
if (equipValue.ContainsKey(keyToMove))
{
JToken val = equipValue[keyToMove];
valueObj[keyToMove] = val;
equipValue.Remove(keyToMove);
}
}
if (equipValue.ContainsKey("percentage") && equipValue["percentage"].Type == JTokenType.Boolean && (bool)equipValue["percentage"])
{
equipValue["percentage"] = valueObj;
}
else equipValue["value"] = valueObj;
perData["equip"] = equipValue;
}
}
}
if (newItemDatas.ContainsKey("snow"))
{

View File

@ -1,50 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace H5MotaUpdate.ViewModels.Utils
{
internal static class MotaEventParser
{
public static void parseOneMotaEvent(JObject motaEvent)
{
// 如果type为openShop添加一个open:true的键
if (motaEvent["type"] is JValue typeValue && typeValue.Value is string typeString && typeString == "openShop")
{
motaEvent["open"] = true;
}
}
static void parseMotaEventArr(JArray motaEventArr)
{
foreach (JToken motaEventToken in motaEventArr)
{
// 只处理对象事件 字符串不计
if (motaEventToken.Type == JTokenType.Object)
{
JObject motaEvent = (JObject)motaEventToken;
parseOneMotaEvent(motaEvent);
}
}
}
public static void parseMotaEvent(JToken motaEvent)
{
if (motaEvent is JArray motaEventArr)
{
parseMotaEventArr(motaEventArr);
}
else if (motaEvent is JObject motaEventObj)
{ // 说明有覆盖触发器等data中才是真正的事件
if (motaEvent["data"] is JArray dataArr)
{
parseMotaEventArr(dataArr);
}
}
}
}
}

View File

@ -50,7 +50,7 @@ namespace H5MotaUpdate.ViewModels
// 获取匹配的内容,去掉 ${ 和 }
string content = match.Groups[1].Value;
// 在匹配的内容中替换 oldWord 为 newWord
string modifiedContent = "(" + content.Replace(oldWord, newWord) + ")";
string modifiedContent = content.Replace(oldWord, newWord);
// 返回替换后的完整匹配字符串,包含 ${ 和 }
return "${" + modifiedContent + "}";
});