Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 28, 2007, 12:56:17 AM (17 years ago)
Author:
landauf
Message:

added a new class: Language
it's a manager for different language files to store translations of ingame text (it uses the default text, defined in the code, if no translation in the configured language is available)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/core/ConfigValueContainer.cc

    r703 r704  
    647647
    648648    /**
    649         @brief Sets the value of the variable back to the default value.
     649        @brief Sets the value of the variable back to the default value and resets the config-file entry.
    650650    */
    651651    void ConfigValueContainer::resetConfigValue()
    652652    {
    653         parseSting(this->defvalueString_);
     653        this->parseSting(this->defvalueString_);
     654        this->resetConfigFileEntry();
    654655    }
    655656
     
    854855    void ConfigValueContainer::readConfigFile(const std::string& filename)
    855856    {
    856         ConfigValueContainer::finishedReadingConfigFile(true);
    857 
    858857        // This creates the file if it's not existing
    859858        std::ofstream createFile;
     
    865864        file.open(filename.c_str(), std::fstream::in);
    866865
     866        if (!file.is_open())
     867        {
     868            COUT(1) << "Error: Couldn't open config-file " << filename << " to read the config values!" << std::endl;
     869            return;
     870        }
     871
    867872        char line[1024];
    868873
     
    887892
    888893        file.close();
     894
     895        ConfigValueContainer::finishedReadingConfigFile(true);
    889896    }
    890897
     
    903910        file.open(filename.c_str(), std::fstream::out);
    904911
     912        if (!file.is_open())
     913        {
     914            COUT(1) << "Error: Couldn't open config-file " << filename << " to write the config values!" << std::endl;
     915            return;
     916        }
     917
    905918        // Iterate through the list an write the lines into the file
    906919        std::list<std::string>::iterator it;
    907         for(it = ConfigValueContainer::getConfigFileLines().begin(); it != ConfigValueContainer::getConfigFileLines().end(); ++it)
     920        for (it = ConfigValueContainer::getConfigFileLines().begin(); it != ConfigValueContainer::getConfigFileLines().end(); ++it)
    908921        {
    909922            file << (*it) << std::endl;
Note: See TracChangeset for help on using the changeset viewer.