Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
amrshaheen61 committed May 13, 2022
1 parent 7e109a0 commit ff55d52
Show file tree
Hide file tree
Showing 12 changed files with 567 additions and 104 deletions.
161 changes: 128 additions & 33 deletions UE4localizationsTool/Core/StructProperty.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion UE4localizationsTool/Core/Uasset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public void UpdateExport()
UassetFile.Skip(4 * 6);
UassetFile.Skip(2 * 2);
UassetFile.SetIntValue(Exports_Directory[n].ExportData.Count);
Console.WriteLine(Exports_Directory[n].ExportData.Count);
// Console.WriteLine(Exports_Directory[n].ExportData.Count);
int NullIntsize = 0;
if (UassetFile.GetIntValue(false) == 0)
{
Expand Down
22 changes: 10 additions & 12 deletions UE4localizationsTool/Core/Uexp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,11 @@ namespace AssetParser
{
public class Uexp
{
public struct TextBlock
{
public int TextBlockName { get; set; }
public int TextOffset { get; set; }
public int TextBlockSize { get; set; }
//TextLenght + String Value
public List<byte> TextBlockData { get; set; }
}


public Uasset UassetData;
public List<List<string>> Strings; //[Text id,Text Value,...]
private int _CurrentIndex;

public bool IsGood = true;
public int CurrentIndex
{
get
Expand Down Expand Up @@ -49,18 +40,23 @@ private void ReadOrEdit(bool Modify = false)

for (int n = 0; n < UassetData.Exports_Directory.Count; n++)
{


// Console.Clear();
// Console.ReadLine();

using (MemoryList memoryList = new MemoryList(UassetData.Exports_Directory[n].ExportData))
{

memoryList.Seek(0); //Seek to beginning of Block

//no need for now
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"-----------{n}------------");
// Console.WriteLine($"-----------{n}------------");
Console.ForegroundColor = ConsoleColor.White;
_ = new StructProperty(memoryList, this, true, Modify);
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"-----------End------------");
// Console.WriteLine($"-----------End------------");
Console.ForegroundColor = ConsoleColor.White;

switch (UassetData.GetExportPropertyName(UassetData.Exports_Directory[n].ExportClass))
Expand All @@ -78,6 +74,8 @@ private void ReadOrEdit(bool Modify = false)
break;
}
}

//Console.ReadLine();
}


Expand Down
6 changes: 3 additions & 3 deletions UE4localizationsTool/Core/locres.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ private void ReadOrEdit(bool Modify = false)
throw new Exception("Unsupported locres version");
}

Console.WriteLine(Version);
// Console.WriteLine(Version);

if (Version >= LocresVersion.Compact)
{
Console.WriteLine("Compact");
// Console.WriteLine("Compact");
int localizedStringOffset = (int)locresData.GetInt64Value();
locresData.Seek(localizedStringOffset);

Expand Down Expand Up @@ -119,7 +119,7 @@ private void ReadOrEdit(bool Modify = false)
{
locresData.GetStringUE(); //string hash
locresData.Skip(4); //Unkown
Strings.Add(new List<string>() { Strings.Count.ToString(), locresData.GetStringUE() });
locresData.ReplaceStringUE(Strings[CurrentIndex][1]);
CurrentIndex++;
}
}
Expand Down
61 changes: 60 additions & 1 deletion UE4localizationsTool/FrmMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ff55d52

Please sign in to comment.