Prepare fixtures
This commit is contained in:
parent
797e5ea192
commit
9c94356263
6021 changed files with 722805 additions and 22 deletions
23
kf_sources/UnicodeFontMutator/Classes/UFGameStats.uc
Normal file
23
kf_sources/UnicodeFontMutator/Classes/UFGameStats.uc
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
class UFGameStats extends GameStats;
|
||||
|
||||
// Connect Events get fired every time a player connects to a server
|
||||
function ConnectEvent(PlayerReplicationInfo Who)
|
||||
{
|
||||
local string out;
|
||||
if ( Who.bBot || Who.bOnlySpectator ) // Spectators should never show up in stats!
|
||||
return;
|
||||
|
||||
Who.PlayerName = class'UnicodeFontMutator'.static.Junk2Unicode(Who.PlayerName);
|
||||
|
||||
// C 0 11d8944d9e138a5aa688d503e0e4c3e0
|
||||
out = Header()$"C"$Tab$Controller(Who.Owner).PlayerNum$Tab;
|
||||
|
||||
// Login identifier
|
||||
out $= GetStatsIdentifier(Controller(Who.Owner));
|
||||
|
||||
Logf(out);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
128
kf_sources/UnicodeFontMutator/Classes/UnicodeFontMutator.uc
Normal file
128
kf_sources/UnicodeFontMutator/Classes/UnicodeFontMutator.uc
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
class UnicodeFontMutator extends Mutator;
|
||||
|
||||
function PostBeginPlay()
|
||||
{
|
||||
local GameStats stats;
|
||||
stats = Spawn(class'UnicodeFontMutator.UFGameStats');
|
||||
Level.Game.GameStats=stats;
|
||||
//Level.Game.GameStatsClass="UnicodeFontMutator.UFGameStats"; //do NOT uncomment
|
||||
|
||||
Super.PostBeginPlay();
|
||||
}
|
||||
|
||||
static function int LookupTable(int raw)
|
||||
{
|
||||
local int i;
|
||||
local int CP1252Table[0x20];
|
||||
|
||||
i = 0;
|
||||
CP1252Table[i++] = 0x20AC;
|
||||
CP1252Table[i++] = 0;
|
||||
CP1252Table[i++] = 0x201A;
|
||||
CP1252Table[i++] = 0x192;
|
||||
CP1252Table[i++] = 0x201E;
|
||||
CP1252Table[i++] = 0x2026;
|
||||
CP1252Table[i++] = 0x2020;
|
||||
CP1252Table[i++] = 0x2021;
|
||||
CP1252Table[i++] = 0x2C6;
|
||||
CP1252Table[i++] = 0x2030;
|
||||
CP1252Table[i++] = 0x160;
|
||||
CP1252Table[i++] = 0x2039;
|
||||
CP1252Table[i++] = 0x152;
|
||||
CP1252Table[i++] = 0;
|
||||
CP1252Table[i++] = 0x17D;
|
||||
CP1252Table[i++] = 0;
|
||||
//
|
||||
CP1252Table[i++] = 0;
|
||||
CP1252Table[i++] = 0x2018;
|
||||
CP1252Table[i++] = 0x2019;
|
||||
CP1252Table[i++] = 0x201C;
|
||||
CP1252Table[i++] = 0x201D;
|
||||
CP1252Table[i++] = 0x2022;
|
||||
CP1252Table[i++] = 0x2013;
|
||||
CP1252Table[i++] = 0x2014;
|
||||
CP1252Table[i++] = 0x2DC;
|
||||
CP1252Table[i++] = 0x2122;
|
||||
CP1252Table[i++] = 0x161;
|
||||
CP1252Table[i++] = 0x203A;
|
||||
CP1252Table[i++] = 0x153;
|
||||
CP1252Table[i++] = 0;
|
||||
CP1252Table[i++] = 0x17E;
|
||||
CP1252Table[i++] = 0x178;
|
||||
|
||||
if (raw == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
for(i = 0; i < 0x20; i++)
|
||||
{
|
||||
if (CP1252Table[i] == raw)
|
||||
{
|
||||
return 0x80+i;
|
||||
}
|
||||
}
|
||||
return raw;
|
||||
}
|
||||
|
||||
static function string Junk2Unicode(string a)
|
||||
{
|
||||
local int i;
|
||||
local int c;
|
||||
local int d;
|
||||
local int e;
|
||||
local string u;
|
||||
|
||||
u = "";
|
||||
for(i = 0; i < Len(a); i++)
|
||||
{
|
||||
c = LookupTable(Asc(Mid(a, i, 1)));
|
||||
if(c < 0x80) //not junk
|
||||
{
|
||||
u $= Chr(c);
|
||||
continue;
|
||||
}
|
||||
|
||||
if((c >> 5 == 6)&&(Len(a) > i+1)) //2-byte char?
|
||||
{
|
||||
d = LookupTable(Asc(Mid(a, ++i, 1)));
|
||||
if(d >> 6 == 2)
|
||||
{
|
||||
u $= Chr( ((c & 0x1F)<<6)|(d ^ 0x80) ); //insane hack
|
||||
}
|
||||
else
|
||||
{
|
||||
u $= Chr(c); //map CP1252 char
|
||||
i--;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if((c >> 4 == 14)&&(Len(a) > i+2)) //3-byte char?
|
||||
{
|
||||
d = LookupTable(Asc(Mid(a, ++i, 1)));
|
||||
e = LookupTable(Asc(Mid(a, ++i, 1)));
|
||||
if((d >> 6 == 2)&&(e >> 6 == 2))
|
||||
{
|
||||
u $= Chr( ((c & 0x0F)<<12)|((d ^ 0x80) << 6)|(e ^ 0x80) );
|
||||
}
|
||||
else
|
||||
{
|
||||
Chr(c);
|
||||
i -= 2;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
//good enough for the demo lol. give up.
|
||||
u $= Chr(c);
|
||||
|
||||
}
|
||||
return u;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bAddToServerPackages=True
|
||||
GroupName="KFUnicodeFontMutator"
|
||||
FriendlyName="Unicode Support - Player names fix"
|
||||
Description="Fix player names so they display properly in Unicode."
|
||||
}
|
||||
8
kf_sources/UnicodeFontMutator/Classes/index.html
Normal file
8
kf_sources/UnicodeFontMutator/Classes/index.html
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<html>
|
||||
<head><title>Index of /kf_sources/UnicodeFontMutator/Classes/</title></head>
|
||||
<body>
|
||||
<h1>Index of /kf_sources/UnicodeFontMutator/Classes/</h1><hr><pre><a href="../">../</a>
|
||||
<a href="UFGameStats.uc">UFGameStats.uc</a> 24-May-2020 17:24 592
|
||||
<a href="UnicodeFontMutator.uc">UnicodeFontMutator.uc</a> 24-May-2020 17:24 2650
|
||||
</pre><hr></body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue