Merge pull request #402 from hackgrid/fix-make-4

require gameui/closecaption files for Makefile, fix typo, update Readme
This commit is contained in:
lambertjamesd 2023-11-04 09:21:28 -06:00 committed by GitHub
commit bdf4393845
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 17 deletions

View file

@ -523,7 +523,7 @@ SUBTITLE_LANGUAGES = brazilian \
SUBTITLE_SOURCES = $(SUBTITLE_LANGUAGES:%=build/src/audio/subtitles_%.c)
SUBTITLE_OBJECTS = $(SUBTITLE_LANGUAGES:%=build/src/audio/subtitles_%.o)
build/src/audio/subtitles.h build/src/audio/subtitles.c build/subtitles.ld $(SUBTITLE_SOURCES): tools/level_scripts/subtitle_generate.py
build/src/audio/subtitles.h build/src/audio/subtitles.c build/subtitles.ld $(SUBTITLE_SOURCES): vpk/Portal/portal/resource/closecaption_english.txt vpk/Portal/hl2/resource/gameui_english.txt tools/level_scripts/subtitle_generate.py
python3 tools/level_scripts/subtitle_generate.py $(SUBTITLE_LANGUAGES)
####################
@ -609,4 +609,4 @@ clean-assets:
fix:
wine tools/romfix64.exe build/portal.z64
.SECONDARY:
.SECONDARY:

View file

@ -96,15 +96,8 @@ sudo apt install nodejs
<br />
You will need to add at least one of the following files from where Portal is installed to the folder `resource/`. You can add multiple languages if desired.
```
portal/resource/closecaption_english.txt
portal/resource/closecaption_<your desired language 1>.txt
portal/resource/closecaption_<your desired language 2>.txt
```
You then need to add the following files from where Portal is installed to the folder `vpk/` OR create a symbolic link to the `Portal` folder there. (see [vpk/add_vpk_here.md](./vpk/add_vpk_here.md) for more details!)
You then need to add the following files from where Portal is installed to the folder `vpk/` OR create a symbolic link to the `Portal` folder there (see [vpk/add_vpk_here.md](./vpk/add_vpk_here.md) for more details!).
You can add multiple languages if desired.
```
Portal/portal/portal_pak_000.vpk
@ -127,6 +120,14 @@ Portal/hl2/hl2_misc_003.vpk
Portal/hl2/hl2_misc_dir.vpk
Portal/hl2/media/valve.bik
Portal/hl2/resource/gameui_english.txt
Portal/hl2/resource/gameui_<your desired language 1>.txt
Portal/hl2/resource/gameui_<your desired language 2>.txt
Portal/portal/resource/closecaption_english.txt
Portal/portal/resource/closecaption_<your desired language 1>.txt
Portal/portal/resource/closecaption_<your desired language 2>.txt
```
Finally, run `make` to build the project.
@ -160,7 +161,7 @@ Also you can build with all audio languages integrated with this shortcut:
make all_languages
```
This requires additional *.vpk files copied to the folder `vpk/`:
This requires additional *.vpk files copied to the root of folder `vpk/` (since the original Portal keeps only one language at the same time, you have to copy these files!):
- German:
```

View file

@ -281,19 +281,19 @@ def process_all_closecaption_files(dir, language_names):
key_order = None
default_values = None
for langauge_name in language_names:
filename = f"closecaption_{langauge_name}.txt"
for language_name in language_names:
filename = f"closecaption_{language_name}.txt"
try:
filepath = os.path.join(dir, filename)
k,v,l = read_translation_file(filepath)
gamepad_k, gamepad_v, _ = read_translation_file(f"vpk/Portal/hl2/resource/gameui_{langauge_name}.txt")
gamepad_k, gamepad_v, _ = read_translation_file(f"vpk/Portal/hl2/resource/gameui_{language_name}.txt")
gamepad_k, gamepad_v = filter_whitelist(gamepad_k, gamepad_v, hl_gameui_whitelist)
extra_k, extra_v, _ = read_translation_file(f"assets/translations/extra_{langauge_name}.txt")
extra_k, extra_v, _ = read_translation_file(f"assets/translations/extra_{language_name}.txt")
k = k + gamepad_k + extra_k
v = v + gamepad_v + extra_v
@ -355,4 +355,4 @@ def process_all_closecaption_files(dir, language_names):
process_all_closecaption_files("vpk/Portal/portal/resource", sys.argv[1:])
process_all_closecaption_files("vpk/Portal/portal/resource", sys.argv[1:])