This commit is contained in:
Ryan Ward 2018-02-16 18:40:39 -05:00
commit 5052df632d
3 changed files with 37 additions and 24 deletions

View File

@ -1,6 +1,6 @@
LOAD gamedata/lobby.txt
[CONFIG]{
//newThread("THREAD") // Starts a thread that handles events and stuff... Just throw this in and things flow nicely
newThread("THREAD") // Starts a thread that handles events and stuff... Just throw this in and things flow nicely
SND_ELEVATOR_BG=loadAudio("audio/elevator.ogg")
SND_ELEVATOR_OPEN_CLOSE=loadAudio("audio/elevator_open_close.mp3")
SND_ROPE_CRACKING=loadAudio("audio/rope_cracking.mp3")

View File

@ -3,6 +3,8 @@
//SND_ROPE_CRACKING
//SND_FOOTSTEPS
[LOBBY]{
name=getInput("What is your name: ")
"Yo $name$ enjoy the game"
BG("images/elevator-lobby.jpg")
"Abby: Oh no I'm running late!"
"Abby: I hope I make my interview"

View File

@ -20,11 +20,6 @@ parseManager:define{
inputBox.message.text=msg
inputBox.Visible=true
go.Visible=false
self.handle:Pause()
while _inputvar==nil do
multi:lManager()
end
self.handle:Resume()
local i=_inputvar
_inputvar=nil
inputBox.Visible=false
@ -59,9 +54,6 @@ parseManager:define{
end
end,
sleep=function(self,n)
local num=n
self.handle:hold(num)
end,
fadeSong=function(self,item)
self.handle:Pause()
local handle=self:varExists(item)
@ -142,12 +134,10 @@ parseManager:define{
item:Reset()
end,
setImage=function(self,item,path)
smartPrint(item)
item:SetImage(path)
end,
setText=function(self,item,text)
if type(item)=="string" then
print(actor)
self:pushError("item must be a gui object!")
end
item.text=text
@ -188,11 +178,6 @@ parseManager:define{
local ThreadTest=parseManager:load(blocklink.chunks[block].path)
ThreadTest.mainENV=blocklink.mainENV
ThreadTest.handle=loop
ThreadTest:define{
sleep=function(self,n)
thread.sleep(n)
end
}
local t=ThreadTest:next(block)
while true do
if t.Type=="text" then
@ -219,7 +204,6 @@ core.chatFrame.textHolder.Visibility=0
core.chatFrame.textHolder.text=""
core.chatFrame.textHolder.TextFormat="left"
test=parseManager:load("init.txt")
table.print(test)
--~ print("DUMP:")
dump=test:dump()
print(dump)
@ -228,8 +212,9 @@ test.mainENV["gui"]=workspace
test.mainENV["menu"]=top
go=core.chatFrame.textHolder:newImageButton("images/arrow.png",-25,-25,20,20,1,1)
go:OnReleased(function(b,self)
dialogeHandler:Resume()
ready=true
end)
<<<<<<< HEAD
multi:newLoop(function()
love.timer.sleep(.005)
end)
@ -255,13 +240,39 @@ dialogeHandler=multi:newLoop(function(self,ti)
self:Pause()
while choicemade==nil do
multi:lManager()
=======
--dialogeHandler=multi:newLoop(function(self,ti)
ready=false
multi:newThread("TextHandler",function()
while true do
t=test:next()
if t.Type=="text" then
core.chatFrame.textHolder.text=t.text
ready=false
thread.hold(function() return ready==true end)
elseif t.Type=="choice" then
go.Visible=false
local choiceframe=gui:newFrame("",0,0,300,(#t+1)*40-10)
choiceframe:newTextLabel(t.prompt,0,0,0,40,0,0,1).Color=Color.light_blue
for i=1,#t[1] do
local choice=choiceframe:newTextButton(t[1][i],0,i*40,0,40,0,0,1)
choice.Color=Color.Darken(Color.saddle_brown,.15)
choice.index=i
choice:OnReleased(function(b,self)
choicemade=self.index
end)
end
self:Resume()
choiceframe:centerX()
choiceframe:centerY()
thread.hold(function() return choicemade~=nil end)
go.Visible=true
choiceframe:Destroy()
local cm=choicemade
choicemade=nil
t=test:next(nil,cm)
>>>>>>> f21e52b15e277c0c2e38911bef7539d33f4f02d5
end
thread.sleep(.001)
end
end)
test.handle=dialogeHandler