diff --git a/Assemblies/RWNumbers.dll b/Assemblies/RWNumbers.dll index 8719248..2607a81 100644 Binary files a/Assemblies/RWNumbers.dll and b/Assemblies/RWNumbers.dll differ diff --git a/Source/kNumbers/KListObject.cs b/Source/kNumbers/KListObject.cs index 7e70829..5658529 100644 --- a/Source/kNumbers/KListObject.cs +++ b/Source/kNumbers/KListObject.cs @@ -131,7 +131,7 @@ public KListObject(objectType type, string defName, object dObject) break; case objectType.CurrentJob: - minWidthDesired = 320f; + minWidthDesired = 260f; break; } @@ -363,6 +363,8 @@ public static void MedicalCareSetter(Rect rect, ref MedicalCareCategory medCare) public void Draw(Rect rect, ThingWithComps ownerPawn) { + Text.Font = GameFont.Small; + switch (oType) { case objectType.Stat: @@ -450,8 +452,19 @@ public void Draw(Rect rect, ThingWithComps ownerPawn) case objectType.CurrentJob: if(ownerPawn is Pawn) { - Text.Anchor = TextAnchor.MiddleLeft; - Widgets.Label(rect, " "+((Pawn)ownerPawn).jobs.curDriver.GetReport()); + string text = ((Pawn)ownerPawn).jobs.curDriver.GetReport(); + Text.Anchor = TextAnchor.MiddleLeft; + Rect tRect = new Rect(rect.xMin + 2, rect.yMin + 3, rect.width - 2, rect.height); + GenText.SetTextSizeToFit(text, tRect); + + if (Text.Font == GameFont.Tiny) + Widgets.Label(tRect, text); + else + { + Rect sRect = new Rect(rect.xMin + 2, rect.yMin, rect.width - 2, rect.height); + Widgets.Label(sRect, text); + } + if (Mouse.IsOver(rect)) { GUI.DrawTexture(rect, TexUI.HighlightTex); diff --git a/Source/kNumbers/MainTabWindow_Numbers.cs b/Source/kNumbers/MainTabWindow_Numbers.cs index 8b1d362..809bda5 100644 --- a/Source/kNumbers/MainTabWindow_Numbers.cs +++ b/Source/kNumbers/MainTabWindow_Numbers.cs @@ -16,7 +16,7 @@ public abstract class MainTabWindow_ThingWithComp: MainTabWindow public const float buttonWidth = 160f; - public const float PawnRowHeight = 30f; + public const float PawnRowHeight = 35f; protected const float NameColumnWidth = 175f; @@ -74,14 +74,14 @@ public void Notify_PawnsChanged() protected void DrawRows(Rect outRect) { - Rect viewRect = new Rect(0f, 0f, outRect.width - 16f, (float)this.things.Count * 30f); + Rect viewRect = new Rect(0f, 0f, outRect.width - 16f, (float)this.things.Count * PawnRowHeight); Widgets.BeginScrollView(outRect, ref this.scrollPosition, viewRect); float num = 0f; for (int i = 0; i < this.things.Count; i++) { ThingWithComps p = this.things[i]; - Rect rect = new Rect(0f, num, viewRect.width, 30f); - if (num - this.scrollPosition.y + 30f >= 0f && num - this.scrollPosition.y <= outRect.height) + Rect rect = new Rect(0f, num, viewRect.width, PawnRowHeight); + if (num - this.scrollPosition.y + PawnRowHeight >= 0f && num - this.scrollPosition.y <= outRect.height) { GUI.color = new Color(1f, 1f, 1f, 0.2f); Widgets.DrawLineHorizontal(0f, num, viewRect.width); @@ -90,7 +90,7 @@ protected void DrawRows(Rect outRect) this.DrawPawnRow(rect, p); this.PostDrawPawnRow(rect, p); } - num += 30f; + num += PawnRowHeight; } Widgets.EndScrollView(); Text.Anchor = TextAnchor.UpperLeft; @@ -98,12 +98,12 @@ protected void DrawRows(Rect outRect) private void PreDrawPawnRow(Rect rect, ThingWithComps p) { - Rect rect2 = new Rect(0f, rect.y, rect.width, 30f); + Rect rect2 = new Rect(0f, rect.y, rect.width, PawnRowHeight); if (Mouse.IsOver(rect2)) { GUI.DrawTexture(rect2, TexUI.HighlightTex); } - Rect rect3 = new Rect(0f, rect.y, 175f, 30f); + Rect rect3 = new Rect(0f, rect.y, 175f, PawnRowHeight); Rect position = rect3.ContractedBy(3f); if (p is Pawn) { @@ -573,6 +573,7 @@ public void OtherOptionsMaker() list.Add(new FloatMenuOption("koisama.MedicalCare".Translate(), action, MenuOptionPriority.Medium, null, null)); } + if (! new[] { pawnType.Corpses, pawnType.AnimalCorpses }.Contains(chosenPawnType)) { Action action = delegate { @@ -599,7 +600,7 @@ public override void DoWindowContents(Rect r) UpdatePawnList(); } - Rect position = new Rect(0f, 0f, r.width, 110f); + Rect position = new Rect(0f, 0f, r.width, 115f); GUI.BeginGroup(position); float x = 0f; @@ -688,6 +689,7 @@ public override void DoWindowContents(Rect r) //TODO: better interface - auto width calculation bool offset = true; kListDesiredWidth = 175f; + Text.Anchor = TextAnchor.MiddleCenter; for (int i=0;i