ConfigObject.java 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /*
  2. * This file is licensed under the MIT License, part of Roughly Enough Items.
  3. * Copyright (c) 2018, 2019, 2020 shedaniel
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6. * of this software and associated documentation files (the "Software"), to deal
  7. * in the Software without restriction, including without limitation the rights
  8. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. * copies of the Software, and to permit persons to whom the Software is
  10. * furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in all
  13. * copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21. * SOFTWARE.
  22. */
  23. package me.shedaniel.rei.api;
  24. import me.shedaniel.clothconfig2.api.ModifierKeyCode;
  25. import me.shedaniel.rei.gui.config.*;
  26. import me.shedaniel.rei.impl.ConfigManagerImpl;
  27. import me.shedaniel.rei.impl.filtering.FilteringRule;
  28. import net.fabricmc.api.EnvType;
  29. import net.fabricmc.api.Environment;
  30. import org.jetbrains.annotations.ApiStatus;
  31. import java.util.List;
  32. @Environment(EnvType.CLIENT)
  33. public interface ConfigObject {
  34. /**
  35. * @return the api instance of {@link me.shedaniel.rei.impl.ConfigObjectImpl}
  36. */
  37. static ConfigObject getInstance() {
  38. return ((ConfigManagerImpl) ConfigManager.getInstance()).getConfig();
  39. }
  40. boolean isOverlayVisible();
  41. void setOverlayVisible(boolean overlayVisible);
  42. boolean isCheating();
  43. void setCheating(boolean cheating);
  44. EntryPanelOrdering getItemListOrdering();
  45. boolean isItemListAscending();
  46. boolean isUsingDarkTheme();
  47. boolean isGrabbingItems();
  48. boolean isToastDisplayedOnCopyIdentifier();
  49. boolean doesRenderEntryEnchantmentGlint();
  50. boolean isEntryListWidgetScrolled();
  51. boolean shouldAppendModNames();
  52. RecipeScreenType getRecipeScreenType();
  53. void setRecipeScreenType(RecipeScreenType recipeScreenType);
  54. boolean isLoadingDefaultPlugin();
  55. SearchFieldLocation getSearchFieldLocation();
  56. default boolean isLeftHandSidePanel() {
  57. return getDisplayPanelLocation() == DisplayPanelLocation.LEFT;
  58. }
  59. DisplayPanelLocation getDisplayPanelLocation();
  60. boolean isCraftableFilterEnabled();
  61. String getGamemodeCommand();
  62. String getGiveCommand();
  63. String getWeatherCommand();
  64. int getMaxRecipePerPage();
  65. boolean doesShowUtilsButtons();
  66. boolean doesDisableRecipeBook();
  67. boolean doesFixTabCloseContainer();
  68. boolean areClickableRecipeArrowsEnabled();
  69. RecipeBorderType getRecipeBorderType();
  70. boolean doesVillagerScreenHavePermanentScrollBar();
  71. boolean doesRegisterRecipesInAnotherThread();
  72. boolean doesSnapToRows();
  73. boolean isFavoritesEnabled();
  74. boolean doDisplayFavoritesTooltip();
  75. @Deprecated
  76. @ApiStatus.ScheduledForRemoval
  77. default boolean doDisplayFavoritesOnTheLeft() {
  78. return true;
  79. }
  80. boolean doesFastEntryRendering();
  81. boolean doDebugRenderTimeRequired();
  82. boolean doSearchFavorites();
  83. ModifierKeyCode getFavoriteKeyCode();
  84. ModifierKeyCode getRecipeKeybind();
  85. ModifierKeyCode getUsageKeybind();
  86. ModifierKeyCode getHideKeybind();
  87. ModifierKeyCode getPreviousPageKeybind();
  88. ModifierKeyCode getNextPageKeybind();
  89. ModifierKeyCode getFocusSearchFieldKeybind();
  90. ModifierKeyCode getCopyRecipeIdentifierKeybind();
  91. ModifierKeyCode getExportImageKeybind();
  92. double getEntrySize();
  93. boolean isUsingCompactTabs();
  94. boolean isLowerConfigButton();
  95. List<EntryStack> getFavorites();
  96. List<EntryStack> getFilteredStacks();
  97. List<FilteringRule<?>> getFilteringRules();
  98. @ApiStatus.Experimental
  99. boolean shouldAsyncSearch();
  100. @ApiStatus.Experimental
  101. int getNumberAsyncSearch();
  102. @ApiStatus.Experimental
  103. boolean doDebugSearchTimeRequired();
  104. @ApiStatus.Experimental
  105. boolean isSubsetsEnabled();
  106. boolean shouldResizeDynamically();
  107. }