diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index 837e2986f..b1e4f5211 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -1473,6 +1473,9 @@ (aspect4x3-ps2 #x103c) (aspect16x9-ps2 #x103d) (aspect-fmt #x103e) + (subtitle-hint #x103f) + (subtitle-enabled #x1040) + (subtitle-disabled #x1041) (msaa #x1050) (x-times-fmt #x1051) (2-times #x1052) diff --git a/game/assets/jak1/subtitle/game_subtitle_en.gd b/game/assets/jak1/subtitle/game_subtitle_en.gd index a4395b4d4..bcfc338a5 100644 --- a/game/assets/jak1/subtitle/game_subtitle_en.gd +++ b/game/assets/jak1/subtitle/game_subtitle_en.gd @@ -110,8 +110,10 @@ ("sidekick-human-intro-sequence-b" (547 "OLD MAN" "CONTINUE YOUR SEARCH FOR ARTIFACTS AND ECO.") + (664) (674 "OLD MAN" "IF THE LOCALS POSSESS PRECURSOR ITEMS, YOU KNOW WHAT TO DO.") - (842 "WOMAN" "DEAL HARSHLY WITH ANYBODY WHO STRAYS FROM THE VILLAGE.") + (819) + (839 "WOMAN" "DEAL HARSHLY WITH ANYBODY WHO STRAYS FROM THE VILLAGE.") (937 "WOMAN" "WE WILL ATTACK IT IN DUE TIME.") (1027) ) @@ -972,6 +974,24 @@ ;; misty ;; ----------------- +("fishermans-boat-ride-to-village1-alt" + (167 :offscreen "OLD MAN" "THOSE TWO COULD PROVE TO BE TROUBLE.") + (261) + (264 :offscreen "WOMAN" "DON'T WORRY, DEAR BROTHER. I'LL DISPATCH MY LURKER ARMY TO DEAL WITH THEM.") + (408) + (411 "OLD MAN" "JUST MAKE SURE THEY DON'T GET TOO CLOSE TO OUR NORTHERN OPERATIONS.") + (556) + (562 "WOMAN" "I DOUBT THEY'LL GET THAT FAR.") + (623 "WOMAN" "BUT IF THEY DO, A SURPRISE WILL BE WAITING FOR THEM IN ROCK VILLAGE.") + (785) + (790 "OLD MAN" "SO... YOU'RE GOING TO LET KLAWW OUT OF HIS CAGE?") + (957) + (966 "WOMAN" "I THINK IT'S WORTH THE RISK.") + (1053) + (1078 "OLD MAN" "INDEED.") + (1148) + ) + ("sksp0064" :hint #x245 (0 "DAXTER" "WATCH YOUR BACK! YOU REMEMBER WHAT HAPPENED THE LAST TIME WE WERE HERE.")) ("sksp0067" :hint #x249 (0 "DAXTER" "DON'T FALL INTO THE MIST BELOW US! 'CAUSE I DON'T THINK WE'LL MAKE IT BACK.")) ("sksp0059" :hint #x26e (0 "DAXTER" "THIS PLACE GIVES ME THE WILLIES! LET'S KEEP YOU OUT OF THE OOZE, OKAY?")) @@ -1577,7 +1597,6 @@ ("BIL-TA4B" :hint #x0 (0 "BILLY" "DANG!")) ("BIL-TA5A" :hint #x0 (0 "BILLY" "RAT GOT A SNACK!")) ("SKSP009F" :hint #x0 (0 "DAXTER" "GET SOME! GET SOME! HA HA HA!")) - ("sksp0137" :hint #x351 (0 "DAXTER" "I BET WE COULD SHOOT THOSE BOULDERS IF WE'RE CHARGED UP WITH YELLOW ECO.")) ("sksp0138" :hint #x352 (0 "DAXTER" "WE SHOULD SHOOT THOSE BIG BOULDERS HOLDING THE TETHER.")) ("sksp0139" :hint #x353 (0 "DAXTER" "MAYBE WE SHOULD HELP THAT WEIRDO FIND HIS PET.")) @@ -2375,6 +2394,42 @@ ("MAI-AM07" :hint #x0 (0 "MAIA" "NOOOOO!")) ("MAI-AM08" :hint #x0 (0 "MAIA" "WE'LL OPEN THE SILO ALL THE WAY AND DESTROY YOU TWO!")) ("MAI-AM09" :hint #x0 (0 "MAIA" "THEY MUST NOT BE ALLOWED TO GET IT!")) +("sksp0394" :hint #x0 (0 "DAXTER" "GRAB THE YELLOW ECO!")) +("sksp0395" :hint #x0 (0 "DAXTER" "SHOOT THE ROBOT, JAK!")) +("sksp0396" :hint #x0 (0 "DAXTER" "SHOOT HIS ARM!")) +("sksp0397" :hint #x0 (0 "DAXTER" "SHOOT HIS GUN!")) +("sksp0398" :hint #x0 (0 "DAXTER" "SHOOT HIS HEAD!")) +("sksp0399" :hint #x0 (0 "DAXTER" "WATCH OUT FOR THE BLAST!")) +("sksp0400" :hint #x0 (0 "DAXTER" "HE'S CHARGING UP!")) +("sksp0401" :hint #x0 (0 "DAXTER" "GET THE BLUE ECO!")) +("sksp0402" :hint #x0 (0 "DAXTER" "GET THE RED ECO!")) +("sksp0403" :hint #x0 (0 "DAXTER" "I HAVE A BAD FEELING ABOUT THIS!")) +("sksp0404" :hint #x0 (0 "DAXTER" "USE THE LAUNCHER, QUICK!")) +("sksp0405" :hint #x0 (0 "DAXTER" "NOW YOU'VE MADE THE ANIMAL MAD!")) +("sksp0406" :hint #x0 (0 "DAXTER" "WE CAN'T TOUCH THESE GUYS!")) +("sksp0407" :hint #x0 (0 "DAXTER" "USE THE YELLOW ECO!")) +("sksp0408" :hint #x0 (0 "DAXTER" "SHOOT THOSE GUYS!")) +("sksp0409" :hint #x0 (0 "DAXTER" "GET THE LIGHT ECO, JAK!")) +("sksp0410" :hint #x0 (0 "DAXTER" "HE LOOKS ANGRY!")) +("sksp0411" :hint #x0 (0 "DAXTER" "JUMP TO AVOID THE EXPLOSIONS!")) +("sksp0412" :hint #x0 (0 "DAXTER" "NOW WE TAKE CARE OF BUSINESS!")) +("sksp0413" :hint #x0 (0 "DAXTER" "GOOD SHOOTING, PARTNER!")) +("sksp0414" :hint #x0 (0 "DAXTER" "THAT HURT HIM!")) +("sksp0415" :hint #x0 (0 "DAXTER" "HERE HE COMES!")) +("sksp0416" :hint #x0 (0 "DAXTER" "YEAH! YOU DID IT!")) +("sksp0417" :hint #x0 (0 "DAXTER" "SAY \"GOOD NIGHT,\" GOL AND MAIA!")) + +;; ----------------- +;; title +;; ----------------- + +("sksp0444" :hint #x0 (0 "DAXTER" "WE'RE WAITING. HELLO?")) +("sksp0449" :hint #x0 (0 "DAXTER" "PRESS START TO PLAY.")) +("sksp0450" :hint #x0 (0 "DAXTER" "YOU WANNA STOP PLAYING?")) +("sksp0451" :hint #x0 (0 "DAXTER" "I DIDN'T THINK SO.")) +("sksp0452" :hint #x0 (0 "DAXTER" "OKAY, SEE YA LATER.")) +("sksp0455" :hint #x0 (0 "DAXTER" "MAN, WHO ARE ALL THESE PEOPLE?")) +("sksp0466" :hint #x0 (0 "DAXTER" "I WAS GOOD. WASN'T I, GIRLS?")) ;; ----------------- ;; uncategorized diff --git a/game/assets/jak1/subtitle/subtitle-groups.json b/game/assets/jak1/subtitle/subtitle-groups.json index dd7e098e6..b61d6cdc1 100644 --- a/game/assets/jak1/subtitle/subtitle-groups.json +++ b/game/assets/jak1/subtitle/subtitle-groups.json @@ -20,6 +20,7 @@ "lavatube", "citadel", "finalboss", + "title", "uncategorized" ], "beach": [ @@ -153,7 +154,31 @@ "green-sagecage-outro-beat-boss-b", "green-sagecage-outro-beat-boss-need-cells", "green-sagecage-outro-beat-boss-enough-cells", - "green-sagecage-outro-big-finish" + "green-sagecage-outro-big-finish", + "sksp0394", + "sksp0395", + "sksp0396", + "sksp0397", + "sksp0398", + "sksp0399", + "sksp0400", + "sksp0401", + "sksp0402", + "sksp0403", + "sksp0404", + "sksp0405", + "sksp0406", + "sksp0407", + "sksp0408", + "sksp0409", + "sksp0410", + "sksp0411", + "sksp0412", + "sksp0413", + "sksp0414", + "sksp0415", + "sksp0416", + "sksp0417" ], "firecanyon": [ "sksp0076", @@ -269,7 +294,8 @@ "sksp0071", "sksp0072", "sksp0073", - "sksp0435" + "sksp0435", + "fishermans-boat-ride-to-village1-alt" ], "ogre": [ "asstvb23", @@ -475,6 +501,15 @@ "sksp0160", "sksp0161" ], + "title": [ + "sksp0444", + "sksp0449", + "sksp0450", + "sksp0451", + "sksp0452", + "sksp0455", + "sksp0466" + ], "training": [ "asstvb40", "asstvb41", diff --git a/game/assets/jak1/text/game_text_en.gs b/game/assets/jak1/text/game_text_en.gs index c16725355..428f7fde9 100644 --- a/game/assets/jak1/text/game_text_en.gs +++ b/game/assets/jak1/text/game_text_en.gs @@ -92,6 +92,12 @@ "16X9 (PS2)") (#x103e "~DX~D" "~DX~D") +(#x103f "PRESS TO TOGGLE SUBTITLES" + "PRESS TO TOGGLE SUBTITLES") +(#x1040 "SUBTITLES ENABLED" + "SUBTITLES ENABLED") +(#x1041 "SUBTITLES DISABLED" + "SUBTITLES DISABLED") (#x1050 "MSAA" "MSAA") diff --git a/game/tools/subtitles/subtitle_editor.cpp b/game/tools/subtitles/subtitle_editor.cpp index d18b807d2..16cd7d08b 100644 --- a/game/tools/subtitles/subtitle_editor.cpp +++ b/game/tools/subtitles/subtitle_editor.cpp @@ -473,8 +473,7 @@ void SubtitleEditor::draw_all_scenes(std::string group_name, bool base_cutscenes } if (!base_cutscenes && is_current_scene) { ImGui::PushStyleColor(ImGuiCol_Text, m_selected_text_color); - } - if (base_cutscenes) { + } else if (base_cutscenes) { ImGui::PushStyleColor(ImGuiCol_Text, m_disabled_text_color); } else if (m_db.count(scene_name) == 0) { ImGui::PushStyleColor(ImGuiCol_Text, m_warning_color); @@ -668,8 +667,12 @@ void SubtitleEditor::draw_new_cutscene_line_form() { } else { rendered_text_entry_btn = true; if (ImGui::Button("Add Text Entry")) { - m_current_scene->add_line(m_current_scene_frame, m_current_scene_text, - m_current_scene_speaker, m_current_scene_offscreen); + auto font = get_font_bank( + parse_text_only_version(m_subtitle_db.m_banks[m_current_language]->file_path)); + m_current_scene->add_line(m_current_scene_frame, + font->convert_utf8_to_game_with_escape(m_current_scene_text), + font->convert_utf8_to_game_with_escape(m_current_scene_speaker), + m_current_scene_offscreen); } } if (m_current_scene_frame < 0) { diff --git a/goal_src/jak1/engine/ui/text-h.gc b/goal_src/jak1/engine/ui/text-h.gc index 457bcf3b6..f48f56b56 100644 --- a/goal_src/jak1/engine/ui/text-h.gc +++ b/goal_src/jak1/engine/ui/text-h.gc @@ -623,6 +623,9 @@ (aspect4x3-ps2 #x103c) (aspect16x9-ps2 #x103d) (aspect-fmt #x103e) + (subtitle-hint #x103f) + (subtitle-enabled #x1040) + (subtitle-disabled #x1041) (msaa #x1050) (x-times-fmt #x1051) (2-times #x1052) diff --git a/goal_src/jak1/pc/pckernel-h.gc b/goal_src/jak1/pc/pckernel-h.gc index e2204e8b3..4df33e9eb 100644 --- a/goal_src/jak1/pc/pckernel-h.gc +++ b/goal_src/jak1/pc/pckernel-h.gc @@ -472,7 +472,7 @@ (set! (-> obj force-actors?) #f) (set! (-> obj music-fade?) #f) (set! (-> obj skip-movies?) #t) - (set! (-> obj subtitles?) #t) + (set! (-> obj subtitles?) *debug-segment*) (set! (-> obj hinttitles?) #t) (set! (-> obj subtitle-speaker?) 'auto) (set! (-> obj subtitle-language) (pc-subtitle-lang english)) diff --git a/goal_src/jak1/pc/subtitle.gc b/goal_src/jak1/pc/subtitle.gc index 1519c1480..f09fee58d 100644 --- a/goal_src/jak1/pc/subtitle.gc +++ b/goal_src/jak1/pc/subtitle.gc @@ -23,7 +23,6 @@ (defconstant PC_SUBTITLE_FILE_SIZE (* 192 1024)) ;; 192K heap for subtitles. adjust later if necessary. (defconstant PC_SUBTITLE_FILE_NAME "subtit") -(defconstant PC_SUBTITLE_STR_ADJUST 17) (defglobalconstant PC_SUBTITLE_DEBUG #f) @@ -117,6 +116,8 @@ (width float) (height float) (lines float) + (notice-height float) + (hint-height float) ) ) @@ -125,8 +126,10 @@ (new 'static 'subtitle-bank :scale 0.49 :width 0.87 - :height 0.835 + :height 0.75 :lines 2.0 + :notice-height 0.2 + :hint-height 0.8 )) ;; the subtitle process! it lives on the PC actor pool and awaits for incoming subtitle messages, or a movie @@ -135,6 +138,9 @@ (font font-context) ;; the font to use for the subtitles. (bank-backup subtitle-bank :inline) ;; debug backup. + (state-time time-frame) ;; a timestamp, used for notices + (notice-id game-text-id) ;; what notice text to display at the top of the screen + ( spool-name string) (old-spool-name string) (text-id game-text-id) @@ -534,7 +540,7 @@ ) (defun subtitle-str-adjust ((pos int)) - (if (< pos 0) -1 (/ pos PC_SUBTITLE_STR_ADJUST))) + (if (< pos 0) -1 (the int (/ pos (/ 1024.0 60))))) (defstate subtitle-process (subtitle) @@ -595,7 +601,7 @@ ) ;; do subtitles - + ;; get a subtitle info that matches our current status (let ((keyframe (the subtitle-keyframe #f))) (when *subtitle-text* @@ -604,7 +610,7 @@ ;; cutscenes. get our cutscene. (set! (-> self hint-subtitle?) #f) (awhen (get-scene-by-name *subtitle-text* (-> self cur-channel) (-> self spool-name)) - + ;; find out position in the scene. (let ((pos 0)) ;; get frame num @@ -619,8 +625,6 @@ ) ) - ;; keep this for later - (set! (-> self old-spool-name) (-> self spool-name)) ) (((pc-subtitle-channel hint) (pc-subtitle-channel hint-named)) ;; hint! find it. or else. @@ -629,7 +633,7 @@ (get-scene-by-name *subtitle-text* (-> self cur-channel) (-> self spool-name)) (get-scene-by-text-id *subtitle-text* (-> self cur-channel) (-> self text-id)) ) - + (let ((pos (subtitle-str-adjust (current-str-pos (-> *hint-semaphore* 0 sound-id))))) ;; find closest keyframe (dotimes (i (-> it length)) @@ -640,16 +644,29 @@ ) ) )) - + ;; save whatever subtitle we got. (set! (-> self want-subtitle) keyframe)) + (when (and (!= (-> self old-spool-name) (-> self spool-name)) + (string= (-> self spool-name) "sage-intro-sequence-a")) + (set-state-time) + (set! (-> self notice-id) (game-text-id subtitle-hint)) + ) + ;; keep this for later + (set! (-> self old-spool-name) (-> self spool-name)) + ;; during a cutscene, check if user toggled subtitles - (if (and (= (pc-subtitle-channel movie) (-> self cur-channel)) - (= 'game *master-mode*) - (-> self want-subtitle) - (cpad-pressed? 0 square)) - (not! (-> *pc-settings* subtitles?))) + (when (and (= (pc-subtitle-channel movie) (-> self cur-channel)) + (= 'game *master-mode*) + (cpad-pressed? 0 square)) + (not! (-> *pc-settings* subtitles?)) + (set-state-time) + (if (-> *pc-settings* subtitles?) + (set! (-> self notice-id) (game-text-id subtitle-enabled)) + (set! (-> self notice-id) (game-text-id subtitle-disabled)) + ) + ) (when *debug-segment* (when (and (cpad-hold? 0 l3) (cpad-pressed? 0 start)) @@ -665,7 +682,10 @@ ;; set font settings. (set! (-> self font origin x) (* (- 1.0 (-> *SUBTITLE-bank* width)) 256)) - (set! (-> self font origin y) (* (-> *SUBTITLE-bank* height) 224)) + (set! (-> self font origin y) (* (if (-> self hint-subtitle?) + (-> *SUBTITLE-bank* hint-height) + (-> *SUBTITLE-bank* height) + ) 224)) (set-width! (-> self font) (the int (* (-> *SUBTITLE-bank* width) 512))) (set-height! (-> self font) (the int (* (-> *SUBTITLE-bank* lines) 11))) (set-scale! (-> self font) (-> *SUBTITLE-bank* scale)) @@ -678,6 +698,25 @@ (draw-debug-text-box (-> self font)) ) ) + + (cond + ((!= *master-mode* 'game) + ) + ((and (< (time-passed) (seconds 5)) + (= (-> self notice-id) (game-text-id subtitle-hint))) + (when (not (-> *pc-settings* subtitles?)) + (set-scale! (-> self font) (* (-> *SUBTITLE-bank* scale) 1.5)) + (print-game-subtitle (lookup-text! *common-text* (-> self notice-id) #f) (-> self font) #f 128 22) + ) + ) + ((and (< (time-passed) (seconds 2)) + (< (mod (time-passed) (seconds 1)) (seconds 0.8))) + (set! (-> self font origin y) (* (-> *SUBTITLE-bank* notice-height) 224)) + (print-game-subtitle (lookup-text! *common-text* (-> self notice-id) #f) (-> self font) #f 128 22) + ) + ) + + 0) )