EBANOE GOVNISHE

This commit is contained in:
igor 2018-01-08 04:29:35 +03:00
parent 833c1eb406
commit 0b548bee36
2 changed files with 22 additions and 6 deletions

View File

@ -487,7 +487,7 @@
type="Application",
icon="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Camera/Icon.pic",
createShortcut=true,
version=1.06,
version=1.07,
},
{
path="/MineOS/Applications/3DTest",

View File

@ -80,10 +80,6 @@ autoupdateSlider.hidden = true
local FOVSlider = layout:addChild(GUI.slider(1, 1, 12, 0x66DB80, 0x0, 0xFFFFFF, 0x666666, 10, 90, 90, false, "FOV: ", ""))
local rangeSlider = layout:addChild(GUI.slider(1, 1, 12, 0x66DB80, 0x0, 0xFFFFFF, 0x666666, 0, 60, 32, false, "Range: ", ""))
local buttonImage = image.load(fs.path(getCurrentScript()) .. "/Resources/Icon.pic")
local buttonImagePressed = image.blend(buttonImage, 0x0, 0.6)
local shootButton = window:addChild(GUI.adaptiveTexturedButton(1, 1, buttonImage, buttonImagePressed))
local cameraView = window:addChild(GUI.object(window.backgroundPanel.width + 1, 1, 1, 1))
cameraView.pixels = {}
@ -109,6 +105,27 @@ local function takePicture()
buffer.draw()
end
local buttonImage = image.load(fs.path(getCurrentScript()) .. "/Resources/Icon.pic")
local buttonImagePressed = image.blend(buttonImage, 0x0, 0.6)
local shootButton = window:addChild(GUI.object(1, 1, 8, 4))
shootButton.draw = function()
buffer.image(shootButton.x, shootButton.y, shootButton.pressed and buttonImagePressed or buttonImage)
end
shootButton.eventHandler = function(mainContainer, object, eventData)
if eventData[1] == "touch" then
shootButton.pressed = true
mainContainer:draw()
buffer.draw()
takePicture()
shootButton.pressed = false
mainContainer:draw()
buffer.draw()
end
end
cameraView.draw = function(cameraView)
local x, y = 0, 0
for y = 1, #cameraView.pixels do
@ -138,7 +155,6 @@ window.actionButtons:moveToFront()
semiPixelSwitch.onStateChanged = takePicture
FOVSlider.onValueChanged = takePicture
shootButton.onTouch = takePicture
paletteSwitch.onStateChanged = function()
palette = paletteSwitch.state and thermal or grayscale