private static void DrawHeadingCheckBox(IEntityFilter filter, string label, string description, ref Rect baseRect) { Text.Font = GameFont.Medium; Rect rect = new Rect(baseRect.x, baseRect.y, baseRect.width, Text.LineHeight); Widgets.DrawHighlightIfMouseover(rect); if (!description.NullOrEmpty()) { if (Mouse.IsOver(rect)) { GUI.DrawTexture(rect, TexUI.HighlightTex); } TooltipHandler.TipRegion(rect, description); } Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(rect, label); bool flag = filter.IsVaild(); bool flag2 = flag; Widgets.Checkbox(new Vector2(baseRect.x + rect.width - 26f, baseRect.y + 4f), ref flag); if (flag != flag2) { filter.SetVaild(flag); } baseRect.y += rect.height; Text.Anchor = TextAnchor.UpperLeft; }
public void CopyFrom(IEntityFilter from) { if (from == null) { return; } this.vaild = from.IsVaild(); this.allowedEntityList.Clear(); foreach (var a in from.GetAllowedEntityList()) { this.allowedEntityList.Add(a); } this.forbiddenSpFilterList.Clear(); foreach (var a in from.GetforbiddenSpFilterList()) { this.forbiddenSpFilterList.Add(a); } }