本文整理汇总了C#中Pawn.GetTooltip方法的典型用法代码示例。如果您正苦于以下问题:C# Pawn.GetTooltip方法的具体用法?C# Pawn.GetTooltip怎么用?C# Pawn.GetTooltip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pawn
的用法示例。
在下文中一共展示了Pawn.GetTooltip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PreDrawPawnRow
private void PreDrawPawnRow(Rect rect, Pawn p)
{
Rect position = new Rect(0f, rect.y, rect.width, 30f);
if (position.Contains(Event.current.mousePosition))
{
GUI.DrawTexture(position, TexUI.HighlightTex);
}
Rect rect2 = new Rect(0f, rect.y, 175f, 30f);
Rect position2 = rect2.ContractedBy(3f);
if (p.health.summaryHealth.SummaryHealthPercent < 0.99f)
{
Rect screenRect = new Rect(rect2);
screenRect.xMin -= 4f;
screenRect.yMin += 4f;
screenRect.yMax -= 6f;
Widgets.FillableBar(screenRect, p.health.summaryHealth.SummaryHealthPercent, PawnUIOverlay.HealthTex, BaseContent.ClearTex, false);
}
if (rect2.Contains(Event.current.mousePosition))
{
GUI.DrawTexture(position2, TexUI.HighlightTex);
}
Text.Font = GameFont.Small;
Text.Anchor = TextAnchor.MiddleLeft;
Rect rect3 = new Rect(rect2);
rect3.xMin += 15f;
Widgets.Label(rect3, p.LabelCap);
if (Widgets.InvisibleButton(rect2))
{
Find.LayerStack.TopLayerOfType<Dialog_Overview>().Close(true);
Find.CameraMap.JumpTo(p.Position);
Find.Selector.ClearSelection();
Find.Selector.Select(p, true);
return;
}
TipSignal tooltip = p.GetTooltip();
tooltip.text = "ClickToJumpTo".Translate() + "\n\n" + tooltip.text;
TooltipHandler.TipRegion(rect2, tooltip);
}
示例2: PreDrawPawnRow
private void PreDrawPawnRow(Rect rect, Pawn p)
{
Rect rect2 = new Rect(0f, rect.y, rect.width, 30f);
if (Mouse.IsOver(rect2) || MainTabWindow_Work.Copied == p)
{
GUI.DrawTexture(rect2, TexUI.HighlightTex);
}
Rect rect3 = new Rect(0f, rect.y, 175f, 30f);
Rect position = rect3.ContractedBy(3f);
if (p.health.summaryHealth.SummaryHealthPercent < 0.99f)
{
Rect rect4 = new Rect(rect3);
rect4.xMin -= 4f;
rect4.yMin += 4f;
rect4.yMax -= 6f;
Widgets.FillableBar(rect4, p.health.summaryHealth.SummaryHealthPercent, PawnUIOverlay.OverlayHealthTex, BaseContent.ClearTex, false);
}
if (Mouse.IsOver(rect3))
{
GUI.DrawTexture(position, TexUI.HighlightTex);
}
string label;
if (!p.RaceProps.Humanlike && p.Name != null && !p.Name.Numerical)
{
label = p.Name.ToStringShort.CapitalizeFirst() + ", " + p.KindLabel;
}
else
{
label = p.LabelCap;
}
Text.Font = GameFont.Small;
Text.Anchor = TextAnchor.MiddleLeft;
Text.WordWrap = false;
Rect rect5 = new Rect(rect3);
rect5.xMin += 15f;
Widgets.Label(rect5, label);
Text.WordWrap = true;
if (Event.current.type == EventType.MouseDown && Mouse.IsOver(rect3))
{
if (Event.current.button == 0)
{
Find.MainTabsRoot.EscapeCurrentTab();
Find.CameraMap.JumpTo(p.PositionHeld);
Find.Selector.ClearSelection();
if (p.Spawned)
{
Find.Selector.Select(p);
}
}
if (Event.current.button == 1 && !p.RaceProps.Humanlike && p.Name != null && !p.Name.Numerical)
{
Find.WindowStack.Add(new Dialog_RenamePet(p));
}
Event.current.Use();
}
TipSignal tooltip = p.GetTooltip();
string temp = tooltip.text;
tooltip.text = "Fluffy.ClickToJump".Translate();
if (!p.RaceProps.Humanlike && p.Name != null && !p.Name.Numerical)
{
tooltip.text += "\n" + "Fluffy.RightClickToRename".Translate();
}
tooltip.text += "\n\n" + temp;
TooltipHandler.TipRegion(rect3, tooltip);
}
示例3: DrawPawnLabel
// Pawn's Names Table Cell
public void DrawPawnLabel(Rect rect, Pawn p)
{
GUI.BeginGroup(rect);
{
if (Mouse.IsOver(rect))
{
GUI.DrawTexture(rect, TexUI.HighlightTex);
}
if (p.health.summaryHealth.SummaryHealthPercent < 0.99f)
{
Rect rect4 = new Rect(rect);
rect4.xMin -= 4f;
rect4.yMin += 4f;
rect4.yMax -= 6f;
Widgets.FillableBar(rect4, p.health.summaryHealth.SummaryHealthPercent, PawnUIOverlay.HealthTex, BaseContent.ClearTex, false);
}
if (Mouse.IsOver(rect))
{
// add margin inside rect
GUI.DrawTexture(rect.ContractedBy(3f), TexUI.HighlightTex);
}
string label;
if (!p.RaceProps.Humanlike && p.Name != null && !p.Name.Numerical)
{
label = p.Name.ToStringShort.CapitalizeFirst() + ", " + p.KindLabel;
}
else
{
label = p.LabelCap;
}
Text.Font = GameFont.Small;
Text.Anchor = TextAnchor.MiddleLeft;
Text.WordWrap = false;
Rect rect5 = new Rect(rect);
rect5.xMin += 15f;
Widgets.Label(rect5, label);
Text.WordWrap = true;
if (Widgets.InvisibleButton(rect))
{
Find.MainTabsRoot.EscapeCurrentTab(true);
Find.CameraMap.JumpTo(p.PositionHeld);
Find.Selector.ClearSelection();
if (p.SpawnedInWorld)
{
Find.Selector.Select(p, true, true);
}
return;
}
TipSignal tooltip = p.GetTooltip();
tooltip.text = "ClickToJumpTo".Translate() + "\n\n" + tooltip.text;
TooltipHandler.TipRegion(rect, tooltip);
if (p.Downed)
{
GUI.color = new Color(1f, 0f, 0f, 0.5f);
Widgets.DrawLineHorizontal(rect.x, rect.center.y, rect.width);
GUI.color = Color.white;
}
}
GUI.EndGroup();
}