Permalink
Browse files

Group name should have back layer shadow

  • Loading branch information...
UnknownShadow200 committed Jan 12, 2018
1 parent d1c3f85 commit ad7caf40b720ab43a609b1985e7fc4b276b3a49e
Showing with 10 additions and 10 deletions.
  1. +2 −2 ClassicalSharp.sln
  2. +8 −8 ClassicalSharp/2D/Widgets/PlayerListWidget.cs
View
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 4.4
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassicalSharp", "ClassicalSharp\ClassicalSharp.csproj", "{BEB1C785-5CAD-48FF-A886-876BF0A318D4}"
EndProject
@@ -35,7 +35,7 @@ public class PlayerListWidget : Widget {
TabListEntry[] entries = TabList.Entries;
for (int id = 0; id < entries.Length; id++) {
TabListEntry e = entries[id];
if (e != null) AddPlayerInfo((byte)id, -1);
if (e != null) AddName((byte)id, -1);
}
SortAndReposition();
@@ -171,9 +171,9 @@ public class PlayerListWidget : Widget {
}
void AddPlayerInfo(byte id, int index) {
void AddName(byte id, int index) {
string name = TabList.Entries[id].ListName;
Texture tex = DrawName(name);
Texture tex = DrawName(name, false);
// insert at end of list
if (index == -1) { index = namesCount; namesCount++; }
@@ -182,7 +182,7 @@ public class PlayerListWidget : Widget {
}
void TabEntryAdded(object sender, IdEventArgs e) {
AddPlayerInfo(e.Id, -1);
AddName(e.Id, -1);
SortAndReposition();
}
@@ -192,7 +192,7 @@ public class PlayerListWidget : Widget {
Texture tex = textures[i];
gfx.DeleteTexture(ref tex);
AddPlayerInfo(e.Id, i);
AddName(e.Id, i);
SortAndReposition();
return;
}
@@ -230,10 +230,10 @@ public class PlayerListWidget : Widget {
Reposition();
}
Texture DrawName(string name) {
Texture DrawName(string name, bool shadow) {
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);
game.Drawer2D.ReducePadding(ref tex, Utils.Floor(font.Size), 3);
return tex;
@@ -295,7 +295,7 @@ class GroupComparer : IComparer<short> {
IDs[index] = (short)-id;
string group = TabList.Entries[id].Group;
textures[index] = DrawName(group);
textures[index] = DrawName(group, true);
index++;
namesCount++;

0 comments on commit ad7caf4

Please sign in to comment.