Skip to content

Commit bf4544f

Browse files
committed
Disassembler Widget greyed out with tooltip when DynaRec is not enabled
1 parent ace3fcb commit bf4544f

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

src/gui/gui.cc

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ static void drop_callback(GLFWwindow* window, int count, const char** paths) {
112112
s_this->magicOpen(paths[0]);
113113
}
114114

115+
static void ShowHelpMarker(const char* desc) {
116+
ImGui::SameLine();
117+
ImGui::TextDisabled("(?)");
118+
if (ImGui::IsItemHovered()) {
119+
ImGui::BeginTooltip();
120+
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
121+
ImGui::TextUnformatted(desc);
122+
ImGui::PopTextWrapPos();
123+
ImGui::EndTooltip();
124+
}
125+
}
126+
115127
void LoadImguiBindings(lua_State* lState);
116128

117129
ImFont* PCSX::GUI::loadFont(const PCSX::u8string& name, int size, ImGuiIO& io, const ImWchar* ranges, bool combine) {
@@ -867,6 +879,9 @@ void PCSX::GUI::endFrame() {
867879
ImGui::MenuItem(_("Show DynaRec Disassembly"), nullptr, &m_disassembly.m_show);
868880
} else {
869881
ImGui::MenuItem(_("Show DynaRec Disassembly"), nullptr, false, false);
882+
ShowHelpMarker(
883+
_(R"(DynaRec Disassembler is not available in Interpreted CPU mode. Try enabling [Dynarec CPU]
884+
in Configuration->Emulation, restart PCSX-Redux, then try again.)"));
870885
}
871886
ImGui::MenuItem(_("Show Breakpoints"), nullptr, &m_breakpoints.m_show);
872887
ImGui::MenuItem(_("Show Callstacks"), nullptr, &m_callstacks.m_show);
@@ -1066,7 +1081,7 @@ void PCSX::GUI::endFrame() {
10661081
}
10671082

10681083
if (m_disassembly.m_show && PCSX::g_emulator->m_psxCpu->isDynarec()) {
1069-
m_disassembly.draw(this, _("DynaRec Disassembler"));
1084+
m_disassembly.draw(this, _("DynaRec Disassembler"));
10701085
}
10711086

10721087
if (m_breakpoints.m_show) {
@@ -1194,18 +1209,6 @@ void PCSX::GUI::endFrame() {
11941209
FrameMark
11951210
}
11961211

1197-
static void ShowHelpMarker(const char* desc) {
1198-
ImGui::SameLine();
1199-
ImGui::TextDisabled("(?)");
1200-
if (ImGui::IsItemHovered()) {
1201-
ImGui::BeginTooltip();
1202-
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
1203-
ImGui::TextUnformatted(desc);
1204-
ImGui::PopTextWrapPos();
1205-
ImGui::EndTooltip();
1206-
}
1207-
}
1208-
12091212
bool PCSX::GUI::configure() {
12101213
bool changed = false;
12111214
bool selectBiosDialog = false;

0 commit comments

Comments
 (0)