﻿### LICENSE:
#
# Copyright (C) 2011 Ahmad Amarullah ( http://amarullz.com/ )
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###

ini_set("rom_name",             "ElementalX");
ini_set("rom_version",          "2.01");
ini_set("rom_author",           "flar2");
ini_set("rom_device",           "Samsung Galaxy S9/S9+");
ini_set("rom_date",             "Jan 4, 2019");

ini_set("force_colorspace","rgba");
#ini_set("dp","6");

fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" ); 

splash(2000, "elementalx");

theme("elementalx");


viewbox(
    "\nElementalX",

    "<@center>\nfor <b>" + ini_get("rom_device") + "               </b>\n\n</@>" +
    "\n\n\n\n  VERSION\t: <b><#selectbg_g>"+ini_get("rom_version")+"</#></b>\n" +
    "  AUTHOR \t: <b><#selectbg_g>"+ini_get("rom_author")+"</#></b>\n" +
    "  RELEASED\t: <b><#selectbg_g>"+ini_get("rom_date")+"</#></b>\n\n\n" +
    "Press Next to Continue...",

    "@welcome"
);


agreebox(
   "\nTerms Of Use",
   "<@center>\nPlease read the ElementalX terms of use\n\n</@>",
   "",
   "" + readfile_aroma("agreement.txt"),
   "I agree with these terms of use",
   "<@center>\nYou must accept the terms</@>"
);

selectbox(
  "\CPU frequencies","<@center><b>\nOverclock or underclock the CPU\n</b></@>","","cpu.prop",
  "Overclock (performance)","CPU0-3: 2.0GHz\nCPU4-7: 2.9GHz\nBoost multicore performance",0,
  "Stock CPU frequencies","CPU0-3: 1.8GHz\nCPU4-7: 2.7GHz\nBoost multicore performance",1,
  "Underclock (battery life)","CPU0-3: 1.8GHz\nCPU4-7: 2.3GHz",0
);

menubox(
  "\nElementalX Installer",
  "<@center>\nReady to install\n\n</@>",
  "",
  "menu.prop",
  "Install ElementalX","","@install",
  "Abort installation","","@trash"
);

if prop("menu.prop","selected")=="2"
then
  exit("");
endif;

setvar("retstatus",
install(
  "\nInstalling",
  "<@center>\nInstalling ElementalX Kernel...\nPlease wait...</@>",
  "")
);

ini_set("text_next", "Finish");

if getvar("retstatus")=="0" then
  viewbox(
  "\nInstallation Completed",
  "<@center>\nCongratulations!\n"+
  "ElementalX has been successfully installed\n\n\n</@>",
  ""
);
else
   viewbox("Installation Failed","\n\nInstaller Status: "+ getvar("retstatus"),"@warning");
endif;
