diff --git a/Source/DiabloUI/ui_flags.hpp b/Source/DiabloUI/ui_flags.hpp new file mode 100644 index 000000000..69c49fb04 --- /dev/null +++ b/Source/DiabloUI/ui_flags.hpp @@ -0,0 +1,51 @@ +#pragma once + +#include "utils/enum_traits.h" + +namespace devilution { + +enum class UiFlags { + // clang-format off + None = 0, + + FontSize12 = 1 << 0, + FontSize24 = 1 << 1, + FontSize30 = 1 << 2, + FontSize42 = 1 << 3, + FontSize46 = 1 << 4, + FontSizeDialog = 1 << 5, + + ColorUiGold = 1 << 6, + ColorUiSilver = 1 << 7, + ColorUiGoldDark = 1 << 8, + ColorUiSilverDark = 1 << 9, + ColorDialogWhite = 1 << 10, + ColorDialogYellow = 1 << 11, + ColorGold = 1 << 12, + ColorBlack = 1 << 13, + ColorWhite = 1 << 14, + ColorWhitegold = 1 << 15, + ColorRed = 1 << 16, + ColorBlue = 1 << 17, + ColorButtonface = 1 << 18, + ColorButtonpushed = 1 << 19, + + AlignCenter = 1 << 20, + AlignRight = 1 << 21, + VerticalCenter = 1 << 22, + + KerningFitSpacing = 1 << 23, + + ElementDisabled = 1 << 24, + ElementHidden = 1 << 25, + + PentaCursor = 1 << 26, + TextCursor = 1 << 27, + + /** @brief Ensures that the if current element is active that the next element is also visible. */ + NeedsNextElement = 1 << 28, + // clang-format on +}; +use_enum_as_flags(UiFlags); + +} // namespace devilution diff --git a/Source/DiabloUI/ui_item.h b/Source/DiabloUI/ui_item.h index daea7241a..06ddf88af 100644 --- a/Source/DiabloUI/ui_item.h +++ b/Source/DiabloUI/ui_item.h @@ -6,6 +6,7 @@ #include #include "DiabloUI/art.h" +#include "DiabloUI/ui_flags.hpp" #include "utils/enum_traits.h" #include "utils/stubs.h" @@ -22,58 +23,6 @@ enum class UiType { Edit, }; -enum class UiFlags { - // clang-format off - None = 0, - - FontSize12 = 1 << 0, - FontSize24 = 1 << 1, - FontSize30 = 1 << 2, - FontSize42 = 1 << 3, - FontSize46 = 1 << 4, - FontSizeDialog = 1 << 5, - - ColorUiGold = 1 << 6, - ColorUiSilver = 1 << 7, - ColorUiGoldDark = 1 << 8, - ColorUiSilverDark = 1 << 9, - ColorDialogWhite = 1 << 10, - ColorDialogYellow = 1 << 11, - ColorGold = 1 << 12, - ColorBlack = 1 << 13, - ColorWhite = 1 << 14, - ColorWhitegold = 1 << 15, - ColorRed = 1 << 16, - ColorBlue = 1 << 17, - ColorButtonface = 1 << 18, - ColorButtonpushed = 1 << 19, - - AlignCenter = 1 << 20, - AlignRight = 1 << 21, - VerticalCenter = 1 << 22, - - KerningFitSpacing = 1 << 23, - - ElementDisabled = 1 << 24, - ElementHidden = 1 << 25, - - PentaCursor = 1 << 26, - TextCursor = 1 << 27, - - /** @brief Ensures that the if current element is active that the next element is also visible. */ - NeedsNextElement = 1 << 28, - // clang-format on -}; -use_enum_as_flags(UiFlags); - -enum class UiPanels { - Main, - Quest, - Character, - Spell, - Inventory, -}; - class UiItemBase { public: UiItemBase(UiType type, SDL_Rect rect, UiFlags flags) diff --git a/Source/control.cpp b/Source/control.cpp index a16037486..3e1406c16 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -13,7 +13,6 @@ #include "DiabloUI/art.h" #include "DiabloUI/art_draw.h" -#include "DiabloUI/diabloui.h" #include "automap.h" #include "controls/keymapper.hpp" #include "cursor.h" diff --git a/Source/control.h b/Source/control.h index 59e02ed0f..d7fce07fb 100644 --- a/Source/control.h +++ b/Source/control.h @@ -7,10 +7,12 @@ #include +#include "DiabloUI/ui_flags.hpp" #include "engine.h" #include "engine/point.hpp" #include "engine/rectangle.hpp" #include "engine/render/text_render.hpp" +#include "panels/ui_panels.hpp" #include "spelldat.h" #include "spells.h" #include "utils/stdcompat/optional.hpp" diff --git a/Source/controls/modifier_hints.cpp b/Source/controls/modifier_hints.cpp index 15403a3b1..ca0a0d1df 100644 --- a/Source/controls/modifier_hints.cpp +++ b/Source/controls/modifier_hints.cpp @@ -2,6 +2,7 @@ #include +#include "DiabloUI/ui_flags.hpp" #include "control.h" #include "controls/controller.h" #include "controls/game_controls.h" diff --git a/Source/controls/plrctrls.cpp b/Source/controls/plrctrls.cpp index 6bfada540..8c8c7018a 100644 --- a/Source/controls/plrctrls.cpp +++ b/Source/controls/plrctrls.cpp @@ -20,6 +20,7 @@ #include "minitext.h" #include "missiles.h" #include "panels/spell_list.hpp" +#include "panels/ui_panels.hpp" #include "stores.h" #include "towners.h" #include "trigs.h" diff --git a/Source/controls/touch/renderers.cpp b/Source/controls/touch/renderers.cpp index 9f2119af9..d4eccaf08 100644 --- a/Source/controls/touch/renderers.cpp +++ b/Source/controls/touch/renderers.cpp @@ -9,6 +9,7 @@ #include "init.h" #include "inv.h" #include "minitext.h" +#include "panels/ui_panels.hpp" #include "stores.h" #include "towners.h" #include "utils/sdl_compat.h" diff --git a/Source/debug.cpp b/Source/debug.cpp index b17267c9b..e66d34967 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -8,6 +8,8 @@ #include +#include + #include "debug.h" #include "automap.h" @@ -25,6 +27,7 @@ #include "spells.h" #include "towners.h" #include "utils/language.h" +#include "utils/log.hpp" namespace devilution { diff --git a/Source/engine/render/text_render.hpp b/Source/engine/render/text_render.hpp index 07c135662..6539b42f5 100644 --- a/Source/engine/render/text_render.hpp +++ b/Source/engine/render/text_render.hpp @@ -6,12 +6,13 @@ #pragma once #include +#include #include #include #include -#include "DiabloUI/ui_item.h" +#include "DiabloUI/ui_flags.hpp" #include "engine.h" #include "engine/cel_sprite.hpp" #include "engine/rectangle.hpp" diff --git a/Source/error.cpp b/Source/error.cpp index 01a23c433..00149e577 100644 --- a/Source/error.cpp +++ b/Source/error.cpp @@ -8,6 +8,7 @@ #include "error.h" +#include "DiabloUI/ui_flags.hpp" #include "control.h" #include "engine/render/cel_render.hpp" #include "engine/render/text_render.hpp" diff --git a/Source/gmenu.cpp b/Source/gmenu.cpp index 95b85553b..4ecefda2e 100644 --- a/Source/gmenu.cpp +++ b/Source/gmenu.cpp @@ -5,6 +5,7 @@ */ #include "gmenu.h" +#include "DiabloUI/ui_flags.hpp" #include "control.h" #include "controls/axis_direction.h" #include "controls/controller_motion.h" diff --git a/Source/help.cpp b/Source/help.cpp index 0fa90598b..84258def1 100644 --- a/Source/help.cpp +++ b/Source/help.cpp @@ -6,6 +6,7 @@ #include #include +#include "DiabloUI/ui_flags.hpp" #include "control.h" #include "engine/render/text_render.hpp" #include "init.h" diff --git a/Source/inv.cpp b/Source/inv.cpp index fef7342d8..92f23ef71 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -8,6 +8,7 @@ #include #include +#include "DiabloUI/ui_flags.hpp" #include "controls/plrctrls.h" #include "cursor.h" #include "engine/cel_sprite.hpp" @@ -19,6 +20,7 @@ #include "inv_iterators.hpp" #include "minitext.h" #include "options.h" +#include "panels/ui_panels.hpp" #include "plrmsg.h" #include "stores.h" #include "town.h" diff --git a/Source/items.cpp b/Source/items.cpp index 48ca32abd..708494e2b 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -15,6 +15,7 @@ #include +#include "DiabloUI/ui_flags.hpp" #include "cursor.h" #include "doom.h" #include "dx.h" @@ -28,6 +29,7 @@ #include "lighting.h" #include "missiles.h" #include "options.h" +#include "panels/ui_panels.hpp" #include "player.h" #include "stores.h" #include "town.h" diff --git a/Source/items.h b/Source/items.h index 9087f309d..5a35db774 100644 --- a/Source/items.h +++ b/Source/items.h @@ -7,7 +7,7 @@ #include -#include "DiabloUI/ui_item.h" +#include "DiabloUI/ui_flags.hpp" #include "engine.h" #include "engine/animationinfo.h" #include "engine/point.hpp" diff --git a/Source/minitext.cpp b/Source/minitext.cpp index 1f3db295d..ecb4e3f20 100644 --- a/Source/minitext.cpp +++ b/Source/minitext.cpp @@ -6,6 +6,7 @@ #include #include +#include "DiabloUI/ui_flags.hpp" #include "control.h" #include "dx.h" #include "engine.h" diff --git a/Source/objects.cpp b/Source/objects.cpp index b3415871b..e8134807b 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -7,6 +7,7 @@ #include #include +#include "DiabloUI/ui_flags.hpp" #include "automap.h" #include "control.h" #include "cursor.h" diff --git a/Source/options.cpp b/Source/options.cpp index 8c2a4a2ee..666da9349 100644 --- a/Source/options.cpp +++ b/Source/options.cpp @@ -31,6 +31,7 @@ #include "qol/xpbar.h" #include "utils/file_util.h" #include "utils/language.h" +#include "utils/log.hpp" #include "utils/paths.h" #include "utils/utf8.hpp" diff --git a/Source/panels/charpanel.cpp b/Source/panels/charpanel.cpp index b312bc672..de30b284d 100644 --- a/Source/panels/charpanel.cpp +++ b/Source/panels/charpanel.cpp @@ -5,10 +5,10 @@ #include "DiabloUI/art.h" #include "DiabloUI/art_draw.h" - #include "control.h" #include "engine/render/cel_render.hpp" #include "engine/render/text_render.hpp" +#include "panels/ui_panels.hpp" #include "player.h" #include "utils/display.h" #include "utils/language.h" diff --git a/Source/panels/spell_book.cpp b/Source/panels/spell_book.cpp index a47003ecd..52c91be46 100644 --- a/Source/panels/spell_book.cpp +++ b/Source/panels/spell_book.cpp @@ -1,5 +1,7 @@ #include "panels/spell_book.hpp" +#include + #include "control.h" #include "engine/cel_sprite.hpp" #include "engine/load_cel.hpp" @@ -9,6 +11,7 @@ #include "init.h" #include "missiles.h" #include "panels/spell_icons.hpp" +#include "panels/ui_panels.hpp" #include "player.h" #include "spelldat.h" #include "utils/language.h" diff --git a/Source/panels/spell_list.cpp b/Source/panels/spell_list.cpp index 42289908d..37318ed6c 100644 --- a/Source/panels/spell_list.cpp +++ b/Source/panels/spell_list.cpp @@ -1,5 +1,7 @@ #include "panels/spell_list.hpp" +#include + #include "control.h" #include "controls/keymapper.hpp" #include "engine.h" diff --git a/Source/panels/ui_panels.hpp b/Source/panels/ui_panels.hpp new file mode 100644 index 000000000..3769ec77d --- /dev/null +++ b/Source/panels/ui_panels.hpp @@ -0,0 +1,13 @@ +#pragma once + +namespace devilution { + +enum class UiPanels { + Main, + Quest, + Character, + Spell, + Inventory, +}; + +} // namespace devilution diff --git a/Source/plrmsg.cpp b/Source/plrmsg.cpp index f622fa865..12ec7d5c1 100644 --- a/Source/plrmsg.cpp +++ b/Source/plrmsg.cpp @@ -7,6 +7,7 @@ #include +#include "DiabloUI/ui_flags.hpp" #include "control.h" #include "engine/render/text_render.hpp" #include "inv.h" diff --git a/Source/quests.cpp b/Source/quests.cpp index 523d5f6c8..a99d6bbc1 100644 --- a/Source/quests.cpp +++ b/Source/quests.cpp @@ -7,6 +7,7 @@ #include +#include "DiabloUI/ui_flags.hpp" #include "control.h" #include "cursor.h" #include "engine/load_file.hpp" @@ -19,6 +20,7 @@ #include "missiles.h" #include "monster.h" #include "options.h" +#include "panels/ui_panels.hpp" #include "stores.h" #include "towners.h" #include "trigs.h" diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index aad2487ea..ac0384fbf 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -4,6 +4,7 @@ * Implementation of functionality for rendering the dungeons, monsters and calling other render routines. */ +#include "DiabloUI/ui_flags.hpp" #include "automap.h" #include "controls/touch/renderers.h" #include "cursor.h" diff --git a/Source/stores.h b/Source/stores.h index 5c837e607..a1166224d 100644 --- a/Source/stores.h +++ b/Source/stores.h @@ -5,6 +5,7 @@ */ #pragma once +#include "DiabloUI/ui_flags.hpp" #include "control.h" #include "engine.h" #include "engine/cel_sprite.hpp" diff --git a/Source/utils/enum_traits.h b/Source/utils/enum_traits.h index aaa58722c..09f5541cb 100644 --- a/Source/utils/enum_traits.h +++ b/Source/utils/enum_traits.h @@ -6,6 +6,7 @@ #pragma once #include +#include namespace devilution { diff --git a/Source/utils/language.cpp b/Source/utils/language.cpp index 794a1a4cb..427f551d6 100644 --- a/Source/utils/language.cpp +++ b/Source/utils/language.cpp @@ -8,6 +8,7 @@ #include "engine/assets.hpp" #include "options.h" #include "utils/file_util.h" +#include "utils/log.hpp" #include "utils/paths.h" #include "utils/stdcompat/string_view.hpp"