public virtual void DrawAnchor(Anchor <EntityType> CurrentAnchor, int CurrentAnchorIndex, ref Vector2 Origin, ref bool bAnyAnchorsHovered, ref float WidestAnchor, bool bJustCalculateSize, TypeOfAnchor AnchorType, bool bLeftAlign) { Vector2 WindowOffset = Owner.GetWindowOffset(); Rect WholeAnchorRect = new Rect(0.0f, 0.0f, 0.0f, 0.0f); bool bIsHovered = false; DrawAnchorContent(CurrentAnchor, CurrentAnchorIndex, ref Origin, ref WidestAnchor, ref WholeAnchorRect, bIsHovered, true, AnchorType, bLeftAlign); if (!bJustCalculateSize) { bIsHovered = WholeAnchorRect.Contains(InputState.GetLocalMousePosition(Owner, new Vector2(Position.x - Owner.GetWindowOffset().x, Position.y + 10.0f - Owner.GetWindowOffset().y))); if (bIsHovered) { bAnyAnchorsHovered = true; } DrawAnchorContent(CurrentAnchor, CurrentAnchorIndex, ref Origin, ref WidestAnchor, ref WholeAnchorRect, bIsHovered, false, AnchorType, bLeftAlign); CurrentAnchor.LastRect = new Rect(Position.x + WholeAnchorRect.x - WindowOffset.x, Position.y + WholeAnchorRect.y - WindowOffset.y + 5.0f, WholeAnchorRect.width, WholeAnchorRect.height); Origin.y += AnchorLabelGap; } }
/* public virtual void GenerateRTFForDialogue() * { * ChapterWindow.ExportSpecificToRTFWithMask(ScriptExporter.SearchMask.CurrentDialogue); * }*/ public override void DrawAnchorContent(Anchor <MonsterTestBase> CurrentAnchor, int CurrentAnchorIndex, ref Vector2 Origin, ref float WidestLabel, ref Rect WholeAnchorRect, bool bIsHovered, bool bJustCalculateSize, TypeOfAnchor AnchorType, bool bLeftAlign) { base.DrawAnchorContent(CurrentAnchor, CurrentAnchorIndex, ref Origin, ref WidestLabel, ref WholeAnchorRect, bIsHovered, bJustCalculateSize, AnchorType, bLeftAlign); Vector2 PlusTextSize = GetLabelSize("+"); Rect PlusButtonPosition = new Rect(Origin.x + AnchorBoxSize, Origin.y, PlusTextSize.x + AnchorLabelGap, PlusTextSize.y + AnchorSubtextGap); if (!bLeftAlign) { PlusButtonPosition = new Rect(Origin.x + WidestLabel - AnchorBoxSize - PlusButtonPosition.width, Origin.y, PlusButtonPosition.width, PlusButtonPosition.height); } if (!bJustCalculateSize && !bLeftAlign) { if (GUI.Button(PlusButtonPosition, new GUIContent("+"))) { Owner.HandleChainBoxContextMenu(CurrentAnchor); } Origin.y += PlusTextSize.y + AnchorSubtextGap; } }
public virtual void DrawAnchorContent(Anchor <EntityType> CurrentAnchor, int CurrentAnchorIndex, ref Vector2 Origin, ref float WidestLabel, ref Rect WholeAnchorRect, bool bIsHovered, bool bJustCalculateSize, TypeOfAnchor AnchorType, bool bLeftAlign) { string LabelTitle = CurrentAnchor.GetLabelDescription(); Vector2 LabelSize = GetLabelSize(LabelTitle); Rect LabelRect = new Rect(Origin.x + WidestLabel - AnchorBoxSize - LabelSize.x, Origin.y, LabelSize.x, LabelSize.y); WholeAnchorRect = new Rect(LabelRect.x, LabelRect.y, LabelSize.x + (2 * AnchorBoxSize), LabelSize.y); if (bLeftAlign) { LabelRect = new Rect(Origin.x + AnchorBoxSize, Origin.y, LabelSize.x, LabelSize.y); WholeAnchorRect = new Rect(Origin.x, Origin.y, LabelSize.x + (2 * AnchorBoxSize), LabelSize.y); } if (!bJustCalculateSize) { if (bIsHovered) { GUI.color = Color.red; Owner.HandleHoveredAnchor(CurrentAnchor); } else { GUI.color = Color.white; } GUI.Label(LabelRect, LabelTitle); GUI.color = Color.white; Origin.y += WholeAnchorRect.height; } WidestLabel = WholeAnchorRect.width > WidestLabel ? WholeAnchorRect.width : WidestLabel; }