V-Gears 0
Free Final Fantasy VII engine.
TextHandlerCommands.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include "ConfigCmdHandler.h"
17#include "Console.h"
18#include "Logger.h"
19#include "XmlTextsFile.h"
20
29void CmdSetLanguage(const Ogre::StringVector& params){
30 if (params.size() < 2){
31 Console::getSingleton().AddTextToOutput("Usage: /set_language <language>");
32 return;
33 }
34 TextHandler::getSingleton().SetLanguage(params[1]);
35 LOG_TRIVIAL("Set game language to \"" + params[1] + "\".");
36}
37
45void CmdSetLanguageCompletition(Ogre::StringVector& complete_params){
46 XmlTextsFile texts( "./data/texts.xml" );
47 texts.GetAvailableLanguages(complete_params);
48}
49
51 ConfigCmdHandler::getSingleton().AddCommand(
52 "set_language", "Change language of texts and dialogs", "",
54 );
55}
void CmdSetLanguage(const Ogre::StringVector &params)
Sets the language for texts.
Definition: TextHandlerCommands.h:29
void CmdSetLanguageCompletition(Ogre::StringVector &complete_params)
Loads a list of every available language identifiers.
Definition: TextHandlerCommands.h:45
void InitCmd()
Initializes the commands for the text handler.
Definition: TextHandlerCommands.h:50
Handles the main text file/.
Definition: XmlTextsFile.h:24
void GetAvailableLanguages(Ogre::StringVector &languages)
Retrieves a list of all the available text languages.
Definition: XmlTextsFile.cpp:26
#define LOG_TRIVIAL(message)
Prints a trivial log message.
Definition: Logger.h:50