Skip to content

Commit

Permalink
Update ko and zh-CN
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz committed Aug 10, 2023
1 parent 6ca5f48 commit 2dd0d9a
Show file tree
Hide file tree
Showing 10 changed files with 2,665 additions and 1,094 deletions.
2 changes: 1 addition & 1 deletion RemnantSaveGuardian/RemnantSaveGuardian.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<UseWindowsForms>true</UseWindowsForms>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>Assets\256.ico</ApplicationIcon>
<AssemblyVersion>1.0.1.10</AssemblyVersion>
<AssemblyVersion>1.0.1.11</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
33 changes: 17 additions & 16 deletions RemnantSaveGuardian/RemnantWorldEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public string RawType
return _type;
}
}
public string TileSet { get; set; }
public enum ProcessMode { Campaign, Adventure };

public RemnantWorldEvent(string key, string name, List<string> locations, string type)
Expand Down Expand Up @@ -150,6 +151,7 @@ public RemnantWorldEvent(string key, string name, List<string> locations, string
_locations.Clear();
_locations.Add("World_RootEarth");
}
TileSet = "";
}
public RemnantWorldEvent(string key, string world, string type) : this(key, key, null, type) {
_locations.Add(world);
Expand All @@ -160,26 +162,27 @@ public RemnantWorldEvent(string key, List<string> locations, string type) : this
public RemnantWorldEvent(Match match, string location) : this(match.Value, match.Groups["eventName"].Value, new() { match.Groups["world"].Value, location }, match.Groups["eventType"].Value) { }

public List<RemnantItem> getPossibleItems()
{;
{
if (GameInfo.EventItem.ContainsKey(this._name))
{
if (Properties.Settings.Default.ShowCoopItems)
var possibleItems = GameInfo.EventItem[_name];
if (!Properties.Settings.Default.ShowCoopItems)
{
possibleItems = possibleItems.FindAll(item => item.Coop == false);
}
if (TileSet != null && TileSet.Length > 0)
{
return GameInfo.EventItem[this._name];
possibleItems = possibleItems.FindAll(item => item.TileSet.Length == 0 || TileSet.Contains(item.TileSet));
}
return GameInfo.EventItem[_name].FindAll(item => item.Coop == false);
return possibleItems;
}
return new List<RemnantItem>();
}

public void setMissingItems(RemnantCharacter charData, string tileSet)
public void setMissingItems(RemnantCharacter charData)
{
mItems.Clear();
List<RemnantItem> possibleItems = this.getPossibleItems();
if (tileSet != null && tileSet != "")
{
possibleItems = possibleItems.FindAll(i => i.TileSet == "" || tileSet.Contains(i.TileSet));
}
foreach (RemnantItem item in possibleItems)
{
if (!charData.Inventory.Contains(item.Key.ToLower()))
Expand All @@ -194,10 +197,6 @@ public void setMissingItems(RemnantCharacter charData, string tileSet)
//mItems.Add(ri);
}
}
public void setMissingItems(RemnantCharacter charData)
{
setMissingItems(charData, "");
}

public override string ToString()
{
Expand Down Expand Up @@ -955,7 +954,7 @@ static public void ProcessEvents(RemnantCharacter character, MatchCollection are
{
spawnTable = spawnTableMatch.Groups["name"].Value;
}
var start = DateTime.Now.Ticks;
var tileSets = string.Join(" ", area.Groups["tileSet"].Captures.Select(c => c.Value));
MatchCollection eventMatches = Regex.Matches(area.Groups["events"].Value, @"/Game/(?<world>(?:World|Campaign)_\w+)/Quests/(?:Quest_)?(?<eventType>[a-zA-Z0-9]+)_(?<eventName>\w+)/(?<details>\w+)\.\w+");
foreach (Match eventMatch in eventMatches)
{
Expand Down Expand Up @@ -996,6 +995,7 @@ static public void ProcessEvents(RemnantCharacter character, MatchCollection are

//eventStrings.Add(eventMatch.Value);
var worldEvent = new RemnantWorldEvent(eventMatch);//, currentArea.Groups["location"].Value.Trim());
worldEvent.TileSet = tileSets;
if (areaEvents.FindIndex(e => e.RawName == worldEvent.RawName) != -1)
{
continue;
Expand All @@ -1014,7 +1014,7 @@ static public void ProcessEvents(RemnantCharacter character, MatchCollection are
worldEvent.Locations.Add(currentSublocation);
}

worldEvent.setMissingItems(character, area.Groups["tileSets"].Value);
worldEvent.setMissingItems(character);
areaEvents.Add(worldEvent);

// Add associated events
Expand Down Expand Up @@ -1479,7 +1479,8 @@ static public void ProcessEvents(RemnantCharacter character, string saveText)
for (var i = 0; i < eventStarts.Count; i++)
{
var eventText = saveText[eventStarts[i].Index..eventEnds[i].Index];
var matches = Regex.Matches(eventText, @"/Game/(?<world>[\w/]+)/SpawnTables/(?<spawnTable>[\w/]+)\.\w+(?<events>.+)MapGen[\w\W]+?/Script/Remnant\.ZoneActor.{10}(?<tileSets>(?:.\u0001....(?:/.+?))+).{9}ID");
//var matches = Regex.Matches(eventText, @"/Game/(?<world>[\w/]+)/SpawnTables/(?<spawnTable>[\w/]+)\.\w+(?<events>.+)MapGen[\w\W]+?/Script/Remnant\.ZoneActor.{10}(?<tileSets>(?:.\u0001....(?:/.+?))+).{9}ID");
var matches = Regex.Matches(eventText, @"/Game/(?<world>[\w/]+)/SpawnTables/(?<spawnTable>[\w/]+)\.\w+(?<events>.+)MapGen[\w\W]+?/Script/Remnant\.ZoneActor.{10}(?:.\u0001....(?<tileSet>/.+?))+.{9}ID");
eventGroupMatches.Add(matches);
}
var campaignIndex = 0;
Expand Down
2 changes: 1 addition & 1 deletion RemnantSaveGuardian/Views/Pages/BackupsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</Button>
</ToolBar>
</WrapPanel>
<DataGrid Grid.Row="1" Name="dataBackups" AutoGeneratingColumn="dataBackups_AutoGeneratingColumn" SelectionMode="Single" IsReadOnly="False" SelectionUnit="FullRow">
<DataGrid Grid.Row="1" Name="dataBackups" AutoGeneratingColumn="dataBackups_AutoGeneratingColumn" BeginningEdit="DataBackups_BeginningEdit" CellEditEnding="DataBackups_CellEditEnding" SelectionMode="Single" IsReadOnly="False" SelectionUnit="FullRow">
<DataGrid.ContextMenu>
<ContextMenu Name="contextBackups">
<ui:MenuItem Name="menuRestore" Header="{lex:Loc}">
Expand Down
19 changes: 10 additions & 9 deletions RemnantSaveGuardian/Views/Pages/BackupsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ public BackupsPage(ViewModels.BackupsViewModel viewModel)
{
dataBackups.CanUserDeleteRows = false;
dataBackups.CanUserAddRows = false;
dataBackups.BeginningEdit += DataBackups_BeginningEdit;
dataBackups.CellEditEnding += DataBackups_CellEditEnding;
dataBackups.AutoGeneratingColumn += DataBackups_AutoGeneratingColumn;
dataBackups.Items.SortDescriptions.Add(new SortDescription("SaveDate", ListSortDirection.Descending));

contextBackups.ContextMenuOpening += ContextBackups_ContextMenuOpening;
Expand Down Expand Up @@ -116,11 +113,6 @@ public BackupsPage(ViewModels.BackupsViewModel viewModel)

}

private void DataBackups_AutoGeneratingColumn(object? sender, DataGridAutoGeneratingColumnEventArgs e)
{
e.Column.Header = new LocalizedColumnHeader(e.Column.Header.ToString());
}

private void MenuAnalyze_Click(object sender, System.Windows.RoutedEventArgs e)
{
var backup = dataBackups.SelectedItem as SaveBackup;
Expand Down Expand Up @@ -588,10 +580,19 @@ private void updateSavedKeeps()

private void dataBackups_AutoGeneratingColumn(object sender, System.Windows.Controls.DataGridAutoGeneratingColumnEventArgs e)
{
if (e.Column.Header.Equals("Save"))
var allowColumns = new List<string>() {
"Name",
"SaveDate",
"Progression",
"Keep",
"Active"
};
if (!allowColumns.Contains(e.Column.Header.ToString()))
{
e.Cancel = true;
return;
}
e.Column.Header = new LocalizedColumnHeader(e.Column.Header.ToString());
}

private bool IsRemnantRunning()
Expand Down
19 changes: 8 additions & 11 deletions RemnantSaveGuardian/Views/Pages/WorldAnalyzerPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,14 @@ private void Default_PropertyChanged(object? sender, System.ComponentModel.Prope

private void Data_AutoGeneratingColumn(object? sender, DataGridAutoGeneratingColumnEventArgs e)
{
var cancelColumns = new List<string>() {
"RawName",
"RawLocation",
"RawWorld",
"RawType",
"Locations",
"World",
"MissingItems",
"PossibleItems"
var allowColumns = new List<string>() {
"Location",
"Type",
"Name",
"MissingItemsString",
"PossibleItemsString"
};
if (cancelColumns.Contains(e.Column.Header))
if (!allowColumns.Contains(e.Column.Header))
{
e.Cancel = true;
return;
Expand All @@ -200,7 +197,7 @@ private void Data_AutoGeneratingColumn(object? sender, DataGridAutoGeneratingCol

if (Properties.Settings.Default.MissingItemColor == "Highlight")
{
var highlight = System.Drawing.SystemColors.Highlight;
var highlight = System.Drawing.SystemColors.HotTrack;
cellStyle.Setters.Add(new Setter(ForegroundProperty, new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(highlight.R, highlight.G, highlight.B))));
}
}
Expand Down
5 changes: 1 addition & 4 deletions RemnantSaveGuardian/game.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 10,
"version": 11,
"mainLocations": [
"Quest_Global_TheHunterDream_Template01",
"Quest_Story_AllFather_DranCity1_Template",
Expand Down Expand Up @@ -743,9 +743,6 @@
"TheNest": [
{
"name": "/Items/Trinkets/Rings/StockpileDelayLoop/Ring_StockpileCharger"
},
{
"name": "/Items/Trinkets/Rings/PoisonStone/Ring_AcidStone"
}
],
"Ravenous": [
Expand Down
Loading

0 comments on commit 2dd0d9a

Please sign in to comment.