Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
WiiVC Injector
Commits
c1c93074
Commit
c1c93074
authored
Apr 29, 2023
by
Amyn Bennamane
Browse files
Use GameTDB for game name instead of internal game name
parent
f4f04a45
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
TeconMoon's WiiVC Injector/Form1.cs
View file @
c1c93074
...
...
@@ -813,7 +813,8 @@ namespace TeconMoon_s_WiiVC_Injector
goto
EndOfGameSelection
;
}
GameNameLabel
.
Text
=
InternalGameName
;
PackedTitleLine1
.
Text
=
InternalGameName
;
var
GameTitle
=
StringUtil
.
RemoveSpecialChars
(
GameTdb
.
GetName
(
CucholixRepoID
));
PackedTitleLine1
.
Text
=
!
string
.
IsNullOrEmpty
(
GameTitle
)
?
GameTitle
:
InternalGameName
;
//Convert pulled Title ID Int to Hex for use with Wii U Title ID
idBytes
=
BitConverter
.
GetBytes
(
TitleIDInt
);
if
(!
BitConverter
.
IsLittleEndian
)
...
...
@@ -851,6 +852,7 @@ namespace TeconMoon_s_WiiVC_Injector
}
EndOfGameSelection
:;
}
private
void
IconSourceButton_Click
(
object
sender
,
EventArgs
e
)
{
if
(
FlagRepo
)
...
...
TeconMoon's WiiVC Injector/GameTdb.cs
0 → 100644
View file @
c1c93074
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Reflection
;
using
System.Text
;
using
System.Threading.Tasks
;
using
TeconMoon_s_WiiVC_Injector.Properties
;
using
static
TeconMoon_s_WiiVC_Injector
.
StringUtil
;
namespace
TeconMoon_s_WiiVC_Injector
{
public
class
GameTdb
{
public
static
string
GetName
(
string
id
)
{
var
assembly
=
Assembly
.
GetExecutingAssembly
();
var
wiitdb
=
"TeconMoon_s_WiiVC_Injector.Resources.wiitdb.txt"
;
using
(
var
stream
=
assembly
.
GetManifestResourceStream
(
wiitdb
))
using
(
var
reader
=
new
StreamReader
(
stream
))
{
string
line
;
while
((
line
=
reader
.
ReadLine
())
!=
null
)
{
var
split
=
line
.
Split
(
new
[]
{
" = "
},
2
,
StringSplitOptions
.
None
);
if
(
split
[
0
]
==
id
)
return
split
[
1
];
}
return
null
;
}
}
}
}
TeconMoon's WiiVC Injector/Properties/Resources.Designer.cs
View file @
c1c93074
...
...
@@ -19,7 +19,7 @@ namespace TeconMoon_s_WiiVC_Injector.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"System.Resources.Tools.StronglyTypedResourceBuilder"
,
"1
5
.0.0.0"
)]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"System.Resources.Tools.StronglyTypedResourceBuilder"
,
"1
7
.0.0.0"
)]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
internal
class
Resources
{
...
...
@@ -69,5 +69,26 @@ namespace TeconMoon_s_WiiVC_Injector.Properties {
return
((
byte
[])(
obj
));
}
}
/// <summary>
/// Looks up a localized string similar to TITLES = https://www.gametdb.com (type: Wii language: ORIG version: 20230426014834)
///007E01 = Wii Auto Erase Disc
///091E00 = Movie-Ch Install Disc Ver. A
///23EE41 = Just Dance 2023 Wii Edition
///410E01 = Wii Backup Disc v1.31
///413E01 = DiscUpdate Disc
///D2AJAF = みんなで冒険!ファミリートレーナー 体験版
///D2SE18 = Deca Sports 2 (Demo)
///D3DE18 = Deca Sports 3 (Demo)
///DASE4Q = Disney Epic Mickey (Demo)
///DAUEPZ = Country Dance (Demo)
///DAVE01 = Mystery Case Files: The Malgrave Incident (Demo)
///DAXE01 = The Legend of Zelda: Skyward Swor [rest of string was truncated]";.
/// </summary>
internal
static
string
wiitdb
{
get
{
return
ResourceManager
.
GetString
(
"wiitdb"
,
resourceCulture
);
}
}
}
}
TeconMoon's WiiVC Injector/Properties/Resources.resx
View file @
c1c93074
...
...
@@ -121,4 +121,7 @@
<data
name=
"TOOLDIR"
type=
"System.Resources.ResXFileRef, System.Windows.Forms"
>
<value>
..\Resources\TOOLDIR.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</data>
<data
name=
"wiitdb"
type=
"System.Resources.ResXFileRef, System.Windows.Forms"
>
<value>
..\Resources\wiitdb.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
</value>
</data>
</root>
\ No newline at end of file
TeconMoon's WiiVC Injector/Resources/wiitdb.txt
0 → 100644
View file @
c1c93074
This diff is collapsed.
Click to expand it.
TeconMoon's WiiVC Injector/StringUtil.cs
0 → 100644
View file @
c1c93074
using
System
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.IO
;
using
System.Linq
;
using
System.Reflection
;
using
System.Text
;
using
System.Threading.Tasks
;
using
TeconMoon_s_WiiVC_Injector.Properties
;
namespace
TeconMoon_s_WiiVC_Injector
{
public
static
class
StringUtil
{
public
static
string
RemoveSpecialChars
(
string
v
)
{
if
(
string
.
IsNullOrEmpty
(
v
))
return
v
;
string
s
=
RemoveDiacritics
(
v
);
string
stripped
=
new
string
(
s
.
Where
(
c
=>
c
<
128
).
ToArray
());
return
stripped
;
}
public
static
string
RemoveDiacritics
(
string
text
)
{
var
normalizedString
=
text
.
Normalize
(
NormalizationForm
.
FormD
);
var
stringBuilder
=
new
StringBuilder
(
capacity
:
normalizedString
.
Length
);
for
(
int
i
=
0
;
i
<
normalizedString
.
Length
;
i
++)
{
char
c
=
normalizedString
[
i
];
var
unicodeCategory
=
CharUnicodeInfo
.
GetUnicodeCategory
(
c
);
if
(
unicodeCategory
!=
UnicodeCategory
.
NonSpacingMark
)
{
stringBuilder
.
Append
(
c
);
}
}
return
stringBuilder
.
ToString
()
.
Normalize
(
NormalizationForm
.
FormC
);
}
}
}
TeconMoon's WiiVC Injector/TeconMoon's WiiVC Injector.csproj
View file @
c1c93074
...
...
@@ -155,6 +155,8 @@
<Compile
Include=
"Form1.Designer.cs"
>
<DependentUpon>
Form1.cs
</DependentUpon>
</Compile>
<Compile
Include=
"StringUtil.cs"
/>
<Compile
Include=
"GameTdb.cs"
/>
<Compile
Include=
"SettingsForm.cs"
>
<SubType>
Form
</SubType>
</Compile>
...
...
@@ -206,6 +208,9 @@
</ItemGroup>
<ItemGroup>
<Content
Include=
"favicon.ico"
/>
<EmbeddedResource
Include=
"Resources\wiitdb.txt"
>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</EmbeddedResource>
<Content
Include=
"WiiU.ico"
/>
</ItemGroup>
<ItemGroup>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment