Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions runtime/camera_stealth.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Gameplay > Keep crouch after camera (settings.h camera_keep_stealth): remember whether Link was crouched
// when opening the Camera rune and return to crouch idle instead of standing idle when Camera finishes normally.
// Patches in the Player AI selector and Camera::leave() (tools/patches.py _camera_enter_start,
// _camera_exit_finished, _camera_exit_active, _camera_leave) record entry, choose the exit state, and clear stale
// state on any non-normal Camera exit.
#include <stdbool.h>
#include <stdint.h>

#include "hle.h"
#include "settings.h"

static uint64_t g_camera_stealth_player;
static bool g_camera_stealth_crouched;

void rt_camera_stealth_enter(uint64_t player, int is_squat) {
g_camera_stealth_player = player;
g_camera_stealth_crouched = player != 0 && is_squat != 0;
}

int rt_camera_stealth_exit(uint64_t player) {
bool restore = g_settings.camera_keep_stealth && g_camera_stealth_crouched &&
player != 0 && player == g_camera_stealth_player;
g_camera_stealth_crouched = false;
g_camera_stealth_player = 0;
return restore ? 1 : 0;
}

void rt_camera_stealth_leave(void) {
g_camera_stealth_crouched = false;
g_camera_stealth_player = 0;
}

RT_ON_RESET(camera_stealth_reset) { rt_camera_stealth_leave(); }
2 changes: 1 addition & 1 deletion runtime/control_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static const Setting settings[] = {
B(god_mode), B(one_hit_kill), I(damage_taken, 25, 400, NULL), I(damage_dealt, 25, 400, NULL),
I(text_language, 0, 0, NULL), I(voice_language, 0, 0, NULL), B(save_backups), B(stick_cam_on), I(stick_cam_x, STICK_CAM_MIN, STICK_CAM_MAX, NULL),
I(stick_cam_y, STICK_CAM_MIN, STICK_CAM_MAX, NULL), B(toggle_zl), B(toggle_zr), I(menu_text_size, 80, 150, NULL),
B(auto_continue), B(menu_tip_seen),
B(auto_continue), B(menu_tip_seen), B(camera_keep_stealth),
};
#undef B
#undef I
Expand Down
2 changes: 2 additions & 0 deletions runtime/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ void settings_load(void) {
else if (!strcmp(key, "quick_drop")) g_settings.quick_drop = atoi(val) != 0;
else if (!strcmp(key, "quick_sort")) g_settings.quick_sort = atoi(val) != 0;
else if (!strcmp(key, "discord_rpc")) g_settings.discord_rpc = atoi(val) != 0;
else if (!strcmp(key, "camera_keep_stealth")) g_settings.camera_keep_stealth = atoi(val) != 0;
else if (!strcmp(key, "dpad_move")) g_settings.dpad_move = atoi(val) != 0;
else if (!strcmp(key, "menu_wrap")) g_settings.menu_wrap = atoi(val) != 0;
else if (!strcmp(key, "prompts_follow")) g_settings.prompts_follow = atoi(val) != 0;
Expand Down Expand Up @@ -948,6 +949,7 @@ bool settings_save_to(const char *path) {
int ts = g_settings.text_speed;
fprintf(f, "text_speed = %s\n", k_text_speed[ts >= 0 && ts < TEXT_SPEED_COUNT ? ts : TEXT_SPEED_NORMAL]);
fprintf(f, "menu_tip_seen = %d\n", g_settings.menu_tip_seen);
fprintf(f, "camera_keep_stealth = %d\n", g_settings.camera_keep_stealth);
bind_settings_save(f);
fclose(f);
return true;
Expand Down
1 change: 1 addition & 0 deletions runtime/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ typedef struct {
bool auto_continue; // Gameplay > Start at Continue: past the start screen into the latest save (hle/input.c)
int text_speed; // TEXT_SPEED_*: dialogue text appearance speed (Normal, Fast, Instant)
bool menu_tip_seen; // the start screen's one-time "how to open the menu" note was shown (first PLAY ever)
bool camera_keep_stealth; // Gameplay > Keep crouch after camera (runtime/camera_stealth.c)
} Settings;

#define RUMBLE_STRENGTH_MIN 10
Expand Down
5 changes: 5 additions & 0 deletions runtime/ui/game_options.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,11 @@ void build_items(void) {
#endif

// Gameplay
v.push_back(toggle(P_GAMEPLAY, "Keep crouch after camera",
"Return to crouching after closing the Camera rune if you were crouched when opening it.",
[](const Item &) { return (int)g_settings.camera_keep_stealth; },
[](const Item &, int x) { g_settings.camera_keep_stealth = x; }, 0));

v.push_back(toggle(P_GAMEPLAY, "Quick inventory sorting",
"Sort weapons, bows and shields in the quick selector. Requires game version 1.9.0.",
[](const Item &) { return (int)g_settings.quick_sort; },
Expand Down
3 changes: 3 additions & 0 deletions runtime/ui/i18n/de.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1261,3 +1261,6 @@ T("Downloading Intel XeSS", "Intel XeSS wird heruntergeladen")
T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dynamisch: rendert die 3D-Szene kleiner, wenn Frames langsam sind, und wieder schärfer, wenn nicht; bleibt in voller Größe, wo das nichts bringt.")
T("About mods", "Über Mods")
T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Mods stammen von anderen Leuten, nicht von Savage Wind. Wir prüfen, testen und unterstützen sie nicht und sind nicht verantwortlich für das, was sie tun, auch wenn sie das Spiel oder deine Spielstände beschädigen. Sichere deine Spielstände, bevor du einen ausprobierst, und schalte Mods aus, bevor du einen Fehler meldest: Eine Meldung zu einem Fehler, den ein Mod verursacht, wird sofort geschlossen. Savage-Wind-Versionen enthalten nie Mods; künftig empfehlen wir vielleicht einige, die gut mit Savage Wind laufen.")

T("Keep crouch after camera", "Nach Kamera geduckt bleiben")
T("Return to crouching after closing the Camera rune if you were crouched when opening it.", "Kehrt nach dem Schließen des Fotomoduls in die Hocke zurück, wenn du beim Öffnen geduckt warst.")
3 changes: 3 additions & 0 deletions runtime/ui/i18n/es.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1260,3 +1260,6 @@ T("Downloading Intel XeSS", "Descargando Intel XeSS")
T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dinámico: renderiza la escena 3D más pequeña cuando los fotogramas van lentos y más nítida cuando no; se queda a tamaño completo donde eso no gana nada.")
T("About mods", "Sobre los mods")
T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Los mods los hacen otras personas, no Savage Wind. No los revisamos, probamos ni damos soporte, y no nos hacemos responsables de lo que hagan, incluso si rompen el juego o tus partidas. Haz una copia de tus partidas antes de probar uno y desactiva los mods antes de reportar un error: un reporte de un error causado por un mod se cierra de inmediato. Las versiones de Savage Wind nunca incluyen mods; en el futuro quizá recomendemos algunos que funcionen bien con Savage Wind.")

T("Keep crouch after camera", "Mantener sigilo tras la cámara")
T("Return to crouching after closing the Camera rune if you were crouched when opening it.", "Vuelve a agacharse al cerrar el módulo de la cámara si estabas agachado al abrirlo.")
3 changes: 3 additions & 0 deletions runtime/ui/i18n/fr.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1261,3 +1261,6 @@ T("Downloading Intel XeSS", "Téléchargement de Intel XeSS")
T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dynamique : rend la scène 3D plus petite quand les images sont lentes, plus nette quand elles ne le sont pas ; reste en pleine taille là où ça n'apporte rien.")
T("About mods", "À propos des mods")
T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Les mods sont faits par d'autres personnes, pas par Savage Wind. Nous ne les vérifions pas, ne les testons pas et ne les prenons pas en charge, et nous ne sommes pas responsables de ce qu'ils font, y compris s'ils cassent le jeu ou vos sauvegardes. Sauvegardez vos parties avant d'en essayer un, et désactivez les mods avant de signaler un bug : le signalement d'un bug causé par un mod est fermé immédiatement. Les versions de Savage Wind n'incluent jamais de mods ; à l'avenir, nous pourrons en recommander certains qui fonctionnent bien avec Savage Wind.")

T("Keep crouch after camera", "Rester accroupi après l'appareil photo")
T("Return to crouching after closing the Camera rune if you were crouched when opening it.", "Revient en position accroupie en fermant le module Appareil photo si vous étiez accroupi en l'ouvrant.")
3 changes: 3 additions & 0 deletions runtime/ui/i18n/he.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1260,3 +1260,6 @@ T("Downloading Intel XeSS", "מוריד את Intel XeSS")
T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "דינמי: מרנדר את סצנת ה-3D קטנה יותר כשהפריימים איטיים וחדה יותר כשלא; נשארת בגודל מלא כשאין בכך תועלת.")
T("About mods", "על מודים")
T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "המודים נוצרים על ידי אנשים אחרים, לא על ידי Savage Wind. איננו בודקים, מנסים או תומכים בהם, ואיננו אחראים למה שהם עושים, כולל אם הם שוברים את המשחק או את השמירות שלך. גבה את השמירות לפני שאתה מנסה מוד, וכבה את המודים לפני דיווח על באג: דיווח על באג שנגרם על ידי מוד ייסגר מיד. גרסאות Savage Wind לעולם אינן כוללות מודים; בעתיד אולי נמליץ על כמה שעובדים טוב עם Savage Wind.")

T("Keep crouch after camera", "הישארות בכריעה אחרי המצלמה")
T("Return to crouching after closing the Camera rune if you were crouched when opening it.", "חזרה למצב כריעה לאחר סגירת רונת המצלמה אם היית כפוף בעת פתיחתה.")
3 changes: 3 additions & 0 deletions runtime/ui/i18n/it.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1261,3 +1261,6 @@ T("Downloading Intel XeSS", "Download di Intel XeSS")
T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dinamico: rende la scena 3D più piccola quando i frame sono lenti, più nitida quando non lo sono; resta a piena dimensione dove non serve.")
T("About mods", "Informazioni sulle mod")
T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Le mod sono fatte da altre persone, non da Savage Wind. Non le controlliamo, non le testiamo e non le supportiamo, e non siamo responsabili di ciò che fanno, anche se rompono il gioco o i tuoi salvataggi. Fai una copia dei salvataggi prima di provarne una e disattiva le mod prima di segnalare un bug: la segnalazione di un bug causato da una mod viene chiusa subito. Le versioni di Savage Wind non includono mai mod; in futuro potremmo consigliarne alcune che funzionano bene con Savage Wind.")

T("Keep crouch after camera", "Resta accovacciato dopo la fotocamera")
T("Return to crouching after closing the Camera rune if you were crouched when opening it.", "Torna in posizione accovacciata chiudendo il modulo Scattaimmagini se eri accovacciato all'apertura.")
3 changes: 3 additions & 0 deletions runtime/ui/i18n/ja.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1261,3 +1261,6 @@ T("Downloading Intel XeSS", "Intel XeSS をダウンロード中")
T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "動的:フレームが遅いときは 3D シーンを小さく、速いときは鮮明にレンダリングします。効果がない環境ではフルサイズのままです。")
T("About mods", "MOD について")
T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "MOD は Savage Wind ではなく、ほかの人が作ったものです。私たちは MOD の確認・テスト・サポートを行わず、ゲームやセーブデータが壊れた場合も含め、MOD の動作について責任を負いません。試す前にセーブデータをバックアップし、不具合を報告する前には MOD をオフにしてください。MOD が原因の不具合の報告はすぐにクローズされます。Savage Wind のリリースに MOD が含まれることはありません。今後、Savage Wind でよく動く MOD を紹介することはあるかもしれません。")

T("Keep crouch after camera", "カメラ終了後にしゃがみを維持")
T("Return to crouching after closing the Camera rune if you were crouched when opening it.", "しゃがみ状態でウツシエを開いたとき、閉じたあとにしゃがみ状態に戻します。")
3 changes: 3 additions & 0 deletions runtime/ui/i18n/ko.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1261,3 +1261,6 @@ T("Downloading Intel XeSS", "Intel XeSS 다운로드 중")
T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "동적: 프레임이 느릴 때 3D 장면을 더 작게, 빠를 때 더 선명하게 렌더링합니다. 이득이 없는 환경에서는 전체 크기를 유지합니다.")
T("About mods", "모드 안내")
T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "모드는 Savage Wind가 아니라 다른 사람들이 만든 것입니다. 저희는 모드를 확인하거나 테스트하거나 지원하지 않으며, 게임이나 세이브가 망가지는 경우를 포함해 모드가 하는 일에 책임지지 않습니다. 모드를 써 보기 전에 세이브를 백업하고, 버그를 신고하기 전에는 모드를 꺼 주세요. 모드 때문에 생긴 버그 신고는 바로 닫힙니다. Savage Wind 릴리스에는 모드가 포함되지 않습니다. 앞으로 Savage Wind에서 잘 작동하는 모드를 추천할 수는 있습니다.")

T("Keep crouch after camera", "사진기 사용 후 웅크리기 유지")
T("Return to crouching after closing the Camera rune if you were crouched when opening it.", "웅크린 상태에서 사진기 룬을 열었다면 닫을 때 다시 웅크린 상태로 돌아갑니다.")
3 changes: 3 additions & 0 deletions runtime/ui/i18n/nl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1261,3 +1261,6 @@ T("Downloading Intel XeSS", "Intel XeSS wordt gedownload")
T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dynamisch: rendert de 3D-scène kleiner als frames traag zijn, scherper als dat niet zo is; blijft op volle grootte waar het niets oplevert.")
T("About mods", "Over mods")
T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Mods worden door anderen gemaakt, niet door Savage Wind. We controleren, testen en ondersteunen ze niet en zijn niet verantwoordelijk voor wat ze doen, ook niet als ze het spel of je saves breken. Maak een back-up van je saves voordat je er een probeert, en zet mods uit voordat je een bug meldt: een melding van een bug die een mod veroorzaakt, wordt meteen gesloten. Savage Wind-releases bevatten nooit mods; in de toekomst raden we misschien een paar aan die goed werken met Savage Wind.")

T("Keep crouch after camera", "Gehurkt blijven na camera")
T("Return to crouching after closing the Camera rune if you were crouched when opening it.", "Keer terug naar gehurkte houding na het sluiten van de Camerarune als je gehurkt was bij het openen.")
3 changes: 3 additions & 0 deletions runtime/ui/i18n/pt.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1261,3 +1261,6 @@ T("Downloading Intel XeSS", "Baixando Intel XeSS")
T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dinâmico: renderiza a cena 3D menor quando os quadros ficam lentos e mais nítida quando não; mantém o tamanho cheio onde isso não ganha nada.")
T("About mods", "Sobre os mods")
T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Os mods são feitos por outras pessoas, não pelo Savage Wind. Não os verificamos, testamos nem damos suporte, e não somos responsáveis pelo que fazem, incluindo se estragarem o jogo ou os seus saves. Faça uma cópia dos seus saves antes de experimentar um e desative os mods antes de reportar um erro: um relatório de um erro causado por um mod é fechado de imediato. As versões do Savage Wind nunca incluem mods; no futuro talvez recomendemos alguns que funcionem bem com o Savage Wind.")

T("Keep crouch after camera", "Manter agachado após a câmera")
T("Return to crouching after closing the Camera rune if you were crouched when opening it.", "Volta a ficar agachado ao fechar a runa Câmera se você estava agachado ao abri-la.")
Loading