diff --git a/Applications.cfg b/Applications.cfg index 6f0d8a02..e5440f51 100644 --- a/Applications.cfg +++ b/Applications.cfg @@ -830,7 +830,7 @@ type="Application", icon="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Stargate/Icon.pic", createShortcut=true, - version=1.13, + version=1.14, resources={ { path="/Ch1.pic", diff --git a/Applications/Stargate/Main.lua b/Applications/Stargate/Main.lua index 7fcde2c1..16f4955f 100755 --- a/Applications/Stargate/Main.lua +++ b/Applications/Stargate/Main.lua @@ -22,7 +22,6 @@ local contacts = {} local Ch1Image = image.load(resources .. "Ch1.pic") local Ch2Image = image.load(resources .. "Ch2.pic") -buffer.flush() local mainContainer = GUI.fullScreenContainer() --------------------------------------------------------------------------------------------- @@ -141,8 +140,14 @@ end --------------------------------------------------------------------------------------------- +local width, height = 32, 37 +local x, y = mainContainer.width - width - 3, math.floor(mainContainer.height / 2 - height / 2) + mainContainer:addChild(GUI.panel(1, 1, mainContainer.width, mainContainer.height, 0x1E1E1E)) + mainContainer.SGImage = mainContainer:addChild(GUI.image(1, 1, image.load(resources .. "OffOff.pic"))) +mainContainer.SGImage.localX, mainContainer.SGImage.localY = math.floor((x - 2) / 2 - image.getWidth(mainContainer.SGImage.image) / 2), mainContainer.height - image.getHeight(mainContainer.SGImage.image) + 1 + mainContainer.chevronsContainer = mainContainer:addChild(GUI.container(mainContainer.SGImage.localX, mainContainer.SGImage.localY, mainContainer.SGImage.width, mainContainer.SGImage.height)) mainContainer.chevrons = {} addChevron(13, 30) @@ -153,12 +158,6 @@ addChevron(72, 6) addChevron(83, 17) addChevron(79, 30) -local width, height = 32, 37 -local x, y = mainContainer.width - width - 3, math.floor(mainContainer.height / 2 - height / 2) - -mainContainer.SGImage.localX, mainContainer.SGImage.localY = math.floor((x - 2) / 2 - image.getWidth(mainContainer.SGImage.image) / 2), mainContainer.height - image.getHeight(mainContainer.SGImage.image) + 1 -mainContainer.chevronsContainer.localPosition = mainContainer.SGImage.localPosition - mainContainer:addChild(newThing(mainContainer.SGImage.localX + mainContainer.SGImage.width, y, mainContainer.width - mainContainer.SGImage.localX - mainContainer.SGImage.width - width - 7, height)) mainContainer:addChild(GUI.label(x, y, width, 1, 0xEEEEEE, "Stargate " .. stargate.localAddress())):setAlignment(GUI.alignment.horizontal.center, GUI.alignment.vertical.top); y = y + 1 @@ -312,8 +311,9 @@ loadContacts() updateContacts() update() updateChevrons(stargate.stargateState() == "Connected") + mainContainer:draw() -buffer.draw() +buffer.draw(true) mainContainer:startEventHandling()