mirror of
https://github.com/rrika/cdcEngineDXHR.git
synced 2024-11-26 23:10:20 +00:00
add subtitle UI
This commit is contained in:
parent
1240664fcf
commit
226bdd23c3
@ -270,8 +270,12 @@ void buildUI(dtp::SoundPlex *snd, std::string indent) {
|
||||
break;
|
||||
}
|
||||
|
||||
case dtp::SoundPlex::SoundPlexSelector_Envelope: // 6
|
||||
case dtp::SoundPlex::SoundPlexSelector_Envelope: { // 6
|
||||
auto *data = (dtp::SoundPlex**)snd->m_data;
|
||||
buildUI(*data, indent + " ");
|
||||
// TODO
|
||||
break;
|
||||
}
|
||||
|
||||
case dtp::SoundPlex::SoundPlexSelector_Selector: // 7
|
||||
break;
|
||||
|
@ -2,6 +2,9 @@
|
||||
#include "Sample.h"
|
||||
#include "SoundPlexStream.h"
|
||||
|
||||
// HACK
|
||||
extern uint32_t subtitleIndex;
|
||||
|
||||
namespace cdc {
|
||||
|
||||
SoundPlexStream::SoundPlexStream(
|
||||
@ -27,6 +30,8 @@ uint32_t SoundPlexStream::Init() {
|
||||
// TODO
|
||||
);
|
||||
|
||||
subtitleIndex = dtpStream->stringIndex12;
|
||||
|
||||
// HACK
|
||||
((MultiplexStreamImpl*)multiplexStream)->hackSample->Play();
|
||||
|
||||
|
@ -42,7 +42,12 @@ struct SoundPlex {
|
||||
const char *m_streamName;
|
||||
int8_t byte4; // TODO
|
||||
int8_t m_priorityStream;
|
||||
// TODO
|
||||
int8_t byte6;
|
||||
uint32_t dword8;
|
||||
uint32_t dwordC;
|
||||
int8_t byte10;
|
||||
int8_t byte11;
|
||||
uint16_t stringIndex12;
|
||||
};
|
||||
|
||||
struct Wave {
|
||||
|
@ -96,12 +96,14 @@
|
||||
#endif
|
||||
|
||||
cdc::MultiplexStream *neverAskedForThis = nullptr;
|
||||
uint32_t subtitleIndex = 0;
|
||||
|
||||
void howDoYouHandleAllOfThis() {
|
||||
if (!neverAskedForThis)
|
||||
neverAskedForThis = cdc::MultiplexStream::CreateSoundStream("vo\\eng\\det1\\adam_jensen\\sq02\\det1_sq02_dia_adam_006b", 0);
|
||||
|
||||
((cdc::MultiplexStreamImpl*)neverAskedForThis)->hackSample->Play();
|
||||
subtitleIndex = 7497;
|
||||
}
|
||||
|
||||
class ImGuiDrawable : public cdc::IRenderDrawable {
|
||||
@ -872,6 +874,26 @@ int spinnyCube(HWND window,
|
||||
ImGui::EndMainMenuBar();
|
||||
}
|
||||
|
||||
if (subtitleIndex) {
|
||||
ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMove;
|
||||
const float PAD = 30.0f;
|
||||
const ImGuiViewport* viewport = ImGui::GetMainViewport();
|
||||
ImVec2 work_pos = viewport->WorkPos; // Use work area to avoid menu-bar/task-bar, if any!
|
||||
ImVec2 work_size = viewport->WorkSize;
|
||||
ImVec2 window_pos, window_pos_pivot;
|
||||
window_pos.x = work_pos.x + work_size.x*0.5f;
|
||||
window_pos.y = work_pos.y + work_size.y - PAD;
|
||||
window_pos_pivot.x = 0.5f;
|
||||
window_pos_pivot.y = 1.0f;
|
||||
ImGui::SetNextWindowPos(window_pos, ImGuiCond_Always, window_pos_pivot);
|
||||
ImGui::SetNextWindowBgAlpha(0.35f); // Transparent background
|
||||
bool open = true;
|
||||
if (ImGui::Begin("subtitlebox", &open, window_flags)) {
|
||||
ImGui::Text("%s", localstr_get(subtitleIndex));
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
imGuiDrawable.lastMinuteAdditions = [&]() {
|
||||
if (showDrawablesWindow) {
|
||||
cdc::CommonScene *xscene = captures[selectedCapture].second;
|
||||
|
Loading…
Reference in New Issue
Block a user