//
// Name: INTERSTELLAR CONSOLE -- Set/Unset Flag of Save AppLanguage
// Author: Misato Observatory, Wakayama, Japan
// License: GPL (General Public License)
//

// for stellarium_script_dir
include("./localConfig.ssc");

if (typeof setFlagSaveAppLanguage === 'undefined') {

  function setFlagSaveAppLanguage( flag )
  {

    var arr_objtst = StelSkyLayerMgr.getAllKeys();

    var flag_existence = false;
    if ( 0 <= arr_objtst.indexOf("0000_save_app_language") ) {
      flag_existence = true;
    }

    if ( flag == true ) {
      if ( flag_existence != true ) {
        // Flag-object to indicate Save AppLanguage
        core.loadSkyImage("0000_save_app_language", stellarium_script_dir + "/images/black.png", 0.0, -89.0, 1.0, 0, 2.5, -14, false, "AzAlt", true);
      }
    } else {
      if ( flag_existence == true ) {
        // Remove Flag-object to indicate Save AppLanguage
        core.removeSkyImage("0000_save_app_language");
      }
    }

    return flag;

  }

}

