Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ffa321a5fc | ||
![]() |
b9d2b0100a | ||
![]() |
76d441475c | ||
![]() |
98693412f1 |
18
App.config
Normal file
18
App.config
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?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>
|
@ -13,4 +13,19 @@
|
|||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
</ItemGroup>
|
</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>
|
</Project>
|
||||||
|
50
Properties/Settings.Designer.cs
generated
Normal file
50
Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Properties/Settings.settings
Normal file
12
Properties/Settings.settings
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?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>
|
@ -91,10 +91,17 @@ namespace H5MotaUpdate.ViewModels
|
|||||||
{
|
{
|
||||||
using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
|
using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
|
||||||
{
|
{
|
||||||
|
// 设置初始路径为上一次选择的路径
|
||||||
|
folderBrowserDialog.SelectedPath = Properties.Settings.Default.LastSourceFolderPath;
|
||||||
|
|
||||||
if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||||
{
|
{
|
||||||
SourceRootDirectory = folderBrowserDialog.SelectedPath;
|
SourceRootDirectory = folderBrowserDialog.SelectedPath;
|
||||||
|
// 保存本次选择的路径
|
||||||
|
Properties.Settings.Default.LastSourceFolderPath = SourceRootDirectory;
|
||||||
|
Properties.Settings.Default.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
VersionString = VersionUtils.GetVersion(SourceRootDirectory);
|
VersionString = VersionUtils.GetVersion(SourceRootDirectory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -106,9 +113,15 @@ namespace H5MotaUpdate.ViewModels
|
|||||||
{
|
{
|
||||||
using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
|
using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
|
||||||
{
|
{
|
||||||
|
// 设置初始路径为上一次选择的路径
|
||||||
|
folderBrowserDialog.SelectedPath = Properties.Settings.Default.LastDestFolderPath;
|
||||||
|
|
||||||
if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||||
{
|
{
|
||||||
DestRootDirectory = folderBrowserDialog.SelectedPath;
|
DestRootDirectory = folderBrowserDialog.SelectedPath;
|
||||||
|
// 保存本次选择的路径
|
||||||
|
Properties.Settings.Default.LastDestFolderPath = DestRootDirectory;
|
||||||
|
Properties.Settings.Default.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,9 @@ namespace H5MotaUpdate.ViewModels
|
|||||||
shopId = shop["id"].ToString(),
|
shopId = shop["id"].ToString(),
|
||||||
flagName_Time = "flag:" + shopId + "_times"; // 新设的购买次数变量flag:xxx
|
flagName_Time = "flag:" + shopId + "_times"; // 新设的购买次数变量flag:xxx
|
||||||
string priceStr = shopNeed.Replace("times", flagName_Time); //商店价格字符串,用新变量名取代times
|
string priceStr = shopNeed.Replace("times", flagName_Time); //商店价格字符串,用新变量名取代times
|
||||||
|
|
||||||
shop["text"] = StringUtils.ReplaceInBetweenCurlyBraces(shopText, "times", flagName_Time);
|
shop["text"] = StringUtils.ReplaceInBetweenCurlyBraces(shopText, "times", flagName_Time);
|
||||||
|
shop["text"] = StringUtils.ReplaceInBetweenCurlyBraces(shopText, "need", priceStr);
|
||||||
shop["disablePreview"] = false;
|
shop["disablePreview"] = false;
|
||||||
|
|
||||||
if (use == "experience")
|
if (use == "experience")
|
||||||
|
@ -120,6 +120,14 @@ namespace H5MotaUpdate.ViewModels
|
|||||||
enemy["breakArmor"] = enemy["defValue"];
|
enemy["breakArmor"] = enemy["defValue"];
|
||||||
enemy.Remove("defValue");
|
enemy.Remove("defValue");
|
||||||
break;
|
break;
|
||||||
|
case 9: //净化
|
||||||
|
enemy["purify"] = enemy["n"];
|
||||||
|
enemy.Remove("purify");
|
||||||
|
break;
|
||||||
|
case 11://吸血
|
||||||
|
enemy["vampire"] = enemy["value"];
|
||||||
|
enemy.Remove("value");
|
||||||
|
break;
|
||||||
case 15://领域
|
case 15://领域
|
||||||
enemy["zone"] = enemy["value"];
|
enemy["zone"] = enemy["value"];
|
||||||
enemy.Remove("value");
|
enemy.Remove("value");
|
||||||
@ -136,6 +144,9 @@ namespace H5MotaUpdate.ViewModels
|
|||||||
enemy["haloRange"] = enemy["range"];
|
enemy["haloRange"] = enemy["range"];
|
||||||
enemy["haloSquare"] = enemy["zoneSquare"];
|
enemy["haloSquare"] = enemy["zoneSquare"];
|
||||||
enemy["haloAdd"] = enemy["add"];
|
enemy["haloAdd"] = enemy["add"];
|
||||||
|
enemy["hpBuff"] = enemy["value"];
|
||||||
|
enemy["atkBuff"] = enemy["atkValue"];
|
||||||
|
enemy["defBuff"] = enemy["defValue"];
|
||||||
enemy.Remove("range");
|
enemy.Remove("range");
|
||||||
enemy.Remove("zoneSquare");
|
enemy.Remove("zoneSquare");
|
||||||
enemy.Remove("add");
|
enemy.Remove("add");
|
||||||
@ -170,6 +181,16 @@ namespace H5MotaUpdate.ViewModels
|
|||||||
enemy["breakArmor"] = enemy["defValue"];
|
enemy["breakArmor"] = enemy["defValue"];
|
||||||
if (!foundSpecialValues.Contains(21)) enemy.Remove("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))
|
if (foundSpecialValues.Contains(15))
|
||||||
{
|
{
|
||||||
enemy["zone"] = enemy["value"];
|
enemy["zone"] = enemy["value"];
|
||||||
@ -190,6 +211,9 @@ namespace H5MotaUpdate.ViewModels
|
|||||||
enemy["haloRange"] = enemy["range"];
|
enemy["haloRange"] = enemy["range"];
|
||||||
enemy["haloSquare"] = enemy["zoneSquare"];
|
enemy["haloSquare"] = enemy["zoneSquare"];
|
||||||
enemy["haloAdd"] = enemy["add"];
|
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(11)) enemy.Remove("add");
|
||||||
if (!foundSpecialValues.Contains(15))
|
if (!foundSpecialValues.Contains(15))
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using Newtonsoft.Json.Linq;
|
using H5MotaUpdate.ViewModels.Utils;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@ -92,6 +93,12 @@ namespace H5MotaUpdate.ViewModels
|
|||||||
|
|
||||||
// 设置每张地图的尺寸。如果自己有就用自己的,否则设为默认长宽。
|
// 设置每张地图的尺寸。如果自己有就用自己的,否则设为默认长宽。
|
||||||
|
|
||||||
|
foreach (JProperty posEvent in jsonObject["events"])
|
||||||
|
{
|
||||||
|
JToken posEventValue = posEvent.Value;
|
||||||
|
MotaEventParser.parseMotaEvent(posEventValue);
|
||||||
|
}
|
||||||
|
|
||||||
int width, height;
|
int width, height;
|
||||||
|
|
||||||
if (jsonObject["width"] != null && jsonObject["width"].Type == JTokenType.Integer)
|
if (jsonObject["width"] != null && jsonObject["width"].Type == JTokenType.Integer)
|
||||||
@ -145,7 +152,7 @@ namespace H5MotaUpdate.ViewModels
|
|||||||
jsonObject["images"] = new JArray(newImages);
|
jsonObject["images"] = new JArray(newImages);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region
|
#region 滑冰转移到背景层
|
||||||
JArray mapMatrix = (JArray)jsonObject["map"];
|
JArray mapMatrix = (JArray)jsonObject["map"];
|
||||||
JArray zeroBgMatrix = StringUtils.CreateMatrix(width, height);
|
JArray zeroBgMatrix = StringUtils.CreateMatrix(width, height);
|
||||||
for (int i = 0; i < mapMatrix.Count; i++)
|
for (int i = 0; i < mapMatrix.Count; i++)
|
||||||
|
@ -89,11 +89,41 @@ namespace H5MotaUpdate.ViewModels
|
|||||||
{
|
{
|
||||||
string key = prop.Name;
|
string key = prop.Name;
|
||||||
JObject perData = (JObject)prop.Value;
|
JObject perData = (JObject)prop.Value;
|
||||||
if (perData["cls"].ToString() == "keys")
|
|
||||||
|
if (perData["cls"]?.ToString() == "keys")
|
||||||
{
|
{
|
||||||
perData["cls"] = "tools";
|
perData["cls"] = "tools";
|
||||||
perData["hideInToolbox"] = true;
|
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"))
|
if (newItemDatas.ContainsKey("snow"))
|
||||||
{
|
{
|
||||||
|
50
ViewModels/Utils/MotaEventParser.cs
Normal file
50
ViewModels/Utils/MotaEventParser.cs
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -50,7 +50,7 @@ namespace H5MotaUpdate.ViewModels
|
|||||||
// 获取匹配的内容,去掉 ${ 和 }
|
// 获取匹配的内容,去掉 ${ 和 }
|
||||||
string content = match.Groups[1].Value;
|
string content = match.Groups[1].Value;
|
||||||
// 在匹配的内容中替换 oldWord 为 newWord
|
// 在匹配的内容中替换 oldWord 为 newWord
|
||||||
string modifiedContent = content.Replace(oldWord, newWord);
|
string modifiedContent = "(" + content.Replace(oldWord, newWord) + ")";
|
||||||
// 返回替换后的完整匹配字符串,包含 ${ 和 }
|
// 返回替换后的完整匹配字符串,包含 ${ 和 }
|
||||||
return "${" + modifiedContent + "}";
|
return "${" + modifiedContent + "}";
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user