From bb3075d5ac8182e54b4cfefc2255e1044e1503a4 Mon Sep 17 00:00:00 2001 From: LemADEC Date: Sat, 20 May 2017 12:23:27 +0200 Subject: [PATCH] Integrated accelerator controller LUA scripts --- build.gradle | 13 ++++++------- .../lua.ComputerCraft/warpdriveAccelerator/startup | 12 ++++++------ .../lua.OpenComputers/warpdriveAccelerator/startup | 12 ++++++------ 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index 101a384b..a40ef895 100644 --- a/build.gradle +++ b/build.gradle @@ -37,7 +37,7 @@ targetCompatibility = JavaVersion.VERSION_1_8 minecraft { version = config.minecraft_version + "-" + config.forge_version runDir = "eclipse" - + // replacing replace "@version@", project.version replaceIn "WarpDrive.java" @@ -53,19 +53,18 @@ dependencies { // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env - + // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html - } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version - - // skip source assets + + // skip source assets exclude '**/*.pdn' exclude '**/*.psd' @@ -86,7 +85,7 @@ processResources { //copies the commons folder to all instances task copyOpenComputersCommons1(type: Copy) { from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common' - into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveShipController') + into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveShipController') } task copyOpenComputersCommons2(type: Copy) { from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common' @@ -98,7 +97,7 @@ task copyOpenComputersCommons3(type: Copy) { } task copyOpenComputersCommons4(type: Copy) { from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common' - into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveAcceleratorController') + into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveAccelerator') } jar { diff --git a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveAccelerator/startup b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveAccelerator/startup index 7e0c6e72..cf054295 100644 --- a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveAccelerator/startup +++ b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveAccelerator/startup @@ -115,7 +115,7 @@ function lhc_page_parameter() local controlChannel, isEnabled, threshold, description = lhc_parameter_get(indexSelected) w.writeLn("Control channel #" .. w.format_integer(controlChannel, 9) .. " applies to:") for key, controlPoint in ipairs(lhc_controlPoints) do - local cp_x, cp_y, cp_z, cp_tier, cp_type, cp_isEnabled, cp_controlChannel = unpack(controlPoint) + local cp_x, cp_y, cp_z, cp_tier, cp_type, cp_isEnabled, cp_controlChannel = table.unpack(controlPoint) if cp_controlChannel == controlChannel then w.write(string.format("%s %s @%s %s %s ", w.format_string(cp_type, 10), @@ -134,7 +134,7 @@ function lhc_page_parameter() description = w.input_readText(description) w.writeLn("") - w.writeLn("Current theshold is " .. (threshold * 100) .. "%") + w.writeLn("Current threshold is " .. (threshold * 100) .. "%") w.write("Enter parameter threshold: ") local new_threshold = w.input_readNumber(threshold * 100) / 100 threshold = math.min(2.0, math.max(0.0, new_threshold)) @@ -170,7 +170,7 @@ function lhc_parameter_get(index) lhc_boot(false) w.status_showWarning("Invalid parameter at index " .. index) else - controlChannel, isEnabled, threshold, description = unpack(parameter) + controlChannel, isEnabled, threshold, description = table.unpack(parameter) end return controlChannel, isEnabled, threshold, description end @@ -232,7 +232,7 @@ function lhc_page() else w.setColorDisabled(); end - w.writeLn(math.floor(energy / energyMax * 100) .. " % (" .. energy .. "EU)") + w.writeLn(math.floor(energy / energyMax * 100) .. " % (" .. energy .. " EU)") -- w.writeLn("") w.setColorNormal(); @@ -244,9 +244,9 @@ function lhc_page() else w.setColorDisabled(); end - w.write(string.format("%fK", math.floor(temperatureCurrent_K * 10) / 10)) + w.write(string.format("%.1f K", math.floor(temperatureCurrent_K * 10) / 10)) w.setColorNormal(); - w.writeLn(". Target is " .. temperatureTarget_K .. "K") + w.writeLn(". Target is " .. temperatureTarget_K .. " K") -- w.writeLn("") w.write("Parameters: ") diff --git a/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveAccelerator/startup b/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveAccelerator/startup index e9efed06..9498fe8b 100644 --- a/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveAccelerator/startup +++ b/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveAccelerator/startup @@ -114,7 +114,7 @@ function lhc_page_parameter() local controlChannel, isEnabled, threshold, description = lhc_parameter_get(indexSelected) w.writeLn("Control channel #" .. w.format_integer(controlChannel, 9) .. " applies to:") for key, controlPoint in ipairs(lhc_controlPoints) do - local cp_x, cp_y, cp_z, cp_tier, cp_type, cp_isEnabled, cp_controlChannel = unpack(controlPoint) + local cp_x, cp_y, cp_z, cp_tier, cp_type, cp_isEnabled, cp_controlChannel = table.unpack(controlPoint) if cp_controlChannel == controlChannel then w.write(string.format("%s %s @%s %s %s ", w.format_string(cp_type, 10), @@ -133,7 +133,7 @@ function lhc_page_parameter() description = w.input_readText(description) w.writeLn("") - w.writeLn("Current theshold is " .. (threshold * 100) .. "%") + w.writeLn("Current threshold is " .. (threshold * 100) .. "%") w.write("Enter parameter threshold: ") local new_threshold = w.input_readNumber(threshold * 100) / 100 threshold = math.min(2.0, math.max(0.0, new_threshold)) @@ -169,7 +169,7 @@ function lhc_parameter_get(index) lhc_boot(false) w.status_showWarning("Invalid parameter at index " .. index) else - controlChannel, isEnabled, threshold, description = unpack(parameter) + controlChannel, isEnabled, threshold, description = table.unpack(parameter) end return controlChannel, isEnabled, threshold, description end @@ -231,7 +231,7 @@ function lhc_page() else w.setColorDisabled(); end - w.writeLn(math.floor(energy / energyMax * 100) .. " % (" .. energy .. "EU)") + w.writeLn(math.floor(energy / energyMax * 100) .. " % (" .. energy .. " EU)") -- w.writeLn("") w.setColorNormal(); @@ -243,9 +243,9 @@ function lhc_page() else w.setColorDisabled(); end - w.write(string.format("%fK", math.floor(temperatureCurrent_K * 10) / 10)) + w.write(string.format("%.1f K", math.floor(temperatureCurrent_K * 10) / 10)) w.setColorNormal(); - w.writeLn(". Target is " .. temperatureTarget_K .. "K") + w.writeLn(". Target is " .. temperatureTarget_K .. " K") -- w.writeLn("") w.write("Parameters: ")