mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 05:43:42 -07:00
BTN_CUSTOM_QUERYVIEW
This commit is contained in:
parent
1109222d2b
commit
f48647986b
3 changed files with 33 additions and 7 deletions
|
@ -1584,10 +1584,6 @@ void SohInputEditorWindow::DrawLinkTab() {
|
||||||
DrawStickSection(portIndex, Ship::RIGHT, 1, CHIP_COLOR_N64_YELLOW);
|
DrawStickSection(portIndex, Ship::RIGHT, 1, CHIP_COLOR_N64_YELLOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::CollapsingHeader("A11y")) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui::CollapsingHeader("Rumble")) {
|
if (ImGui::CollapsingHeader("Rumble")) {
|
||||||
DrawRumbleSection(portIndex);
|
DrawRumbleSection(portIndex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/speechsynthesizer/SpeechSynthesizer.h"
|
#include "soh/Enhancements/speechsynthesizer/SpeechSynthesizer.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <Json.h>
|
#include <Json.h>
|
||||||
|
@ -11,6 +10,8 @@
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
#include "message_data_static.h"
|
#include "message_data_static.h"
|
||||||
#include "overlays/gamestates/ovl_file_choose/file_choose.h"
|
#include "overlays/gamestates/ovl_file_choose/file_choose.h"
|
||||||
|
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
|
||||||
|
#include "soh/ActorDB.h"
|
||||||
#include "soh/Enhancements/boss-rush/BossRush.h"
|
#include "soh/Enhancements/boss-rush/BossRush.h"
|
||||||
#include "soh/resource/type/SohResourceType.h"
|
#include "soh/resource/type/SohResourceType.h"
|
||||||
|
|
||||||
|
@ -176,6 +177,37 @@ void RegisterOnInterfaceUpdateHook() {
|
||||||
if (!GameInteractor::IsSaveLoaded(true))
|
if (!GameInteractor::IsSaveLoaded(true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (CHECK_BTN_ALL(gPlayState->state.input->press.button, BTN_CUSTOM_QUERYVIEW)) {
|
||||||
|
int minDist = 1000000;
|
||||||
|
Actor* readOut = NULL;
|
||||||
|
Player* player = GET_PLAYER(gPlayState);
|
||||||
|
if (player != NULL) {
|
||||||
|
for (int i = 0; i < ACTORCAT_MAX; i++) {
|
||||||
|
if (i == ACTORCAT_PLAYER)
|
||||||
|
continue;
|
||||||
|
for (Actor* actor = gPlayState->actorCtx.actorLists[i].head; actor != NULL; actor = actor->next) {
|
||||||
|
if (actor->id == ACTOR_EN_ELF && actor->params == FAIRY_NAVI)
|
||||||
|
continue;
|
||||||
|
u16 reverseYaw = (actor->yawTowardsPlayer + 0x8000) - player->actor.world.rot.y;
|
||||||
|
if ((reverseYaw < 0x2000 || reverseYaw > 0xE000) && actor->xyzDistToPlayerSq < minDist) {
|
||||||
|
readOut = actor;
|
||||||
|
minDist = actor->xyzDistToPlayerSq;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (readOut != NULL) {
|
||||||
|
auto entry = ActorDB::Instance->RetrieveEntry(readOut->id);
|
||||||
|
if (entry.name.empty()) {
|
||||||
|
char ttsAnnounceBuf[8];
|
||||||
|
int annouceBuf = snprintf(ttsAnnounceBuf, sizeof(ttsAnnounceBuf), "%d", readOut->id);
|
||||||
|
SpeechSynthesizer::Instance->Speak(ttsAnnounceBuf, "en-US");
|
||||||
|
} else {
|
||||||
|
SpeechSynthesizer::Instance->Speak(entry.name.c_str(), "en-US");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int16_t lostHealth = 0;
|
static int16_t lostHealth = 0;
|
||||||
static int16_t prevHealth = 0;
|
static int16_t prevHealth = 0;
|
||||||
|
|
||||||
|
|
|
@ -1421,13 +1421,11 @@ extern "C" void Graph_StartFrame() {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if defined(_WIN32) || defined(__APPLE__)
|
|
||||||
case KbScancode::LUS_KB_F9: {
|
case KbScancode::LUS_KB_F9: {
|
||||||
// Toggle TTS
|
// Toggle TTS
|
||||||
CVarSetInteger(CVAR_SETTING("A11yTTS"), !CVarGetInteger(CVAR_SETTING("A11yTTS"), 0));
|
CVarSetInteger(CVAR_SETTING("A11yTTS"), !CVarGetInteger(CVAR_SETTING("A11yTTS"), 0));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
case KbScancode::LUS_KB_TAB: {
|
case KbScancode::LUS_KB_TAB: {
|
||||||
CVarSetInteger(CVAR_SETTING("AltAssets"), !CVarGetInteger(CVAR_SETTING("AltAssets"), 0));
|
CVarSetInteger(CVAR_SETTING("AltAssets"), !CVarGetInteger(CVAR_SETTING("AltAssets"), 0));
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue