window.screenOrientation = "portrait"; //-----libs-begin----- loadLib("libs/laya.core.js"); loadLib("libs/laya.ui.js"); loadLib("libs/laya.d3.js"); loadLib("libs/oimo.js"); loadLib("libs/sha256.js"); loadLib("libs/fairygui/fairygui.min.js"); window.curLang = "en"; if (window.YaGames) { YaGames.init().then(ysdk => { console.log('Yandex SDK initialized'); window.ysdk = ysdk; if (ysdk.environment.i18n.lang == "ru") { window.curLang = "ru"; } else if (ysdk.environment.i18n.lang == "tr") { window.curLang = "tr"; } else { window.curLang = "en"; } loadLib("./js/bundle.js"); }); } else { window.curLang = "en"; loadLib("./js/bundle.js"); } window.getLangImage = function (url) { let res = url; let imageMap = ["text_chexiao", "text_youwin"] for (let index = 0; index < this.imageMap.length; index++) { let key = this.imageMap[index]; let name = `/${key}.png`; if (url.indexOf(name) > 0) { let langEnd = window.curLang == "ru" ? "_ru" : (this.langType == "tr" ? "_tr" : "_en"); let replaceName = `/${key}${langEnd}.png` res = url.replace(name, replaceName); break; } } return res; } window.createLabel = function (text, attr) { var label = new Laya.Label(); label.text = text; label.name = attr && attr.name ? attr.name : ""; label.color = attr && attr.color ? attr.color : "#ffffff"; label.fontSize = attr && attr.fontSize ? attr.fontSize : 20; if (attr.bold) { label.bold = true; } if (attr.stroke) { label.stroke = attr.stroke; } return label; } window.showToast = function (title) { Laya.stage.removeChild(Laya.stage.getChildByName("showToast")); var bgimg = new Laya.Image("bg_toast.png"); bgimg.name = "showToast"; var lal = new Laya.Label(title); lal.centerY = 0; lal.width = 600; lal.fontSize = 28; lal.bold = true; lal.font = "YaHei"; lal.color = "#ffffff"; lal.align = "center"; lal.valign = "middle"; lal.overflow = "hidden"; lal.centerX = 0; bgimg.centerX = 0; bgimg.centerY = -200; bgimg.zOrder = 1000; bgimg.addChild(lal); Laya.stage.addChild(bgimg); Laya.timer.once(2500, Laya.stage, function s() { bgimg.visible = false; bgimg.removeChildren(); Laya.stage.removeChild(bgimg); }); } window.lastInterstTime = 0; window.lastVideoTime = 0; window.showInterAdd = 0; window.maxInterAdd = 0; window.showVivoInterst = function () { console.log("===showVivoInterst"); //UPTAP插屏 window['uptap'].ShowScreenVideo("下⼀关", function () { // 回调函数,插屏⼴告关闭后需要继续执⾏的代码 }); } window.showRewardAds = function (cb, close) { console.log("====showRewardAds"); //UPTAP视频 window.uptap.ShowExcitationVideoAdv((n1) => { switch (n1.type) { case "1": // 暂时没有⼴告 // 这⾥执⾏激励播放失败的代码,不发放奖励 close(); break; case "2": // 想要奖励,必须看完⼴告(⽤户点击跳过按钮) // 这⾥执⾏激励播放失败的代码,不发放奖励 close(); break; case "3": // ⼴告正常播放完毕 // 这⾥执⾏激励播放成功的代码,发放奖励 cb(); break; } }) } window.getLangByKey = function (enkey) { let curIndex = 0; if (window["curLang"] == "ru") { curIndex = 1; } else if (window["curLang"] == "tr") { curIndex = 2; } let keys = { "NoCoin": ["Not Enough Coin", "Недостаточно монет", "Yeterli değil"], "Fail": ["Fail", "Провал", "Başarısızlık"], "Reward": ["Reward ", "Награда ", "ödüllendir"], "video_success": ["Get video rewards!", "Получайте награды за видео!", "Video ödülleri alın!"], "video_fail": ["Video is wrong, please try later!", "Ошибка при воспроизведении видео!", "video yanlış lütfen daha sonra deneyiniz"], "get_sign_reward": ["Sign in successfully!", "Войдите в систему успешно!", "Başarıyla oturum açın!"], "get_three_more": [" Choose three more box", "Выберите еще три коробки", "Üç kutu seç"], "hurt": ["Hurt", "больно", "Acıtmak"], "speed": ["Speed", "Скорость", "Hız"], "range": ["Range", "Диапазон", "Aralık"], "max": ["MAX", "МАКС", "MAKS."], "unlock": ["Unlock", "открыть", "Kilidini aç"], "pass": ["Pass", "пройти", "geçmek"], "winget": ["Win the game to get", "выиграть игру, чтобы получить", "almak için oyunu kazanmak"], "clickthrow": ["Click and Throw Disc", "Нажмите и выбросьте диск", "Tıkla ve Diski At"], "leftandright": ["Slide to adjust the angle", "Ползунок отрегулируйте угол", "Kaydırma açısını ayarlayın"], "downcancle": ["slide down to cancel", "сдвиньте вниз отмена", "aşağı kaydır iptal et"], "next": ["Next", "Следующий", "Sonraki"], "box": ["From box", "Из коробки", "kutudan"], "maxsocre": ["Max:", "Макс:", "Maks:"], "challenge": ["challenge", "игровой режим 2", "meydan okumak"], "normal": ["normal", "игровой режим 1", "normal"], "again": ["Again", "Снова", "Tekrar"], "count": ["count", "считать", "saymak"], "bestscore": ["Save score to leaderboard", "Сохранить счет в таблице лидеров", "Skor tablosuna puan kaydet"] } if (!keys[enkey]) { return enkey } console.log() return " " + keys[enkey][curIndex]; }