// // Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // import EditorUI = require("../EditorUI"); import ModalWindow = require("./ModalWindow"); class About extends ModalWindow { constructor() { super(); // we're not calling this.init here as it calls resizeToFitContent // and center, which screw up the generated About text being resized this.text = "About the Atomic Game Engine"; this.load("AtomicEditor/editor/ui/about.tb.txt"); this.age_license = this.getWidget("age_license"); this.thirdparty_license = this.getWidget("thirdparty_license"); this.externaltool_license = this.getWidget("externaltool_license"); this.about_text = this.getWidget("about_text"); var cache = Atomic.cache; var file = cache.getFile("AtomicEditor/eulas/atomic_game_engine_eula.txt"); this.age_license.text = file.readText(); file = cache.getFile("AtomicEditor/eulas/atomic_thirdparty_eula.txt"); this.thirdparty_license.text = file.readText(); file = cache.getFile("AtomicEditor/eulas/atomic_external_tools_eula.txt"); this.externaltool_license.text = file.readText(); this.about_text.text = this.generateAboutText(); var get_pro = this.getWidget("purchase_pro"); if (get_pro) { get_pro.onClick = function() { Atomic.fileSystem.systemOpen("https://store.atomicgameengine.com/site"); }; } this.resizeToFitContent(); this.center(); this.getWidget("tabcontainer").value = 0; } handleWidgetEvent(ev: Atomic.UIWidgetEvent) { if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) { var id = ev.target.id; if (id == "ok") { this.hide(); return true; } } } generateAboutText(): string { var text = ""; text += "\n\n"; text += "Git SHA: " + Atomic.getGitRevision() +"\n\n"; text += "(c) 2014-2016 THUNDERBEAST GAMES LLC\n\n\n"; text += "Installed platforms and modules:\n\n"; var licenseSystem = ToolCore.licenseSystem; var installedText = " "; var availableText = " "; if (licenseSystem.licenseAndroid) installedText += " "; else availableText += " "; if (licenseSystem.licenseIOS) installedText += " "; else availableText += " "; installedText += " "; if (licenseSystem.licenseModule3D) installedText += " "; else availableText += " "; text += installedText + "\n\n\n"; if (!licenseSystem.licenseIOS || !licenseSystem.licenseAndroid || !licenseSystem.licenseModule3D) { text += "Available platforms and modules:\n\n"; text += availableText + "\n\n\n"; } text += "Special Thanks:\n\n"; text += " The Urho3D Project - http://urho3d.github.io\n\n"; text += " Sami Vaarala - http://www.duktape.org"; return text; } age_license: Atomic.UIEditField; thirdparty_license: Atomic.UIEditField; externaltool_license: Atomic.UIEditField; about_text: Atomic.UIEditField; } export = About;