Posted 18 November 2013 - 04:49 PM
Well I am currently re-coding my OS and I have run into a slight issue. I am making an icon that is suppose to be a shell. Basically its a black rectangle with "> Shell" printed on the top right to make it look like a real shell. All of this is within a while loop to check for mouse_click. My question is how can I make that text that was printed ontop of the image change like so. So first state would be "> Shell" the other state would be " Shell" as to simulate blinking.
It wouldnt be much of a problem. Just put it in a while loop with the states as a variable and whether the state is 1 or 0 then the text would be in that state. The problem is that when put into a while loop thats checking for mouse_click it simply doesn't work.
Yes it is indented in my editor, for some reason the website didn't like it:(
It wouldnt be much of a problem. Just put it in a while loop with the states as a variable and whether the state is 1 or 0 then the text would be in that state. The problem is that when put into a while loop thats checking for mouse_click it simply doesn't work.
Yes it is indented in my editor, for some reason the website didn't like it:(
Spoiler
local blink = 1
while true do
local event, button, x, y = os.pullEvent()
if blink == 1 then
drawShellIconBlinkOne()
local blink = 2
elseif blink == 2 then
drawShellIconBlinkTwo()
local blink = 1
else
error("Unknown blink. Please report this to DarkenedEvil")
end
if event == "mouse_click" then
if x >= 3 and x <= 8 and y == 1 and button == 1 then --DropDown
drawDropDown()
while true do
local event, button, x, y = os.pullEvent()
if event == "mouse_click" then
if x >= 1 and x <= 8 and y == 3 and button == 1 then --Update
--os.run({}, "update")
elseif x >= 1 and x <= 8 and y == 4 and button == 1 then --Settings
elseif x >= 1 and x <= 8 and y == 5 and button == 1 then --about
drawBackGround()
drawAbout()
while true do
local event, button, x, y = os.pullEvent()
if event == "mouse_click" then
if x == 40 and y == 5 and button == 1 then --close box
drawBackGround()
break
end
end
end
break
elseif x >= 1 and x <= 8 and y == 6 and button == 1 then --credits
drawBackGround()
drawCredits()
while true do
local event, button, x, y = os.pullEvent()
if event == "mouse_click" then
if x == 46 and y == 5 and button == 1 then --close box
drawBackGround()
break
end
end
end
break
elseif x >= 1 and x <= 8 and y == 7 and button == 1 then --Logout
os.reboot()
elseif x >= 1 and x <= 8 and y == 8 and button == 1 then --shutdown
os.shutdown()
elseif x >= 1 and x <= 7 and y == 1 and button == 1 then
drawBackGround()
break
end
end
end
else
drawBackGround()
end
if x >= 37 and x <= 45 and y >= 5 and y <= 15 and button == 1 then --Usercontrol
os.run({}, "usercontrol", tArgs[1])
elseif x >= 1 and x <= 8 and y <=8 and y >= 7 and button == 1 then --FileBrowser
os.run({}, "filebrowser")
elseif x >= 1 and x <= 8 and y <= 10 and y >= 10 and button == 1 then --Shell
os.run({["shell"] = shell}, "luaide", "luaide", username)
elseif x >=1 and x <= 8 and y <=5 and y >=4 and button == 1 then --AppCenter
if Alert == true then
drawBackGround()
Alert = false
else
drawAlert("Comming Soon!")
Alert = true
end
else
--drawBackGround()
end
end
end
Edited on 18 November 2013 - 03:50 PM