Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightgazer authored Nov 23, 2017
1 parent 034ed2f commit bcd4a89
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 13 deletions.
2 changes: 1 addition & 1 deletion TuBS/TuBS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Global
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
description = Berwick Saga translation tool.
version = 1.7
version = 1.8
EndGlobalSection
EndGlobal
12 changes: 6 additions & 6 deletions TuBS/TuBS.userprefs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore>
<Breakpoint file="/home/lightgazer/etc/bs/mono/TuBS/TuBS/MainWindow.cs" line="1424" column="1" />
<Breakpoint file="/home/lightgazer/etc/bs/mono/TuBS/TuBS/MainWindow.cs" line="1425" column="1" />
<Breakpoint file="/home/lightgazer/etc/bs/mono/TuBS/TuBS/MainWindow.cs" line="646" column="1" />
<Breakpoint file="/home/lightgazer/etc/bs/mono/TuBS/TuBS/MainWindow.cs" line="670" column="1" />
<Breakpoint file="/home/lightgazer/etc/bs/mono/TuBS/TuBS/MainWindow.cs" line="1435" column="1" />
<Breakpoint file="/home/lightgazer/etc/bs/mono/TuBS/TuBS/MainWindow.cs" line="1436" column="1" />
<Breakpoint file="/home/lightgazer/etc/bs/mono/TuBS/TuBS/MainWindow.cs" line="657" column="1" />
<Breakpoint file="/home/lightgazer/etc/bs/mono/TuBS/TuBS/MainWindow.cs" line="681" column="1" />
</BreakpointStore>
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.Workbench ActiveDocument="TuBS/MainWindow.cs">
<Files>
<File FileName="TuBS/MainWindow.cs" Line="174" Column="4" />
<File FileName="TuBS/MainWindow.cs" Line="31" Column="46" />
<File FileName="TuBS/EmptyClass.cs" Line="1" Column="1" />
<File FileName="TuBS/CodePage.cs" Line="1" Column="1" />
<File FileName="TuBS/ImportScript.cs" Line="1" Column="1" />
<File FileName="TuBS/ExportScript.cs" Line="1" Column="1" />
<File FileName="TuBS/ImageConv.cs" Line="1" Column="1" />
<File FileName="TuBS/Comp.cs" Line="1" Column="1" />
<File FileName="TuBS/Palette.cs" Line="242" Column="1" />
<File FileName="TuBS/Palette.cs" Line="1" Column="1" />
<File FileName="TuBS/DatScript.cs" Line="1" Column="1" />
<File FileName="TuBS/Program.cs" Line="1" Column="1" />
</Files>
Expand Down
38 changes: 33 additions & 5 deletions TuBS/TuBS/ExportScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected List<string> DumpText (FileInfo file, char[] code_page)
while (reader.BaseStream.Position < reader.BaseStream.Length) {
ushort num1 = reader.ReadUInt16 ();
if ((int)num1 < 32768) {//ordinary char from "font"
if(code_page.Length > num1)
if (code_page.Length > num1)
str += code_page [num1].ToString ();
else
str += "<" + num1.ToString () + ">";
Expand All @@ -37,12 +37,12 @@ protected List<string> DumpText (FileInfo file, char[] code_page)
else if ((int)num1 == 44544)
str += "▲";
else if ((int)num1 == 33024) { // window end
if(scene.Active == true)
script.Add ("#" + scene.Window + ": " + scene.GetActor());
if (scene.Active == true)
script.Add ("#" + scene.Window + "; Size: " + scene.GetSize () + "; " + scene.GetActor ());
script.Add (str);
script.Add ("-----------------------");
str = "";
//info bytes
//info bytes
} else if ((int)num1 == 35074) {
str += "■";
reader.BaseStream.Position -= 2;
Expand All @@ -60,7 +60,7 @@ protected List<string> DumpText (FileInfo file, char[] code_page)
str += "■";
reader.BaseStream.Position -= 2;
strsq += "[" + reader.ReadByte () + "." + reader.ReadByte () + ".]";
} else if ((int)num1 ==2024 || (int)num1 == 33280 || (int)num1 == 39936 || (int)num1 == 47104) { //some strange chars
} else if ((int)num1 == 2024 || (int)num1 == 33280 || (int)num1 == 39936 || (int)num1 == 47104) { //some strange chars
str += "■";
reader.BaseStream.Position -= 2;
strsq += "[" + reader.ReadByte () + "." + reader.ReadByte () + ".]";
Expand All @@ -75,6 +75,17 @@ protected List<string> DumpText (FileInfo file, char[] code_page)
strsq += reader.ReadByte () + ".";
}
strsq += "]";
} else if ((int)num1 == 40961) { //window size
ushort size = reader.ReadUInt16 ();
scene.SetSize (size);
str += "■";
reader.BaseStream.Position -= 4;
strsq += "[";
for (int i = 0; i < 4; i++)
if (reader.BaseStream.Position < reader.BaseStream.Length) {
strsq += reader.ReadByte () + ".";
}
strsq += "]";
} else {
str += "■";
reader.BaseStream.Position -= 2;
Expand Down Expand Up @@ -139,9 +150,26 @@ class Scene
{
ushort upper_actor;
ushort lower_actor;
ushort upper_size;
ushort lower_size;
public string Window = "Lower Window"; //message appears in lower window by default
public bool Active = false;

public void SetSize (ushort size)
{
if (Window == "Upper Window")
upper_size = size;
else
lower_size = size;
}

public string GetSize ()
{
if (Window == "Upper Window")
return upper_size.ToString ();
return lower_size.ToString ();
}

public void SetActor (ushort id)
{
Active = true;
Expand Down
10 changes: 10 additions & 0 deletions TuBS/TuBS/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ public MainWindow () : base (Gtk.WindowType.Toplevel)
progressbar.Text = "Status: " + pathdat4 + " not found";
if (!File.Exists (pathdat3))
progressbar.Text = "Status: " + pathdat3 + " not found";
if ('/' != System.IO.Path.DirectorySeparatorChar) {
string[] lines = File.ReadAllLines ("list.txt");
for (int i = 0; i < lines.Length; i++)
lines [i] = lines [i].Replace ('/', System.IO.Path.DirectorySeparatorChar);
File.WriteAllLines("list.txt", lines);
lines = File.ReadAllLines ("protect.txt");
for (int i = 0; i < lines.Length; i++)
lines [i] = lines [i].Replace ('/', System.IO.Path.DirectorySeparatorChar);
File.WriteAllLines ("protect.txt", lines);
}
foreach (string list in Directory.EnumerateFiles(Directory.GetCurrentDirectory (), "list*.txt", SearchOption.TopDirectoryOnly))
ReadImportList (list);
}
Expand Down
9 changes: 9 additions & 0 deletions TuBS/TuBS/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,12 @@ public static void Main (string[] args)
}
}
}


//ToDo list for 2.0
// 1.лучшее форматирование текста
// 2.new flow of work (prepare(once) -> update images (one time) -> import text (every time))
// 3.хедеры для скриптов (и картинок?)
// 4.кёрнинг и sjis.dat
// 5.самопроверка
// 6.архивы в памяти
2 changes: 1 addition & 1 deletion TuBS/TuBS/TuBS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<RootNamespace>TuBS</RootNamespace>
<AssemblyName>TuBS</AssemblyName>
<Description>Berwick Saga translation tool.</Description>
<ReleaseVersion>1.7</ReleaseVersion>
<ReleaseVersion>1.8</ReleaseVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
Expand Down

0 comments on commit bcd4a89

Please sign in to comment.