add text messages for subtitle toggling + subtitle editor fixes (#1617)

* add final cutscene subtitle and fix some editor bugs

* `title` and `finalboss` hints

* messages and notices for subtitle toggling

* fix colors in currently selected cutscene menu

* subtitle positioning fixes

* Update game_subtitle_en.gd
This commit is contained in:
ManDude 2022-07-06 23:09:01 +01:00 committed by GitHub
parent b4391d0643
commit 9ede08977f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 168 additions and 24 deletions

View file

@ -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)

View file

@ -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

View file

@ -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",

View file

@ -92,6 +92,12 @@
"16X9 (PS2)")
(#x103e "~DX~D"
"~DX~D")
(#x103f "PRESS <PAD_SQUARE> TO TOGGLE SUBTITLES"
"PRESS <PAD_SQUARE> TO TOGGLE SUBTITLES")
(#x1040 "SUBTITLES ENABLED"
"SUBTITLES ENABLED")
(#x1041 "SUBTITLES DISABLED"
"SUBTITLES DISABLED")
(#x1050 "MSAA"
"MSAA")

View file

@ -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) {

View file

@ -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)

View file

@ -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))

View file

@ -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)
@ -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.
@ -644,12 +648,25 @@
;; 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)
)