Esempio n. 1
0
string Options::getValueString(OptionId id) {
  Value value = getValue(id);
  switch (id) {
    case OptionId::HINTS:
    case OptionId::ASCII:
    case OptionId::FULLSCREEN:
    case OptionId::AUTOSAVE:
    case OptionId::WASD_SCROLLING:
    case OptionId::SOUND:
    case OptionId::MUSIC: return getOnOff(value);
    case OptionId::KEEP_SAVEFILES:
    case OptionId::SHOW_MAP:
    case OptionId::FAST_IMMIGRATION:
    case OptionId::STARTING_RESOURCE:
    case OptionId::ONLINE:
    case OptionId::ZOOM_UI:
    case OptionId::START_WITH_NIGHT: return getYesNo(value);
    case OptionId::ADVENTURER_NAME:
    case OptionId::KEEPER_SEED:
    case OptionId::KEEPER_NAME: {
        string val = boost::get<string>(value);
        if (val.empty())
          return defaultStrings[id];
        else
          return val;
        }
    case OptionId::FULLSCREEN_RESOLUTION: return choices[id][boost::get<int>(value)];
    case OptionId::MAIN_VILLAINS:
    case OptionId::LESSER_VILLAINS:
    case OptionId::RETIRED_VILLAINS:
    case OptionId::INFLUENCE_SIZE:
    case OptionId::ALLIES: return toString(getIntValue(id));
  }
}
Esempio n. 2
0
string Options::getValueString(OptionId id, Options::Value value) {
  switch (id) {
    case OptionId::HINTS:
    case OptionId::ASCII:
    case OptionId::FULLSCREEN:
    case OptionId::AUTOSAVE:
    case OptionId::MUSIC: return getOnOff(value);
    case OptionId::KEEP_SAVEFILES:
    case OptionId::SHOW_MAP:
    case OptionId::FAST_IMMIGRATION:
    case OptionId::STARTING_RESOURCE:
    case OptionId::ONLINE:
    case OptionId::START_WITH_NIGHT: return getYesNo(value);
    case OptionId::ADVENTURER_NAME:
    case OptionId::KEEPER_NAME: {
        string val = boost::get<string>(value);
        if (val.empty())
          return defaultStrings[id];
        else
          return val;
        }
    case OptionId::FULLSCREEN_RESOLUTION: return choices[id][boost::get<int>(value)];
  }
}