Group name should have back layer shadow

This commit is contained in:
UnknownShadow200 2018-01-12 16:11:24 +11:00
parent d1c3f85518
commit ad7caf40b7
2 changed files with 10 additions and 10 deletions

View File

@ -1,6 +1,6 @@
 
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2005 # Visual Studio 2010
# SharpDevelop 4.4 # SharpDevelop 4.4
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassicalSharp", "ClassicalSharp\ClassicalSharp.csproj", "{BEB1C785-5CAD-48FF-A886-876BF0A318D4}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassicalSharp", "ClassicalSharp\ClassicalSharp.csproj", "{BEB1C785-5CAD-48FF-A886-876BF0A318D4}"
EndProject EndProject

View File

@ -35,7 +35,7 @@ namespace ClassicalSharp.Gui.Widgets {
TabListEntry[] entries = TabList.Entries; TabListEntry[] entries = TabList.Entries;
for (int id = 0; id < entries.Length; id++) { for (int id = 0; id < entries.Length; id++) {
TabListEntry e = entries[id]; TabListEntry e = entries[id];
if (e != null) AddPlayerInfo((byte)id, -1); if (e != null) AddName((byte)id, -1);
} }
SortAndReposition(); SortAndReposition();
@ -171,9 +171,9 @@ namespace ClassicalSharp.Gui.Widgets {
} }
void AddPlayerInfo(byte id, int index) { void AddName(byte id, int index) {
string name = TabList.Entries[id].ListName; string name = TabList.Entries[id].ListName;
Texture tex = DrawName(name); Texture tex = DrawName(name, false);
// insert at end of list // insert at end of list
if (index == -1) { index = namesCount; namesCount++; } if (index == -1) { index = namesCount; namesCount++; }
@ -182,7 +182,7 @@ namespace ClassicalSharp.Gui.Widgets {
} }
void TabEntryAdded(object sender, IdEventArgs e) { void TabEntryAdded(object sender, IdEventArgs e) {
AddPlayerInfo(e.Id, -1); AddName(e.Id, -1);
SortAndReposition(); SortAndReposition();
} }
@ -192,7 +192,7 @@ namespace ClassicalSharp.Gui.Widgets {
Texture tex = textures[i]; Texture tex = textures[i];
gfx.DeleteTexture(ref tex); gfx.DeleteTexture(ref tex);
AddPlayerInfo(e.Id, i); AddName(e.Id, i);
SortAndReposition(); SortAndReposition();
return; return;
} }
@ -230,10 +230,10 @@ namespace ClassicalSharp.Gui.Widgets {
Reposition(); Reposition();
} }
Texture DrawName(string name) { Texture DrawName(string name, bool shadow) {
if (game.PureClassic) name = Utils.StripColours(name); if (game.PureClassic) name = Utils.StripColours(name);
DrawTextArgs args = new DrawTextArgs(name, font, false); DrawTextArgs args = new DrawTextArgs(name, font, shadow);
Texture tex = game.Drawer2D.MakeTextTexture(ref args, 0, 0); Texture tex = game.Drawer2D.MakeTextTexture(ref args, 0, 0);
game.Drawer2D.ReducePadding(ref tex, Utils.Floor(font.Size), 3); game.Drawer2D.ReducePadding(ref tex, Utils.Floor(font.Size), 3);
return tex; return tex;
@ -295,7 +295,7 @@ namespace ClassicalSharp.Gui.Widgets {
IDs[index] = (short)-id; IDs[index] = (short)-id;
string group = TabList.Entries[id].Group; string group = TabList.Entries[id].Group;
textures[index] = DrawName(group); textures[index] = DrawName(group, true);
index++; index++;
namesCount++; namesCount++;