private void setupTooltips(TooltipController controller) { controller.SetTooltip(_tooltipOwner, "Deck name", "Type deck name.\r\n" + "press Enter to apply\r\n" + "press Esc to cancel", _textboxRename, _panelRename); controller.SetTooltip(_tooltipOwner, () => _searchSubsystem.SearchResult?.ParseErrorMessage != null ? "Syntax error" : "Search bar for decks", () => _searchSubsystem.SearchResult?.ParseErrorMessage ?? "Filter decks, example queries:\r\n" + // ReSharper disable once StringLiteralTypo "\tname: affin*\r\n" + "\tmana: \\{w\\} AND \\{u\\}\r\n\r\n" + "Ctrl+SPACE to get intellisense\r\n" + "Enter to apply\r\n" + "Ctrl+Backspace to delete one word\r\n\r\n" + "F1 to learn search bar query syntax\r\n" + "Middle mouse click to clear", _searchBar, _searchBar.Input); controller.SetTooltip(_tooltipOwner, "Deck list sort order", "Sort buttons are located over textual fields of decks.\r\n" + "Click sort button to sort by field or change sort direction.\r\n" + "Shift + Click to add field to sort priorities,\r\n" + "Ctrl + Click to remove field from sort priorities.\r\n\r\n" + "When all explicit sort criteria are equal, decks are ordered " + "by relevance to search result, then by order they were created.\r\n\r\n" + "NOTE: currently opened deck is is always first in the list", _labelSortStatus); string filterMode(FilterByDeckMode mode) => _menuFilterByDeckMode.MenuValues[(int)mode]; controller.SetTooltip(_tooltipOwner, "Filter by deck mode", "Controls how search result of cards is affected by decks.\r\n\r\n" + $"- {filterMode(FilterByDeckMode.Ignored)}\r\n" + " decks do not affect search result of cards\r\n" + $"- {filterMode(FilterByDeckMode.CurrentDeck)}\r\n" + " show cards present in currently opened deck\r\n" + $"- {filterMode(FilterByDeckMode.FilteredSavedDecks)}\r\n" + " show cards present in any saved deck from list below matching search criteria for " + "saved decks on the left", _menuFilterByDeckMode); controller.SetCustomTooltip(_layoutViewTooltip); }
private void setRegularTooltip(TooltipController defaultTooltips, QuickFilterControl control, string name, string description, bool isKeyword) { if (isKeyword) { description += "\r\n\r\n" + "Search bar lets you search by keywords too. It provides much more keyword values.\r\n" + "Use intellisense to see available values:\r\n" + "- type keywords:\r\n" + "- hit Ctrl + Space\r\n" + "- begin typing keyword"; } if (control.EnableCostBehavior) { description += "\r\n\r\n" + "Left-clicking these buttons may lead to some buttons different from the one you clicked " + "become checked or unchecked automatically.\r\n\r\n" + "Right-click the button to avoid auto checking / unchecking other buttons."; } defaultTooltips.SetTooltip(this, name, description, control); }
private void setupTooltips(TooltipController defaultTooltips, TooltipController quickFilterTooltips) { defaultTooltips.SetTooltip(this, "Deck zones", "Drag the card here to change deck area before dropping it.\r\n" + "Right/middle mouse click a card to add/remove it.\r\n" + "Ctrl+Click or Ctrl+drag-n-drop a card to change its quantity by 4.", _tabHeadersDeck); defaultTooltips.SetTooltip(this, null, "Sets count", _labelStatusSets); defaultTooltips.SetTooltip(this, "Collection cards count", "Use Alt+right/middle mouse click to add/remove card to collection.\r\n" + "Use Ctrl+Alt+right/middle mouse click to add/remove 4 copies.", _labelStatusCollection); defaultTooltips.SetTooltip(this, "Buttons filter mode", "Button filters are round checkable buttons grouped by 2 rows.\r\n" + "There are 3 possible modes: and, or, ignored.\r\n" + "To select between modes use Filter manager - the bottom " + "buttons group in right panel.", _labelStatusFilterButtons); defaultTooltips.SetTooltip(this, "Search bar mode", "Search bar is a wide text input in top panel.\r\n" + "There are 3 possible modes: and, or, ignored.\r\n" + "To select between modes use Filter manager - the bottom " + "buttons group in right panel.", _labelStatusSearch); defaultTooltips.SetTooltip(this, "Filter by Collection mode", "When filtering by Collection, Search result only shows\r\n" + "cards present in your Collection.\r\n\r\n" + "Filtering by Collection can be enabled or disabled using Filter manager - " + "the bottom buttons group in right panel.\r\n" + "There are 3 possible modes: and, or, ignored.\r\n", _labelStatusFilterCollection); defaultTooltips.SetTooltip(this, "Filter by Deck mode", "When filtering by Deck, Search result only shows\r\n" + "cards present in your current Deck.\r\n\r\n" + "Alternatively you can search cards present in any of your decks shown in `deck list` " + "tab. To do this\r\n" + "- open `deck list` tab (it's next to `main deck` / `sideboard` / `sample hand` tabs)\r\n" + "- if necessary narrow down the list of visible saved decks by using search bar " + "in `deck list` tab\r\n" + "- change selected value in `filter by deck` menu located in top right " + "of `deck list` panel.\r\n\r\n" + "Filtering by Deck can be enabled or disabled using Filter manager - " + "the bottom buttons group in right panel.\r\n" + "There are 3 possible modes: and, or, ignored.\r\n", _labelStatusFilterDeck); defaultTooltips.SetTooltip(this, null, "Filter by Legality status", _labelStatusFilterLegality); defaultTooltips.SetTooltip(this, "Search result Sort order", "Sort buttons are located over textual fields in Search result.\r\n" + "Click sort button to sort by field or change sort direction.\r\n" + "Shift + Click to add field to sort priorities,\r\n" + "Ctrl + Click to remove field from sort priorities.\r\n\r\n" + "When all explicit sort criteria are equal, cards are ordered " + "by relevance to search result, then by order in AllSets-x.json file.", _labelStatusSort); setFilterButtonTooltips(defaultTooltips, quickFilterTooltips); defaultTooltips.SetTooltip(this, "Visibility of Prohibiting buttons", "Use Prohibiting buttons to PROHIBIT checked values in a card\r\n" + "I guess you will not often need it so by default those buttons are hidden.", _buttonShowProhibit); defaultTooltips.SetTooltip(this, "Mana Ability filter LEFT row mode", "- mode: PROHIBIT UNCHECKED values\r\n" + "+ mode: REQUIRE ANY checked value", _buttonExcludeManaAbility); defaultTooltips.SetTooltip(this, "Mana Cost filter LEFT row mode", "- mode: PROHIBIT UNCHECKED values\r\n" + "+ mode: REQUIRE ANY checked value", _buttonExcludeManaCost); defaultTooltips.SetTooltip(this, () => { if (!_searchSubsystem.IsApplied) { return("Search bar: receiving user input"); } string errorMessage = _searchSubsystem.SearchResult?.ParseErrorMessage; if (errorMessage != null) { return("Search bar: Syntax error"); } return("Search bar"); }, () => { if (!_searchSubsystem.IsApplied) { return((_uiConfigRepository.Config.AutoApplySearchBar ? "Press ENTER or wait 1 second to apply" : "Press ENTER to apply") + "\r\n\r\n" + "Auto-apply after 1 second can be turned on / off\r\n" + "from Advanced Settings menu in window title"); } string errorMessage = _searchSubsystem.SearchResult?.ParseErrorMessage; if (errorMessage != null) { return(errorMessage); } return ("Narrows down the list of cards below based on a query you type. Example query:\r\n" + "TextEn: \"counter target spell\"\r\n\r\n" + "Ctrl+SPACE to get intellisense\r\n" + "Enter to apply\r\n" + "Ctrl+Backspace to delete one word\r\n" + "F1 to learn search bar query syntax\r\n\r\n" + "Ctrl+F to focus search bar\r\n" + "Middle mouse click to clear"); }, _searchBar, _searchBar.Input); defaultTooltips.SetTooltip(this, "Search query examples", "Opens menu with search query examples.\r\n" + "Same menu is opened by pressing F1.", _popupSearchExamples); defaultTooltips.SetTooltip(this, "Filter by Legality", "Select format\r\n\r\n" + "Middle mouse click to reset filter by legality", _dropdownLegality, _panelIconLegality); defaultTooltips.SetTooltip(this, "Filter by Legality", "Show cards LEGAL in selected format\r\n\r\n" + "Middle mouse click to reset filter by legality", _buttonLegalityAllowLegal); defaultTooltips.SetTooltip(this, "Filter by Legality", "Show cards RESTRICTED in selected format\r\n\r\n" + "Middle mouse click to reset filter by legality", _buttonLegalityAllowRestricted); defaultTooltips.SetTooltip(this, "Filter by Legality", "Show cards BANNED in selected format\r\n\r\n" + "Middle mouse click to reset filter by legality", _buttonLegalityAllowBanned); defaultTooltips.SetTooltip(this, "Filter by Legality", "Show cards which will SOON BECOME LEGAL in selected format", _buttonLegalityAllowFuture); defaultTooltips.SetTooltip(this, "Show duplicates", "Card duplicates have the same name and by rules\r\n" + "they are considered to be the same card.\r\n\r\n" + "Some cards are released in multiple Sets. Also in most Sets\r\n" + "Basic lands are released in multiple variants.", _buttonShowDuplicates); defaultTooltips.SetTooltip(this, null, "Deck panel visibility", _buttonHideDeck); const string hideScrollText = "Click to toggle scrollbar visibility"; defaultTooltips.SetTooltip(this, null, hideScrollText, _buttonShowScrollCards); defaultTooltips.SetTooltip(this, null, hideScrollText, _buttonShowScrollDeck); defaultTooltips.SetTooltip(this, null, "Deck panel scroll position", _labelStatusScrollDeck); defaultTooltips.SetTooltip(this, null, "Search result scroll position", _labelStatusScrollCards); defaultTooltips.SetTooltip(this, "Partial cards visibility", "Depending on window size displayed cards may lack some horizontal or vertical " + "space at window borders.\r\n\r\n" + "Enable partial cards to display more cards.\r\n" + "Disable partial cards to completely display card image and text whenever possible.", _buttonShowPartialCards); defaultTooltips.SetTooltip(this, null, "Card text visibility", _buttonShowText); defaultTooltips.SetTooltip(this, "Reset all filters", "Resets all search / filter controls to their default state " + "in order to begin new search from scratch.", _buttonResetFilters); defaultTooltips.SetTooltip(this, _countInputSubsystem.GetTooltipTitle, _countInputSubsystem.GetTooltipText, _countInputSubsystem.InputControl); defaultTooltips.SetCustomTooltip(_tooltipViewCards); defaultTooltips.SetCustomTooltip(_tooltipViewDeck); }
private void setupTooltips() { TooltipController.SetTooltip(this, "Undo: Ctrl+Z, Alt+Left", "Click to undo your last action", _buttonUndo); TooltipController.SetTooltip(this, "Redo: Ctrl+Y, Alt+Right", "Click to repeat the action cancelled with undo", _buttonRedo); TooltipController.SetTooltip(this, "Deck statistics", "Opens a Pivot report window. Use it to view \r\n" + "mana curve, price breakdown, or create \r\n" + "a custom report by moving field captions between\r\n" + "Row, Column and Summary areas of grid.", _buttonStat); TooltipController.SetTooltip(this, "Print deck: Ctrl+P", "The print buttons doesn't actually print, instead\r\n" + "it creates images of cards by groups of 8\r\n" + "that can be printed on A4 paper.", _buttonPrint); TooltipController.SetTooltip(this, "Clear deck", "Use it to start creating a new deck from scratch", _buttonClear); TooltipController.SetTooltip(this, "Enable / disable tooltips", "Tooltips are helpful but also annoying.\r\n" + "Uncheck this button to disable tooltips.\r\n" + "\r\n" + "Tooltips on card text have selectable text. " + "They can be used to select a part of a long text not fitting into the field area.\r\n" + "\r\n" + "Hold Alt key to temporarily disable / enable tooltips.\r\n" + "\r\n" + "When selecting text in a small field disabling tooltip by holding Alt key helps avoid distraction from tooltips.\r\n" + "\r\n" + "Temporarily enabling tooltip by holding Alt key helps to see one particular tooltip for a very large " + "text field, e.g. some long Rulings, without enabling tooltips in general.", _buttonTooltips); TooltipController.SetTooltip(this, "Show / hide filter panels", "filter panels are located on top and right edges of the window.", _buttonFilterPanels); TooltipController.SetTooltip(this, "Update", "Shows a window where you can\r\n" + " * Check for a new version of Mtgdb.Gui\r\n" + " * Download the most recent cards database from Mtgjson.com\r\n" + " * Download card images\r\n" + " * Download artworks", _buttonDownload); TooltipController.SetTooltip(this, "Advanced settings", "Opens configuration file.\r\n" + "Use it to tell the program where to find your custom card images or tweak some other settings.\r\n" + "\r\n" + "Configuration file is opened by whatever application you have associated with *.xml files. " + "If it's Internet Explorer, you need to assign *.xml extension to a text editor instead, " + "because Internet Explorer only displays the file without allowing to edit." + "I recommend using an editor with XML syntax highlighting e.g. Notepad++.\r\n" + "\r\n" + "To apply your changes save the modified configuration file and restart the program.", _buttonConfig ); TooltipController.SetTooltip(this, "Open new window", "You can drag-n-drop Cards and Tabs between windows.", _buttonOpenWindow); var tabHeadersTooltip = new TabHeadersTooltip(_tabs, this); tabHeadersTooltip.SubscribeToEvents(); TooltipController.SetCustomTooltip(tabHeadersTooltip); Load += loadTooltips; Closing += closeTooltips; }
private IEnumerator DelayTooltipOpen(MPEventSystem eventSystem, PointerEventData eventData) { yield return(new WaitForSeconds(delayInSeconds)); TooltipController.SetTooltip(eventSystem, this, eventData.position); }