mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
overlay: clarify subscreen types (#469)
## Link to GitHub Issue, if one exists #345 ## Description of change In the main menu (Esc key), instead of just saying `Show subscreen`, detect game and say `Show TDJ Subscreen` `Show LDJ LED Ticker` etc. For the LED ticker window, show the title bar by default, and add an option to hide it back. This is to help with cases where people get stuck with being in LDJ mode when they meant to turn on TDJ. ## Testing Tested all configurations (IIDX LDJ/TDJ, SDVX UFC, DRS)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -679,6 +679,16 @@ static const std::vector<OptionDefinition> 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",
|
||||
|
||||
@@ -71,6 +71,7 @@ namespace launcher {
|
||||
spice2x_IIDXLEDFontSize,
|
||||
spice2x_IIDXLEDColor,
|
||||
spice2x_IIDXLEDPos,
|
||||
IIDXLEDBorderless,
|
||||
LoadSoundVoltexModule,
|
||||
SDVXForce720p,
|
||||
SDVXPrinterEmulation,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -10,12 +10,13 @@ namespace overlay::windows {
|
||||
uint32_t IIDX_SEGMENT_FONT_SIZE = 64;
|
||||
std::optional<uint32_t> 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<char, std::pair<char, char>> 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);
|
||||
|
||||
@@ -8,12 +8,14 @@ namespace overlay::windows {
|
||||
extern uint32_t IIDX_SEGMENT_FONT_SIZE;
|
||||
extern std::optional<uint32_t> 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);
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user