diff --git a/interface/kukagps/kukadatetime.config b/interface/kukagps/kukadatetime.config deleted file mode 100644 index aebce246a3..0000000000 --- a/interface/kukagps/kukadatetime.config +++ /dev/null @@ -1,65 +0,0 @@ -{ - "gui" : { - "background" : { - "zlevel" : 0, - "type" : "background", - "fileHeader" : "/interface/kukagps/craftingheader.png", - "fileBody" : "/interface/kukagps/body.png", - "fileFooter" : "/interface/kukagps/craftingfooter.png" - }, - - "windowtitle" : { - "type" : "title", - "title" : " GPS", - "subtitle" : " Information about the terrain", - "icon" : { - "type" : "image", - "file" : "/interface/techupgradeicon.png", - "zlevel" : -1 - } - }, - - "close" : { - "type" : "button", - "base" : "/interface/x.png", - "hover" : "/interface/xhover.png", - "press" : "/interface/xpress.png", - //position: horizontal, vertical - "position" : [391, 278] - }, - - "materialList" : { - "type" : "scrollArea", - "rect" : [9, 56, 394, 250], - "children" : { - "materials" : { - "type" : "list", - "schema" : { - "selectedBG" : "/interface/kukagps/materialbg.png", - "unselectedBG" : "/interface/kukagps/materialbg.png", - "spacing" : [0, 1], - "memberSize" : [380, 20], - "listTemplate" : { - //"background" : { - // "type" : "image", - // "file" : "/interface/kukagps/materialbg.png", - // "position" : [2, 0], - // "zlevel" : -1 - //}, - "text" : { - "type" : "label", - "position" : [12, 10], - "hAnchor" : "left", - "vAnchor" : "mid", - "wrapWidth" : 370, - "value" : "Something is broken...." - } - } - } - } - } - } - }, - "scripts" : ["/interface/kukagps/kukadatetime.lua"], - "scriptDelta" : 30 -} diff --git a/interface/kukagps/kukadatetime.lua b/interface/kukagps/kukadatetime.lua deleted file mode 100644 index 07746bb873..0000000000 --- a/interface/kukagps/kukadatetime.lua +++ /dev/null @@ -1,160 +0,0 @@ --- THIS IS THE FRACKIN RACES ONE -require "/scripts/util.lua" - -MATERIALS = "materialList.materials" - -function init() - populateMaterialsList() -end - -function populateMaterialsList() - widget.clearListItems(MATERIALS) - local worldId = string_split(player.worldId(),":") - local planet = {location = {tonumber(worldId[2]),tonumber(worldId[3]),tonumber(worldId[4])}, planet = tonumber(worldId[5]), satellite = (tonumber(worldId[6]) or 0)} - if worldId[1]=="InstanceWorld" then - local path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "This is a Instance World. Instance World do not contain relevant GPS data. Please travel to a planet surface.") - -- More info about the dungeon could be added here - else - if worldId[1]=="ClientShipWorld" then - local path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "This is a Ship World. Ship Worlds do not contain relevant GPS data. Please travel to a planet surface.") - -- More info about the ship could be added here - else - if worldId[1]=="CelestialWorld" then - weather =root.assetJson("/interface/kukagps/weather.config") - enviroment =root.assetJson("/interface/kukagps/enviroment.config") - - -- print date - local path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "^green;Date:^reset; "..getDate(world.day())) - - -- print time - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "^green;Time:^reset; "..timeConversion()) - - -- print day length - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "^green;Day Length:^reset; "..math.floor(world.dayLength())) - - -- print light level - local lightLevel = math.floor(world.lightLevel(world.entityPosition(player.id()))*100)/100 - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "^green;Light Level:^reset; "..lightLevel) - - -- print windLevel - local windLevel = math.floor(world.windLevel(world.entityPosition(player.id()))*100)/100 - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "^green;Wind Level:^reset; "..windLevel) - - local parameters = celestial.visitableParameters(planet) - -- print enviroment status effects - local enviro="None" - for _,env in pairs(parameters.environmentStatusEffects) do - if enviro=="None" then - enviro = enviroment[env] or env - else - enviro = enviro..", "..(enviroment[env] or env) - end - end - enviro = enviro.."." - - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "^green;Enviroment Status Effects:^reset; "..enviro) - - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "^green;Weather:^reset; ") - - local weatherItem="None" - local linecount=0 - for _,w in pairs(parameters.weatherPool) do - ww = (w.weight * 100) - if weatherItem=="None" then - weatherItem = (weather[w.item] or w.item).."("..ww.."%)" - else - weatherItem = weatherItem..", "..(weather[w.item] or w.item).."("..ww.."%)" - end - linecount = linecount+1 - if linecount==4 then - -- print line and reset counter - weatherItem = weatherItem.."." - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", " "..weatherItem) - weatherItem = "None" - linecount = 0 - end - end - if linecount ~= 0 then - weatherItem = weatherItem.."." - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", " "..weatherItem) - end - else - local path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "This is a ERROR") - end - end - end -end - -function string_split(str, pat) - local t = {} -- NOTE: use {n = 0} in Lua-5.0 - local fpat = "(.-)" .. pat - local last_end = 1 - local s, e, cap = str:find(fpat, 1) - while s do - if s ~= 1 or cap ~= "" then - table.insert(t, cap) - end - last_end = e+1 - s, e, cap = str:find(fpat, last_end) - end - if last_end <= #str then - cap = str:sub(last_end) - table.insert(t, cap) - end - return t -end - -function timeConversion() - -- Hubnester time conversion function - hubTime = (world.timeOfDay() + 0.25) * 24 -- the 0.25 is to make 0 am = 6 am (when the day starts) - if hubTime > 12 then - hubTime = hubTime - 12 - hubTimeModifier = " pm" - if hubTime > 12 then - hubTime = hubTime - 12 - hubTimeModifier = " am" - if hubTime < 1 then - hubTime = hubTime + 12 - end - elseif hubTime < 1 then - hubTime = hubTime + 12 - end - else - hubTimeModifier = " am" - end - hubHours = math.floor(hubTime, 0) - hubMinutes = math.floor((hubTime - hubHours) * 60) - if hubMinutes < 10 then - hubMinutes = "0" .. tostring(hubMinutes) - end - return tostring(hubHours) .. ":" .. tostring(hubMinutes) .. tostring(hubTimeModifier) -end - -function getDate(days) - local month=1 - local daysperyear=365.242 - local year = math.floor(days / daysperyear) - days = math.floor(days % daysperyear) - local dayspermonth={31,28,31,30,31,30,31,31,30,31,30,31} - if ((year%4)==0) or (((year%100)==0) and ((year%400)==0)) then - dayspermonth={31,29,31,30,31,30,31,31,30,31,30,31} - end - while (days>=dayspermonth[month]) do - days=days-dayspermonth[month] - month=month+1 - end - days=days+1 - return "Year "..year..", Month "..month.." and Day "..days -end diff --git a/interface/kukagps/kukadungeon.config b/interface/kukagps/kukadungeon.config deleted file mode 100644 index 75dc6d7e1a..0000000000 --- a/interface/kukagps/kukadungeon.config +++ /dev/null @@ -1,57 +0,0 @@ -{ - "gui" : { - "background" : { - "zlevel" : 0, - "type" : "background", - "fileHeader" : "/interface/kukagps/craftingheader.png", - "fileBody" : "/interface/kukagps/body.png", - "fileFooter" : "/interface/kukagps/craftingfooter.png" - }, - - "windowtitle" : { - "type" : "title", - "title" : " GPS", - "subtitle" : " Information about the terrain", - "icon" : { - "type" : "image", - "file" : "/interface/techupgradeicon.png", - "zlevel" : -1 - } - }, - - "close" : { - "type" : "button", - "base" : "/interface/x.png", - "hover" : "/interface/xhover.png", - "press" : "/interface/xpress.png", - "position" : [391, 278] - }, - "materialList" : { - "type" : "scrollArea", - "rect" : [9, 56, 394, 250], - "children" : { - "materials" : { - "type" : "list", - "schema" : { - "selectedBG" : "/interface/kukagps/materialbg.png", - "unselectedBG" : "/interface/kukagps/materialbg.png", - "spacing" : [0, 1], - "memberSize" : [380, 20], - "listTemplate" : { - "text" : { - "type" : "label", - "position" : [12, 10], - "hAnchor" : "left", - "vAnchor" : "mid", - "wrapWidth" : 369, - "value" : "Something is broken...." - } - } - } - } - } - } - }, - "scripts" : ["/interface/kukagps/kukadungeon.lua"], - "scriptDelta" : 30 -} diff --git a/interface/kukagps/kukadungeon.lua b/interface/kukagps/kukadungeon.lua deleted file mode 100644 index 7886f18272..0000000000 --- a/interface/kukagps/kukadungeon.lua +++ /dev/null @@ -1,94 +0,0 @@ --- THIS IS THE FRACKIN RACES ONE -require "/scripts/util.lua" - -MATERIALS = "materialList.materials" - -function init() - populateMaterialsList() -end - -function populateMaterialsList() - widget.clearListItems(MATERIALS) - local worldId = string_split(player.worldId(),":") - local planet = {location = {tonumber(worldId[2]),tonumber(worldId[3]),tonumber(worldId[4])}, planet = tonumber(worldId[5]), satellite = (tonumber(worldId[6]) or 0)} - if worldId[1]=="InstanceWorld" then - local path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "This is a Instance World. Instance World do not contain relevant GPS data. Please travel to a planet surface.") - -- More info about the dungeon could be added here - else - if worldId[1]=="ClientShipWorld" then - local path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "This is a Ship World. Ship Worlds do not contain relevant GPS data. Please travel to a planet surface.") - -- More info about the ship could be added here - else - if worldId[1]=="CelestialWorld" then - dungeons =root.assetJson("/interface/kukagps/dungeons.config") - - local path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "^green;Dungeons on Planet:^reset; ") - - local parameters = celestial.visitableParameters(planet) - if (parameters.spaceLayer and parameters.spaceLayer.dungeons) then - for _,dungeon in pairs(parameters.spaceLayer.dungeons) do - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", dungeons[dungeon] or "Unknown["..dungeon.."]") - end - end - if (parameters.atmosphereLayer and parameters.atmosphereLayer.dungeons) then - for _,dungeon in pairs(parameters.atmosphereLayer.dungeons) do - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", dungeons[dungeon] or "Unknown["..dungeon.."]") - end - end - if (parameters.surfaceLayer and parameters.surfaceLayer.dungeons) then - for _,dungeon in pairs(parameters.surfaceLayer.dungeons) do - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", dungeons[dungeon] or "Unknown["..dungeon.."]") - end - end - if (parameters.subsurfaceLayer and parameters.subsurfaceLayer.dungeons) then - for _,dungeon in pairs(parameters.subsurfaceLayer.dungeons) do - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", dungeons[dungeon] or "Unknown["..dungeon.."]") - end - end - if (parameters.undergroundLayers) then - for _,layer in pairs(parameters.undergroundLayers) do - for _,dungeon in pairs(layer.dungeons) do - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", dungeons[dungeon] or "Unknown["..dungeon.."]") - end - end - end - if (parameters.coreLayer and parameters.coreLayer.dungeons) then - for _,dungeon in pairs(parameters.coreLayer.dungeons) do - path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", dungeons[dungeon] or "Unknown["..dungeon.."]") - end - end - else - local path = string.format("%s.%s", MATERIALS, widget.addListItem(MATERIALS)) - widget.setText(path .. ".text", "This is a ERROR") - end - end - end -end - -function string_split(str, pat) - local t = {} -- NOTE: use {n = 0} in Lua-5.0 - local fpat = "(.-)" .. pat - local last_end = 1 - local s, e, cap = str:find(fpat, 1) - while s do - if s ~= 1 or cap ~= "" then - table.insert(t, cap) - end - last_end = e+1 - s, e, cap = str:find(fpat, last_end) - end - if last_end <= #str then - cap = str:sub(last_end) - table.insert(t, cap) - end - return t -end diff --git a/interface/scripted/statWindow/statWindow.config b/interface/scripted/statWindow/statWindow.config index 903d26bfdf..83898d9d57 100644 --- a/interface/scripted/statWindow/statWindow.config +++ b/interface/scripted/statWindow/statWindow.config @@ -224,33 +224,6 @@ "pressed" : "/interface/scripted/statWindow/ui/buttons/button_stats_on.png", "pressedOffset" : [0, 0] }, - //"expandButton10" : { - // "type" : "button", - // "position" : [164, 220],//206 is right-side correct for X - // "callback" : "loadGPS2", - // "base" : "/interface/scripted/statWindow/ui/buttons/currency_button.png", - // "hover" : "/interface/scripted/statWindow/ui/buttons/currency_button_on.png", - // "pressed" : "/interface/scripted/statWindow/ui/buttons/currency_button_on.png", - // "pressedOffset" : [0, 0] - //}, - //"expandButton11" : { - // "type" : "button", - // "position" : [136, 220], - // "callback" : "loadGPS2", - // "base" : "/interface/scripted/statWindow/ui/buttons/dungeon_button.png", - // "hover" : "/interface/scripted/statWindow/ui/buttons/dungeon_button_on.png", - // "pressed" : "/interface/scripted/statWindow/ui/buttons/dungeon_button_on.png", - // "pressedOffset" : [0, 0] - //}, - //"expandButton12" : { - // "type" : "button", - // "position" : [108, 220], - // "callback" : "loadGPS3", - // "base" : "/interface/scripted/statWindow/ui/buttons/clock_button.png", - // "hover" : "/interface/scripted/statWindow/ui/buttons/clock_button_on.png", - // "pressed" : "/interface/scripted/statWindow/ui/buttons/clock_button_on.png", - // "pressedOffset" : [0, 0] - //}, "racialLabel" : { "type" : "label", "zlevel" : 1, @@ -390,7 +363,7 @@ "radiationburnImmunity" : { "name" : "^yellow;Radiation Burn" } }, - "scriptWidgetCallbacks" : [ "expand","loreBook", "mechEquip", "mechFuel", "techBuild", "techEquip", "research","upgradeEquipmentMenu", "loadGPS", "loadGPS2", "loadGPS3" ], + "scriptWidgetCallbacks" : [ "expand","loreBook", "mechEquip", "mechFuel", "techBuild", "techEquip", "research","upgradeEquipmentMenu", "loadGPS" ], "scripts" : ["/interface/scripted/statWindow/statWindow.lua"], "scriptDelta" : 30 } diff --git a/interface/scripted/statWindow/statWindow.lua b/interface/scripted/statWindow/statWindow.lua index b3ea495f9a..ca0203b7e7 100644 --- a/interface/scripted/statWindow/statWindow.lua +++ b/interface/scripted/statWindow/statWindow.lua @@ -86,12 +86,6 @@ end function loadGPS() player.interact("ScriptPane", "/interface/kukagps/kukagps.config", player.id()) end -function loadGPS2() - player.interact("ScriptPane", "/interface/kukagps/kukadungeon.config", player.id()) -end -function loadGPS3() - player.interact("ScriptPane", "/interface/kukagps/kukadatetime.config", player.id()) -end function populateRacialDescription(race,notRecognized) widget.clearListItems("racialDesc.textList")