diff --git a/src/spice2x/launcher/launcher.cpp b/src/spice2x/launcher/launcher.cpp index b9ada7d..521decb 100644 --- a/src/spice2x/launcher/launcher.cpp +++ b/src/spice2x/launcher/launcher.cpp @@ -523,6 +523,9 @@ int main_implementation(int argc, char *argv[]) { overlay::windows::IIDX_SEGMENT_LOCATION = options[launcher::Options::spice2x_IIDXLEDPos].value_text(); } + if (options[launcher::Options::IIDXLEDBorderless].value_bool()) { + overlay::windows::IIDX_SEGMENT_BORDERLESS = true; + } if (options[launcher::Options::spice2x_IIDXNoESpec].value_bool()) { games::iidx::DISABLE_ESPEC_IO = true; } diff --git a/src/spice2x/launcher/options.cpp b/src/spice2x/launcher/options.cpp index 5bee4ac..bbaa572 100644 --- a/src/spice2x/launcher/options.cpp +++ b/src/spice2x/launcher/options.cpp @@ -679,6 +679,16 @@ static const std::vector OPTION_DEFINITIONS = { {"bottomright", ""}, }, }, + { + // IIDXLEDBorderless + .title = "IIDX LED Ticker Borderless", + .name = "iidxledborderless", + .aliases= "iidxledborderless", + .desc = "Make LED ticker overlay window borderless (remove window decoration)", + .type = OptionType::Bool, + .game_name = "Beatmania IIDX", + .category = "Overlay", + }, { .title = "Force Load Sound Voltex Module", .name = "sdvx", diff --git a/src/spice2x/launcher/options.h b/src/spice2x/launcher/options.h index 2db19a3..26d130b 100644 --- a/src/spice2x/launcher/options.h +++ b/src/spice2x/launcher/options.h @@ -71,6 +71,7 @@ namespace launcher { spice2x_IIDXLEDFontSize, spice2x_IIDXLEDColor, spice2x_IIDXLEDPos, + IIDXLEDBorderless, LoadSoundVoltexModule, SDVXForce720p, SDVXPrinterEmulation, diff --git a/src/spice2x/overlay/windows/exitprompt.cpp b/src/spice2x/overlay/windows/exitprompt.cpp index 399af63..71977bf 100644 --- a/src/spice2x/overlay/windows/exitprompt.cpp +++ b/src/spice2x/overlay/windows/exitprompt.cpp @@ -1,6 +1,8 @@ #include "exitprompt.h" +#include "avs/game.h" #include "misc/eamuse.h" #include "util/logging.h" +#include "games/iidx/iidx.h" namespace overlay::windows { @@ -55,7 +57,21 @@ namespace overlay::windows { } ImGui::Spacing(); build_button(this->overlay->window_config, "Show Config", size, NextItem::NEW_LINE, false); - build_button(this->overlay->window_sub, "Show Subscreen", size, NextItem::NEW_LINE, false); + + std::string sub = "Show Subscreen"; + if (avs::game::is_model("LDJ")) { + if (games::iidx::TDJ_MODE) { + sub = "Show TDJ Subscreen"; + } else { + sub = "Show LDJ LED Ticker"; + } + } else if (avs::game::is_model("KFC")) { + sub = "Show Valkyrie Subscreen"; + } else if (avs::game::is_model("REC")) { + sub = "Show DRS Dance Floor"; + } + + build_button(this->overlay->window_sub, sub, size, NextItem::NEW_LINE, false); ImGui::TextDisabled("Graphics"); build_button(this->overlay->window_camera, "Camera control", size, NextItem::NEW_LINE); diff --git a/src/spice2x/overlay/windows/iidx_seg.cpp b/src/spice2x/overlay/windows/iidx_seg.cpp index 22163b0..0cf37e1 100644 --- a/src/spice2x/overlay/windows/iidx_seg.cpp +++ b/src/spice2x/overlay/windows/iidx_seg.cpp @@ -10,12 +10,13 @@ namespace overlay::windows { uint32_t IIDX_SEGMENT_FONT_SIZE = 64; std::optional IIDX_SEGMENT_FONT_COLOR = std::nullopt; std::string IIDX_SEGMENT_LOCATION = "bottom"; + bool IIDX_SEGMENT_BORDERLESS = false; static const size_t TICKER_SIZE = 9; static const ImVec4 DARK_GRAY(0.1f, 0.1f, 0.1f, 1.f); static const ImVec4 RED(1.f, 0.f, 0.f, 1.f); - static const int PADDING_Y = 8; - static const int PADDING_X = 4; + static const float PADDING_Y = 8.f; + static const float PADDING_X = 4.f; static const std::map> CHARMAP = {\ // period - add a space afterwards (game sends 'm' for period) @@ -31,16 +32,18 @@ namespace overlay::windows { log_fatal("iidx_seg", "DSEG_FONT is null"); } - this->title = "IIDX LED Segment Display"; + this->title = "IIDX LDJ LED Ticker"; this->toggle_button = games::OverlayButtons::ToggleSubScreen; this->remove_window_padding = true; this->size_max = ImVec2(ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y); - this->flags = ImGuiWindowFlags_NoTitleBar - | ImGuiWindowFlags_NoScrollbar + this->flags = ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoNavFocus | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoDocking; + if (IIDX_SEGMENT_BORDERLESS) { + this->flags |= ImGuiWindowFlags_NoTitleBar; + } if (IIDX_SEGMENT_FONT_COLOR.has_value()) { const auto rgb = IIDX_SEGMENT_FONT_COLOR.value(); @@ -51,13 +54,22 @@ namespace overlay::windows { } } + float IIDXSegmentDisplay::get_title_bar_height() { + // make sure you don't call this within PushFont/PopFont block + // since text line height calculation is dependent on current font size + return ImGui::GetTextLineHeight() + ImGui::GetStyle().FramePadding.y * 2.0f; + } + void IIDXSegmentDisplay::calculate_initial_window() { // ImGui::CalcTextSize doesn't seem to work here, so manually calculate ImGui::PushFont(DSEG_FONT); this->init_size = ImGui::CalcTextSize("~.~.~.~.~.~.~.~.~."); + ImGui::PopFont(); this->init_size.x += PADDING_X * 2; this->init_size.y += PADDING_Y * 2; - ImGui::PopFont(); + if (!IIDX_SEGMENT_BORDERLESS) { + this->init_size.y += get_title_bar_height(); + } // initial horizontal position if (IIDX_SEGMENT_LOCATION.find("left") != std::string::npos) { @@ -127,9 +139,13 @@ namespace overlay::windows { } void IIDXSegmentDisplay::draw_ticker(char *ticker_string) { - ImGui::PushFont(DSEG_FONT); + float pad_y = PADDING_Y; + if (!IIDX_SEGMENT_BORDERLESS) { + pad_y += get_title_bar_height(); + } + const auto pos = ImVec2(PADDING_X, pad_y); - const auto pos = ImVec2(PADDING_X, PADDING_Y); + ImGui::PushFont(DSEG_FONT); // to imitate LED "off" ImGui::SetCursorPos(pos); diff --git a/src/spice2x/overlay/windows/iidx_seg.h b/src/spice2x/overlay/windows/iidx_seg.h index dcccf9b..97b95b8 100644 --- a/src/spice2x/overlay/windows/iidx_seg.h +++ b/src/spice2x/overlay/windows/iidx_seg.h @@ -8,12 +8,14 @@ namespace overlay::windows { extern uint32_t IIDX_SEGMENT_FONT_SIZE; extern std::optional IIDX_SEGMENT_FONT_COLOR; extern std::string IIDX_SEGMENT_LOCATION; + extern bool IIDX_SEGMENT_BORDERLESS; class IIDXSegmentDisplay : public Window { public: IIDXSegmentDisplay(SpiceOverlay *overlay); void calculate_initial_window() override; void build_content() override; + float get_title_bar_height(); private: ImVec4 color; void draw_ticker(char *ticker_string); diff --git a/src/spice2x/overlay/windows/iidx_sub.cpp b/src/spice2x/overlay/windows/iidx_sub.cpp index 8c907e8..2394941 100644 --- a/src/spice2x/overlay/windows/iidx_sub.cpp +++ b/src/spice2x/overlay/windows/iidx_sub.cpp @@ -9,7 +9,7 @@ namespace overlay::windows { IIDXSubScreen::IIDXSubScreen(SpiceOverlay *overlay) : GenericSubScreen(overlay) { - this->title = "IIDX Sub Screen"; + this->title = "IIDX TDJ Subscreen"; if (GRAPHICS_IIDX_WSUB) { this->disabled_message = diff --git a/src/spice2x/overlay/windows/sdvx_sub.cpp b/src/spice2x/overlay/windows/sdvx_sub.cpp index 9e128bc..909a0c8 100644 --- a/src/spice2x/overlay/windows/sdvx_sub.cpp +++ b/src/spice2x/overlay/windows/sdvx_sub.cpp @@ -8,7 +8,7 @@ namespace overlay::windows { SDVXSubScreen::SDVXSubScreen(SpiceOverlay *overlay) : GenericSubScreen(overlay) { - this->title = "SDVX Sub Screen"; + this->title = "SDVX Subscreen"; bool isValkyrieCabinetMode = avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H'; if (!isValkyrieCabinetMode) {