mirror of
https://github.com/kwsch/NHSE.git
synced 2026-08-05 17:28:45 -05:00
Remap villager name to internal name if no match
Based on the editor's current language. I put "raymond" (noquotes) in my clipboard, and click the button. It'll import raymond's data easily. Play sound on replacement finish
This commit is contained in:
parent
1a4dfcb611
commit
838073576d
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using NHSE.Core;
|
||||
using NHSE.Sprites;
|
||||
|
|
@ -289,8 +290,12 @@ private void B_ReplaceVillager_Click(object sender, EventArgs e)
|
|||
var internalName = Clipboard.GetText();
|
||||
if (!VillagerResources.IsVillagerDataKnown(internalName))
|
||||
{
|
||||
WinFormsUtil.Error(string.Format(MessageStrings.MsgVillagerReplaceUnknownName, internalName));
|
||||
return;
|
||||
internalName = GameInfo.Strings.VillagerMap.First(z => string.Equals(z.Value, internalName, StringComparison.InvariantCultureIgnoreCase)).Key;
|
||||
if (string.IsNullOrWhiteSpace(internalName))
|
||||
{
|
||||
WinFormsUtil.Error(string.Format(MessageStrings.MsgVillagerReplaceUnknownName, internalName));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var index = VillagerIndex;
|
||||
|
|
@ -310,6 +315,7 @@ private void B_ReplaceVillager_Click(object sender, EventArgs e)
|
|||
SAV.SetVillagerHouse(nh, houseIndex);
|
||||
var nv = new Villager2(replace.Villager);
|
||||
LoadVillager(Villagers[index] = nv);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user