/// <summary> /// Handles the selection of an entry in one of the selection wheels /// </summary> private void HandlePropertySelection(PropertyWheelEntryBase entry) { var propertyEntry = entry as PropertyWheelEntry; bool clicked = BvBinds.Select.IsReleased && !activeWheel.IsMousedOver || SharedBinds.LeftButton.IsReleased && activeWheel.IsMousedOver; if (clicked || ( propertyEntry?.BlockMember is IBlockTextMember && BindManager.IsChatOpen && MyAPIGateway.Input.IsNewGameControlPressed(MyStringId.Get("CHAT_SCREEN")) )) { if (entry is PropertyWheelShortcutEntry) { var shortcut = entry as PropertyWheelShortcutEntry; shortcut.ShortcutAction(); } else if (propertyEntry.BlockMember != null && entry.Enabled) { if (propertyEntry.BlockMember is IBlockAction) { var blockAction = propertyEntry.BlockMember as IBlockAction; blockAction.Action(); } else if (entry != activeWheel.Selection) { wheelBody.OpenBlockMemberWidget(propertyEntry.BlockMember); MenuState = QuickActionMenuState.WidgetControl; activeWheel.SetSelectionAt(activeWheel.HighlightIndex); } } } }
private void UpdateDebugText() { PropertyWheelEntryBase selection = activeWheel?.Selection; if (selection != null) { var propertyEntry = selection as PropertyWheelEntry; ITextBuilder textBuilder = debugText.TextBoard; textBuilder.Clear(); textBuilder.Append($"Prioritized Members: {Target.Prioritizer.PrioritizedMemberCount}\n"); textBuilder.Append($"Enabled Members: {Target.EnabledMemberCount}\n"); textBuilder.Append($"Selection: {selection.Element.TextBoard}\n"); if (propertyEntry != null) { textBuilder.Append($"ID: {propertyEntry.BlockMember.PropName}\n"); textBuilder.Append($"Type: {propertyEntry.BlockMember.GetType().Name}\n"); textBuilder.Append($"Entry Enabled: {propertyEntry.Enabled}\n"); textBuilder.Append($"Prop Enabled: {propertyEntry.BlockMember.Enabled}\n"); textBuilder.Append($"Value Text: {propertyEntry.BlockMember.ValueText}\n"); textBuilder.Append($"Is Duplicating: {propertyEntry.IsSelectedForDuplication}\n"); } } }
/// <summary> /// Handles selection for an entry in the duplication selection wheel /// </summary> private void HandleDupeSelection(PropertyWheelEntryBase entry) { if (BvBinds.Select.IsReleased) { var shortcutEntry = entry as PropertyWheelShortcutEntry; shortcutEntry.ShortcutAction(); } }