Merge branch 'master' into translate-hints

This commit is contained in:
hackgrid 2023-11-13 00:18:19 +01:00 committed by GitHub
commit b1a03c4512
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 76 additions and 107 deletions

View file

@ -1,20 +0,0 @@
"lang"
{
"Language" "english"
"Tokens"
{
"Audio_Text_Language" "Text language"
"Audio_Audio_Language" "Audio language"
"Options_Controls" "Controls"
"Valve_Move" "Move"
"Valve_Look" "Look"
"Valve_Look_Straight_Back" "Look straight back"
"GameUI_Interlaced" "Interlaced video"
"GameUI_MovingPortals" "Moving portals"
"GameUI_TankControls" "Tank controls"
"GameUI_Deadzone" "Deadzone"
"GameUI_Acceleration" "Acceleration"
"GameUI_Sensitivity" "Sensitivity"
"HINT_MOVE" "TO MOVE"
}
}

View file

@ -109,7 +109,7 @@ struct MenuElementParams gAudioMenuParams[] = {
#define AUDIO_LANGUAGE_VALUE_INDEX 4
#define AUDIO_LANGUAGE_TEXT_INDEX 6
void audioOptionsActoin(void* data, int selection, struct MenuAction* action) {
void audioOptionsAction(void* data, int selection, struct MenuAction* action) {
struct AudioOptions* audioOptions = (struct AudioOptions*)data;
switch (selection) {
@ -123,7 +123,7 @@ void audioOptionsActoin(void* data, int selection, struct MenuAction* action) {
break;
case AudioOptionAudioLanguage:
gSaveData.audio.audioLanguage = action->state.iSlider.value;
audioOptions->menuBuilder.elements[AUDIO_LANGUAGE_TEXT_INDEX].data = menuBuildPrerenderedText(&gDejaVuSansFont, AudioLanguages[gSaveData.audio.audioLanguage], GAMEPLAY_X + 125, GAMEPLAY_Y + 124, SCREEN_WD);
audioOptions->menuBuilder.elements[AUDIO_LANGUAGE_TEXT_INDEX].data = menuBuildPrerenderedText(&gDejaVuSansFont, AudioLanguages[gSaveData.audio.audioLanguage], GAMEPLAY_X + 125, GAMEPLAY_Y + 80, SCREEN_WD);
break;
}
}
@ -140,7 +140,7 @@ void audioOptionsInit(struct AudioOptions* audioOptions) {
gAudioMenuParams,
sizeof(gAudioMenuParams) / sizeof(*gAudioMenuParams),
AudioOptionCount,
audioOptionsActoin,
audioOptionsAction,
audioOptions
);
@ -153,7 +153,7 @@ void audioOptionsRebuildtext(struct AudioOptions* audioOptions) {
menuBuilderRebuildText(&audioOptions->menuBuilder);
}
enum MenuDirection audioOptionsUpdate(struct AudioOptions* audioOptions) {
enum InputCapture audioOptionsUpdate(struct AudioOptions* audioOptions) {
return menuBuilderUpdate(&audioOptions->menuBuilder);
}

View file

@ -18,7 +18,7 @@ struct AudioOptions {
void audioOptionsInit(struct AudioOptions* audioOptions);
void audioOptionsRebuildtext(struct AudioOptions* audioOptions);
enum MenuDirection audioOptionsUpdate(struct AudioOptions* audioOptions);
enum InputCapture audioOptionsUpdate(struct AudioOptions* audioOptions);
void audioOptionsRender(struct AudioOptions* audioOptions, struct RenderState* renderState, struct GraphicsTask* task);
#endif

View file

@ -300,7 +300,7 @@ void controlsRebuildtext(struct ControlsMenu* controlsMenu) {
menuRebuildButtonText(&controlsMenu->useDefaults, &gDejaVuSansFont, translationsGet(GAMEUI_USEDEFAULTS), 1);
}
enum MenuDirection controlsMenuUpdate(struct ControlsMenu* controlsMenu) {
enum InputCapture controlsMenuUpdate(struct ControlsMenu* controlsMenu) {
if (controlsMenu->waitingForAction != ControllerActionNone) {
struct ControllerSourceWithController source = controllerReadAnySource();
@ -313,7 +313,7 @@ enum MenuDirection controlsMenuUpdate(struct ControlsMenu* controlsMenu) {
soundPlayerPlay(SOUNDS_BUTTONCLICKRELEASE, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
}
return MenuDirectionStay;
return InputCaptureGrab;
}
int controllerDir = controllerGetDirectionDown(0);
@ -370,19 +370,7 @@ enum MenuDirection controlsMenuUpdate(struct ControlsMenu* controlsMenu) {
soundPlayerPlay(SOUNDS_BUTTONCLICKRELEASE, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
}
if (controllerGetButtonDown(0, B_BUTTON)) {
return MenuDirectionUp;
}
if ((controllerDir & ControllerDirectionLeft || controllerGetButtonDown(0, L_TRIG) || controllerGetButtonDown(0, Z_TRIG)) && !(controlsMenu->waitingForAction)) {
return MenuDirectionLeft;
}
if ((controllerDir & ControllerDirectionRight || controllerGetButtonDown(0, R_TRIG) ) && !(controlsMenu->waitingForAction)) {
return MenuDirectionRight;
}
return MenuDirectionStay;
return InputCapturePass;
}
void controlsMenuRender(struct ControlsMenu* controlsMenu, struct RenderState* renderState, struct GraphicsTask* task) {

View file

@ -41,7 +41,7 @@ struct ControlsMenu {
void controlsMenuInit(struct ControlsMenu* controlsMenu);
void controlsRebuildtext(struct ControlsMenu* controlsMenu);
enum MenuDirection controlsMenuUpdate(struct ControlsMenu* controlsMenu);
enum InputCapture controlsMenuUpdate(struct ControlsMenu* controlsMenu);
void controlsMenuRender(struct ControlsMenu* controlsMenu, struct RenderState* renderState, struct GraphicsTask* task);
void controlsRenderPrompt(enum ControllerAction action, char* message, float opacity, struct RenderState* renderState);

View file

@ -31,8 +31,8 @@ void gameMenuRebuildText(struct GameMenu* gameMenu) {
}
}
enum GameMenuState gameMenuDirectionToState(enum MenuDirection direction, enum GameMenuState currentState) {
if (direction == MenuDirectionUp) {
enum GameMenuState gameInputCaptureToState(enum InputCapture direction, enum GameMenuState currentState) {
if (direction == InputCaptureExit) {
return GameMenuStateLanding;
}
@ -54,16 +54,16 @@ void gameMenuUpdate(struct GameMenu* gameMenu) {
break;
}
case GameMenuStateNewGame:
gameMenu->state = gameMenuDirectionToState(newGameUpdate(&gameMenu->newGameMenu), gameMenu->state);
gameMenu->state = gameInputCaptureToState(newGameUpdate(&gameMenu->newGameMenu), gameMenu->state);
break;
case GameMenuStateLoadGame:
gameMenu->state = gameMenuDirectionToState(loadGameUpdate(&gameMenu->loadGameMenu), gameMenu->state);
gameMenu->state = gameInputCaptureToState(loadGameUpdate(&gameMenu->loadGameMenu), gameMenu->state);
break;
case GameMenuStateSaveGame:
gameMenu->state = gameMenuDirectionToState(saveGameUpdate(&gameMenu->saveGameMenu), gameMenu->state);
gameMenu->state = gameInputCaptureToState(saveGameUpdate(&gameMenu->saveGameMenu), gameMenu->state);
break;
case GameMenuStateOptions:
gameMenu->state = gameMenuDirectionToState(optionsMenuUpdate(&gameMenu->optionsMenu), gameMenu->state);
gameMenu->state = gameInputCaptureToState(optionsMenuUpdate(&gameMenu->optionsMenu), gameMenu->state);
break;
default:
break;

View file

@ -112,7 +112,7 @@ void gameplayOptionsRebuildText(struct GameplayOptions* gameplayOptions) {
menuBuilderRebuildText(&gameplayOptions->menuBuilder);
}
enum MenuDirection gameplayOptionsUpdate(struct GameplayOptions* gameplayOptions) {
enum InputCapture gameplayOptionsUpdate(struct GameplayOptions* gameplayOptions) {
return menuBuilderUpdate(&gameplayOptions->menuBuilder);
}

View file

@ -19,7 +19,7 @@ struct GameplayOptions {
void gameplayOptionsInit(struct GameplayOptions* gameplayOptions);
void gameplayOptionsRebuildText(struct GameplayOptions* gameplayOptions);
enum MenuDirection gameplayOptionsUpdate(struct GameplayOptions* gameplayOptions);
enum InputCapture gameplayOptionsUpdate(struct GameplayOptions* gameplayOptions);
void gameplayOptionsRender(struct GameplayOptions* gameplayOptions, struct RenderState* renderState, struct GraphicsTask* task);
#endif

View file

@ -172,7 +172,7 @@ void joystickOptionsRebuildText(struct JoystickOptions* joystickOptions) {
menuBuilderRebuildText(&joystickOptions->menuBuilder);
}
enum MenuDirection joystickOptionsUpdate(struct JoystickOptions* joystickOptions) {
enum InputCapture joystickOptionsUpdate(struct JoystickOptions* joystickOptions) {
return menuBuilderUpdate(&joystickOptions->menuBuilder);
}

View file

@ -21,7 +21,7 @@ struct JoystickOptions {
void joystickOptionsInit(struct JoystickOptions* joystickOptions);
void joystickOptionsRebuildText(struct JoystickOptions* joystickOptions);
enum MenuDirection joystickOptionsUpdate(struct JoystickOptions* joystickOptions);
enum InputCapture joystickOptionsUpdate(struct JoystickOptions* joystickOptions);
void joystickOptionsRender(struct JoystickOptions* joystickOptions, struct RenderState* renderState, struct GraphicsTask* task);
#endif

View file

@ -30,7 +30,7 @@ void loadGamePopulate(struct LoadGameMenu* loadGame) {
savefileUseList(loadGame->savefileList, translationsGet(GAMEUI_LOADGAME), savefileInfo, numberOfSaves);
}
enum MenuDirection loadGameUpdate(struct LoadGameMenu* loadGame) {
enum InputCapture loadGameUpdate(struct LoadGameMenu* loadGame) {
if (controllerGetButtonDown(0, A_BUTTON) && loadGame->savefileList->numberOfSaves) {
Checkpoint* save = stackMalloc(MAX_CHECKPOINT_SIZE);
int testChamber;

View file

@ -9,7 +9,7 @@ struct LoadGameMenu {
void loadGameMenuInit(struct LoadGameMenu* loadGame, struct SavefileListMenu* savefileList);
void loadGamePopulate(struct LoadGameMenu* loadGame);
enum MenuDirection loadGameUpdate(struct LoadGameMenu* loadGame);
enum InputCapture loadGameUpdate(struct LoadGameMenu* loadGame);
void loadGameRender(struct LoadGameMenu* loadGame, struct RenderState* renderState, struct GraphicsTask* task);
#endif

View file

@ -33,11 +33,10 @@ struct MenuSlider {
short w;
};
enum MenuDirection {
MenuDirectionStay,
MenuDirectionUp,
MenuDirectionRight,
MenuDirectionLeft,
enum InputCapture {
InputCapturePass,
InputCaptureGrab,
InputCaptureExit,
};
#define GFX_ENTRIES_PER_IMAGE 3

View file

@ -50,7 +50,7 @@ void checkboxMenuItemInit(struct MenuBuilderElement* element) {
element->data = checkbox;
}
enum MenuDirection checkboxMenuItemUpdate(struct MenuBuilderElement* element, MenuActionCalback actionCallback, void* data) {
enum InputCapture checkboxMenuItemUpdate(struct MenuBuilderElement* element, MenuActionCalback actionCallback, void* data) {
if (controllerGetButtonDown(0, A_BUTTON)) {
struct MenuCheckbox* checkbox = (struct MenuCheckbox*)element->data;
@ -63,7 +63,7 @@ enum MenuDirection checkboxMenuItemUpdate(struct MenuBuilderElement* element, Me
soundPlayerPlay(SOUNDS_BUTTONCLICKRELEASE, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
}
return MenuDirectionStay;
return InputCapturePass;
}
void checkboxMenuItemRebuildText(struct MenuBuilderElement* element) {
@ -111,12 +111,11 @@ void sliderMenuItemInit(struct MenuBuilderElement* element) {
#define FULL_SCROLL_TIME 2.0f
#define SCROLL_MULTIPLIER (1.0f * FIXED_DELTA_TIME / (80 * FULL_SCROLL_TIME))
enum MenuDirection sliderMenuItemUpdate(struct MenuBuilderElement* element, MenuActionCalback actionCallback, void* data) {
enum InputCapture sliderMenuItemUpdate(struct MenuBuilderElement* element, MenuActionCalback actionCallback, void* data) {
struct MenuSlider* slider = (struct MenuSlider*)element->data;
if (element->params->params.slider.discrete) {
int controllerDir = controllerGetDirectionDown(0);
if (element->params->params.slider.discrete) {
int numTicks = element->params->params.slider.numberOfTicks;
int currentValue = (int)floorf(slider->value * (numTicks - 1));
int newValue = currentValue;
@ -197,7 +196,10 @@ enum MenuDirection sliderMenuItemUpdate(struct MenuBuilderElement* element, Menu
}
}
return MenuDirectionStay;
if (controllerGetButtonDown(0, L_JPAD | R_JPAD | A_BUTTON) || (element->params->params.slider.discrete && ((controllerDir & ControllerDirectionLeft) || (controllerDir & ControllerDirectionRight))))
soundPlayerPlay(SOUNDS_BUTTONCLICKRELEASE, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
return InputCapturePass;
}
void sliderMenuItemRender(struct MenuBuilderElement* element, int selection, int materialIndex, struct PrerenderedTextBatch* textBatch, struct RenderState* renderState) {
@ -236,9 +238,9 @@ void menuBuilderInit(
}
}
enum MenuDirection menuBuilderUpdate(struct MenuBuilder* menuBuilder) {
enum InputCapture menuBuilderUpdate(struct MenuBuilder* menuBuilder) {
if (controllerGetButtonDown(0, B_BUTTON)) {
return MenuDirectionUp;
return InputCaptureExit;
}
int controllerDir = controllerGetDirectionDown(0);
@ -265,22 +267,15 @@ enum MenuDirection menuBuilderUpdate(struct MenuBuilder* menuBuilder) {
struct MenuBuilderElement* element = &menuBuilder->elements[i];
if (element->callbacks->update && element->selectionIndex == menuBuilder->selection) {
enum MenuDirection direction = element->callbacks->update(element, menuBuilder->actionCallback, menuBuilder->data);
enum InputCapture direction = element->callbacks->update(element, menuBuilder->actionCallback, menuBuilder->data);
if (direction != MenuDirectionStay) {
if (direction != InputCapturePass) {
return direction;
}
}
}
if (controllerGetButtonDown(0, L_TRIG) || controllerGetButtonDown(0, Z_TRIG)) {
return MenuDirectionLeft;
}
if (controllerGetButtonDown(0, R_TRIG)) {
return MenuDirectionRight;
}
return MenuDirectionStay;
return InputCapturePass;
}
void menuBuilderRebuildText(struct MenuBuilder* menuBuilder) {

View file

@ -35,7 +35,7 @@ struct MenuAction {
typedef void (*MenuActionCalback)(void* data, int selection, struct MenuAction* action);
typedef void (*MenuItemInit)(struct MenuBuilderElement* element);
typedef enum MenuDirection (*MenuItemUpdate)(struct MenuBuilderElement* element, MenuActionCalback actionCallback, void* data);
typedef enum InputCapture (*MenuItemUpdate)(struct MenuBuilderElement* element, MenuActionCalback actionCallback, void* data);
typedef void (*MenuItemRebuildText)(struct MenuBuilderElement* element);
typedef void (*MenuItemRender)(struct MenuBuilderElement* element, int selection, int materialIndex, struct PrerenderedTextBatch* textBatch, struct RenderState* renderState);
@ -96,7 +96,7 @@ void menuBuilderInit(
MenuActionCalback actionCallback,
void* data
);
enum MenuDirection menuBuilderUpdate(struct MenuBuilder* menuBuilder);
enum InputCapture menuBuilderUpdate(struct MenuBuilder* menuBuilder);
void menuBuilderRebuildText(struct MenuBuilder* menuBuilder);
void menuBuilderRender(struct MenuBuilder* menuBuilder, struct RenderState* renderState);

View file

@ -136,9 +136,9 @@ void newGameRebuildText(struct NewGameMenu* newGameMenu) {
newGameMenu->newGameText = menuBuildPrerenderedText(&gDejaVuSansFont, translationsGet(GAMEUI_NEWGAME), 48, 48, SCREEN_WD);
}
enum MenuDirection newGameUpdate(struct NewGameMenu* newGameMenu) {
enum InputCapture newGameUpdate(struct NewGameMenu* newGameMenu) {
if (controllerGetButtonDown(0, B_BUTTON)) {
return MenuDirectionUp;
return InputCaptureExit;
}
if (controllerGetButtonDown(0, A_BUTTON) && gChapters[newGameMenu->selectedChapter].testChamberNumber >= 0) {
@ -169,7 +169,7 @@ enum MenuDirection newGameUpdate(struct NewGameMenu* newGameMenu) {
chapterMenuSetChapter(&newGameMenu->chapter1, &gChapters[newGameMenu->chapterOffset + 1], newGameMenu->chapterOffset + 1);
}
return MenuDirectionStay;
return InputCapturePass;
}
void newGameRender(struct NewGameMenu* newGameMenu, struct RenderState* renderState, struct GraphicsTask* task) {

View file

@ -44,7 +44,7 @@ struct NewGameMenu {
void newGameInit(struct NewGameMenu* newGameMenu);
void newGameRebuildText(struct NewGameMenu* newGameMenu);
enum MenuDirection newGameUpdate(struct NewGameMenu* newGameMenu);
enum InputCapture newGameUpdate(struct NewGameMenu* newGameMenu);
void newGameRender(struct NewGameMenu* newGameMenu, struct RenderState* renderState, struct GraphicsTask* task);
#endif

View file

@ -68,28 +68,34 @@ void optionsMenuRebuildText(struct OptionsMenu* options) {
tabsRebuildText(&options->tabs);
}
enum MenuDirection optionsMenuUpdate(struct OptionsMenu* options) {
enum InputCapture optionsMenuUpdate(struct OptionsMenu* options) {
enum InputCapture result = InputCapturePass;
switch (options->tabs.selectedTab) {
case OptionsMenuTabsControlMapping:
controlsMenuUpdate(&options->controlsMenu);
result = controlsMenuUpdate(&options->controlsMenu);
break;
case OptionsMenuTabsControlJoystick:
joystickOptionsUpdate(&options->joystickOptions);
result = joystickOptionsUpdate(&options->joystickOptions);
break;
case OptionsMenuTabsAudio:
audioOptionsUpdate(&options->audioOptions);
result = audioOptionsUpdate(&options->audioOptions);
break;
case OptionsMenuTabsVideo:
videoOptionsUpdate(&options->videoOptions);
result = videoOptionsUpdate(&options->videoOptions);
break;
case OptionsMenuTabsGameplay:
gameplayOptionsUpdate(&options->gameplayOptions);
result = gameplayOptionsUpdate(&options->gameplayOptions);
break;
}
if (result != InputCapturePass) {
return result;
}
if (controllerGetButtonDown(0, B_BUTTON)) {
savefileSave();
return MenuDirectionUp;
return InputCaptureExit;
}
if (controllerGetButtonDown(0, Z_TRIG | L_TRIG)) {
@ -113,7 +119,7 @@ enum MenuDirection optionsMenuUpdate(struct OptionsMenu* options) {
}
return MenuDirectionStay;
return InputCapturePass;
}
void optionsMenuRender(struct OptionsMenu* options, struct RenderState* renderState, struct GraphicsTask* task) {

View file

@ -35,7 +35,7 @@ struct OptionsMenu {
void optionsMenuInit(struct OptionsMenu* options);
void optionsMenuRebuildText(struct OptionsMenu* options);
enum MenuDirection optionsMenuUpdate(struct OptionsMenu* options);
enum InputCapture optionsMenuUpdate(struct OptionsMenu* options);
void optionsMenuRender(struct OptionsMenu* options, struct RenderState* renderState, struct GraphicsTask* task);
#endif

View file

@ -58,7 +58,7 @@ void saveGamePopulate(struct SaveGameMenu* saveGame, int includeNew) {
}
}
enum MenuDirection saveGameUpdate(struct SaveGameMenu* saveGame) {
enum InputCapture saveGameUpdate(struct SaveGameMenu* saveGame) {
if (controllerGetButtonDown(0, A_BUTTON) && saveGame->savefileList->numberOfSaves) {
Checkpoint* save = stackMalloc(MAX_CHECKPOINT_SIZE);
if (checkpointSaveInto(&gScene, save)) {

View file

@ -9,7 +9,7 @@ struct SaveGameMenu {
void saveGameMenuInit(struct SaveGameMenu* saveGame, struct SavefileListMenu* savefileList);
void saveGamePopulate(struct SaveGameMenu* saveGame, int includeNew);
enum MenuDirection saveGameUpdate(struct SaveGameMenu* saveGame);
enum InputCapture saveGameUpdate(struct SaveGameMenu* saveGame);
void saveGameRender(struct SaveGameMenu* saveGame, struct RenderState* renderState, struct GraphicsTask* task);
#endif

View file

@ -147,9 +147,9 @@ void savefileUseList(struct SavefileListMenu* savefileList, char* title, struct
savefileListMenuSetScroll(savefileList, 0);
}
enum MenuDirection savefileListUpdate(struct SavefileListMenu* savefileList) {
enum InputCapture savefileListUpdate(struct SavefileListMenu* savefileList) {
if (controllerGetButtonDown(0, B_BUTTON)) {
return MenuDirectionUp;
return InputCaptureExit;
}
int controllerDir = controllerGetDirectionDown(0);
@ -182,7 +182,7 @@ enum MenuDirection savefileListUpdate(struct SavefileListMenu* savefileList) {
savefileListMenuSetScroll(savefileList, savefileList->scrollOffset + CONTENT_Y - selectTop);
}
return MenuDirectionStay;
return InputCapturePass;
}
void savefileListRender(struct SavefileListMenu* savefileList, struct RenderState* renderState, struct GraphicsTask* task) {

View file

@ -38,7 +38,7 @@ struct SavefileListMenu {
void savefileListMenuInit(struct SavefileListMenu* savefileList);
void savefileUseList(struct SavefileListMenu* savefileList, char* title, struct SavefileInfo* savefileInfo, int slotCount);
enum MenuDirection savefileListUpdate(struct SavefileListMenu* savefileList);
enum InputCapture savefileListUpdate(struct SavefileListMenu* savefileList);
void savefileListRender(struct SavefileListMenu* savefileList, struct RenderState* renderState, struct GraphicsTask* task);
int savefileGetSlot(struct SavefileListMenu* savefileList);

View file

@ -194,7 +194,7 @@ void videoOptionsRebuildtext(struct VideoOptions* videoOptions) {
menuBuilderRebuildText(&videoOptions->menuBuilder);
}
enum MenuDirection videoOptionsUpdate(struct VideoOptions* videoOptions) {
enum InputCapture videoOptionsUpdate(struct VideoOptions* videoOptions) {
return menuBuilderUpdate(&videoOptions->menuBuilder);
}

View file

@ -20,7 +20,7 @@ struct VideoOptions {
void videoOptionsInit(struct VideoOptions* videoOptions);
void videoOptionsRebuildtext(struct VideoOptions* videoOptions);
enum MenuDirection videoOptionsUpdate(struct VideoOptions* videoOptions);
enum InputCapture videoOptionsUpdate(struct VideoOptions* videoOptions);
void videoOptionsRender(struct VideoOptions* videoOptions, struct RenderState* renderState, struct GraphicsTask* task);

View file

@ -111,7 +111,7 @@ function generateLanguagesSourceFile() {
sourcefile += 'char* AudioLanguages[] = \n{\n';
for (let language of languages) {
sourcefile += '\t"' + language_names[language].toUpperCase() + '",\n';
sourcefile += '\t"' + language_names[language] + '",\n';
}
sourcefile += '};\n';

View file

@ -291,13 +291,14 @@ def make_overall_subtitles_sourcefile(language_list):
dump_lines("build/src/audio/subtitles.c", sourcefile_lines)
def read_translation_file(filepath):
def read_translation_file(filepath, encoding='utf-16-le'):
if not exists(filepath):
print(f"not found {filepath}")
return [], [], ''
lines = []
with open(filepath, "r", encoding='utf-16-le') as f:
with open(filepath, "r", encoding=encoding) as f:
lines = f.readlines()
new_lines = []
@ -347,7 +348,7 @@ def process_all_closecaption_files(dir, language_names):
valve_k, valve_v, _ = read_translation_file(f"vpk/Portal/hl2/resource/valve_{language_name}.txt")
valve_k, valve_v = filter_whitelist(valve_k, valve_v, valve_whitelist)
extra_k, extra_v, _ = read_translation_file(f"assets/translations/extra_{language_name}.txt")
extra_k, extra_v, _ = read_translation_file(f"assets/translations/extra_{language_name}.txt", encoding='utf-8')
k = k + gamepad_k + portal_k + valve_k + extra_k
v = v + gamepad_v + portal_v + valve_v + extra_v