diff --git a/Applications/Games/The Elder Scrolls III: Morrowind/Lutris Wine Steam/script.js b/Applications/Games/The Elder Scrolls III: Morrowind/Lutris Wine Steam/script.js new file mode 100644 index 0000000000..3c3019eeb3 --- /dev/null +++ b/Applications/Games/The Elder Scrolls III: Morrowind/Lutris Wine Steam/script.js @@ -0,0 +1,12 @@ +include(["engines", "wine", "quick_script", "lutris_wine_steam_script"]); + +var installerImplementation = { + run: function () { + new LutrisWineSteamScript() + .slug("the-elder-scrolls-iii-morrowi-steam") + .go(); + } +}; + +/* exported Installer */ +var Installer = Java.extend(org.phoenicis.scripts.Installer, installerImplementation); diff --git a/Applications/Games/The Elder Scrolls III: Morrowind/Lutris Wine Steam/script.json b/Applications/Games/The Elder Scrolls III: Morrowind/Lutris Wine Steam/script.json new file mode 100644 index 0000000000..f996baf538 --- /dev/null +++ b/Applications/Games/The Elder Scrolls III: Morrowind/Lutris Wine Steam/script.json @@ -0,0 +1,11 @@ +{ + "scriptName" : "Lutris Wine Steam", + "id" : "lutris_wine_steam", + "compatibleOperatingSystems" : [ + "LINUX", + "MACOSX" + ], + "testingOperatingSystems" : [], + "free" : false, + "requiresPatch" : false +} diff --git a/Applications/Games/The Elder Scrolls III: Morrowind/application.json b/Applications/Games/The Elder Scrolls III: Morrowind/application.json new file mode 100644 index 0000000000..506865c8ad --- /dev/null +++ b/Applications/Games/The Elder Scrolls III: Morrowind/application.json @@ -0,0 +1,5 @@ +{ + "name" : "The Elder Scrolls III: Morrowind GOTY Edition", + "id" : "the_elder_scrolls_3_morrowind_goty_edition", + "description" : "The Elder Scrolls III: Morrowind Game of the Year Edition includes Morrowind plus all of the content from the Bloodmoon and Tribunal expansions. The original Mod Construction Set is not included in this package." +} diff --git a/Applications/Games/The Elder Scrolls III: Morrowind/miniatures/main.png b/Applications/Games/The Elder Scrolls III: Morrowind/miniatures/main.png new file mode 100644 index 0000000000..3b5037cc6e Binary files /dev/null and b/Applications/Games/The Elder Scrolls III: Morrowind/miniatures/main.png differ diff --git a/Engines/Wine/QuickScript/Lutris Wine Steam Script/script.js b/Engines/Wine/QuickScript/Lutris Wine Steam Script/script.js new file mode 100644 index 0000000000..98e2bc465f --- /dev/null +++ b/Engines/Wine/QuickScript/Lutris Wine Steam Script/script.js @@ -0,0 +1,99 @@ +include(["engines", "wine", "quick_script", "steam_script"]); +include(["utils", "functions", "net", "download"]); +include(["engines", "wine", "engine", "object"]); + +function LutrisWineSteamScript() { + SteamScript.call(this); + this.installerStepsMethods = [] +} + +LutrisWineSteamScript.prototype = Object.create(SteamScript.prototype); + +LutrisWineSteamScript.prototype.constructor = LutrisWineSteamScript; + +LutrisWineSteamScript.prototype.slug = function (slug) { + this._slug = slug; + return this; +} + +LutrisWineSteamScript.prototype.fetchScript = function () { + var url = "https://lutris.net/api/installers/" + this._slug + "?format=json"; + return new Downloader().url(url).json(); +} + +LutrisWineSteamScript.prototype._setBasicInformation = function (scriptContent) { + this.appId(scriptContent["script"]["game"]["steamid"]); + this.name(scriptContent["name"]); + this.author(scriptContent["user"]); +} + +LutrisWineSteamScript.prototype._setArchitecture = function (scriptContent) { + if (scriptContent["script"]["game"]["arch"] && scriptContent["script"]["game"]["arch"] === "win64") { + this.wineArchitecture("amd64"); + } + this.appId(scriptContent["script"]["game"]["steamid"]); +} + +LutrisWineSteamScript.prototype._setArguments = function (scriptContent) { + if (scriptContent["script"]["game"]["args"]) { + this.arguments(scriptContent["script"]["game"]["args"].split(" ")); + } +} + +LutrisWineSteamScript.prototype._evalInstallerSteps = function (scriptContent) { + if (scriptContent["script"]["game"]["installer"]) { + scriptContent["script"]["game"]["installer"].forEach(function (installerStep) { + this.installerStepsMethods.add(function (wine, wizard) { + this._evalInstallerStep(installerStep, wine, wizard) + }) + }) + } +} + +LutrisWineSteamScript.prototype._evalInstallerStep = function (installerStep, wine, wizard) { + if (installerStep["task"] && installerStep["task"]["name"] === "winetricks") { + var verb = nstallerStep["task"]["app"]; + + // TODO + } +} + + + +LutrisWineSteamScript.prototype._evalOverrides = function (scriptContent) { + if (scriptContent["script"]["winesteam"]) { + var overrides = scriptContent["script"]["winesteam"]["overrides"]; + if (overrides) { + Object.keys(scriptContent["script"]["winesteam"]["overrides"]).forEach(function (dll) { + var dllStatus = overrides[dll]; + + this.installerStepsMethods.add(function (wine, wizard) { + wine.overrideDLL() + .set(dllStatus, [dll]) + .do(); + }) + }) + } + } +} + + +LutrisWineSteamScript.prototype.go = function () { + var scriptContent = this.fetchScript()["results"][0]; + + this._setBasicInformation(scriptContent); + this._setArchitecture(scriptContent); + this._setArguments(scriptContent); + this._evalInstallerSteps(scriptContent); + this._evalOverrides(scriptContent); + + this.editor(""); + + this.postInstall(function (wine, wizard) { + this.installerStepsMethods.forEach(function (taskMethod) { + taskMethod(wine, wizard); + }) + }); + + SteamScript.prototype.go.call(this); +} diff --git a/Engines/Wine/QuickScript/Lutris Wine Steam Script/script.json b/Engines/Wine/QuickScript/Lutris Wine Steam Script/script.json new file mode 100644 index 0000000000..560325db31 --- /dev/null +++ b/Engines/Wine/QuickScript/Lutris Wine Steam Script/script.json @@ -0,0 +1,14 @@ +{ + "scriptName" : "Lutris Wine Steam Script", + "id" : "lutris_wine_steam_script", + "compatibleOperatingSystems" : [ + "MACOSX", + "LINUX" + ], + "testingOperatingSystems" : [ + "MACOSX", + "LINUX" + ], + "free" : true, + "requiresPatch" : false +}