Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setupBookingButton = (activateRouteFunction,deactivateRouteFunction,flashFunction,routeFlash,flashButtonOutAnimation,flashButtonInAnimation,routeButton,routeButtonText,routeGradient,routeShadow,routeColor,laterPauseVanFunction,laterHideRouteFunction,startVanFunction,showRouteFunction) ->
- debugPrint("Setting canContinue to false.")
- canContinue = false
- #Animate button, its flash effect and its text
- Utils.delay 1.25,->
- canContinue = true
- debugPrint("Starting flash animations, setting canContinue to true.")
- flashButtonInAnimation.stop()
- flashButtonOutAnimation.stop()
- flashButtonOutAnimation.start()
- flashBookPromptIn.stop()
- flashBookPromptOut.stop()
- flashBookPromptOut.start()
- debugPrint("Animating routeButton.")
- if suggestRouteIsActive is false
- debugPrint("Suggest route is not active.")
- routeButton.animate
- backgroundColor: null
- gradient: routeGradient
- shadowY: 0
- shadowColor: routeShadow+"1)"
- shadowBlur: 10
- options:
- time:.25
- if lastButtonIsSuggest is null
- debugPrint("Suggest route is not active+last button is not suggest, proceeding normally.")
- activateRouteFunction()
- #Flash route and hide others
- flashFunction()
- routeFlash.opacity=1
- routeButtonText.animate
- color: "white"
- shadowColor: "rgba(0,0,0,0.1)"
- options:
- time:.25
- else
- debugPrint("Last button is suggest, fuck")
- else
- debugPrint("Suggest route is active, setting up for suggest route.")
- lastButtonIsSuggest = true
- bookPrompt.text = "SUGGEST ROUTE"
- suggestRouteIconColor.animate
- backgroundColor: "white"
- options:
- time:.25
- hideAllRoutes()
- pauseAllVans()
- debugPrint("Placing and animating book prompt.")
- #Place bookPrompt into place and setup
- bookPrompt.props=
- color: routeColor
- opacity:0
- x:routeButton.x-16
- y:routeButton.y+51
- bookPrompt.animate
- y: 46
- opacity: 1
- options:
- time: 0.25
- curve: Bezier.ease
- #If a button has already been selected...
- if buttonIsSelected is true
- debugPrint("A button has already been selected.")
- #Special stuff for suggestRouteButton
- if suggestRouteIsActive is false
- debugPrint("Suggest route not active, proceeding normal.")
- if lastButtonIsSuggest is null
- debugPrint("Last button is not suggest, proceeding normal.")
- hideRouteFunction()
- pauseVanFunction()
- startVanFunction()
- showRouteFunction()
- lastRouteFlash.opacity=0
- lastRouteButtonText.animate
- color: lastRouteColor
- shadowColor: "rgba(0,0,0,0)"
- options:
- time:.25
- else
- debugPrint("Last button IS suggest, continuing with suggest button syntax.")
- suggestRouteIconColor.animate
- backgroundColor: highlightColor
- options:
- time:.25
- routeButtonText.animate
- color: "white"
- shadowColor: "rgba(0,0,0,0)"
- options:
- time:.25
- lastRouteButton.animate
- lastRouteButtonText.animate
- color: "white"
- shadowColor: "rgba(0,0,0,0)"
- options:
- time:.25
- else
- debugPrint("Suggest route is active, setting lastButtonIsSuggest to TRUE.")
- lastButtonIsSuggest = true
- lastDeactivateRouteFunction()
- #Start vans for route, show this route
- #If not...
- else
- debugPrint("A button hasn't been selected yet, animating view down.")
- buttonIsSelected = true
- hideAllRoutes()
- pauseAllVans()
- if suggestRouteIsActive is false
- debugPrint("Suggest route is not active, starting vans and showing route.")
- startVanFunction()
- showRouteFunction()
- for layer, i in routeBarObjects
- layer.animate
- y:layer.y-38
- options:
- time:.5
- curve: Spring
- instructionBar.animate
- opacity: 0
- options:
- time:.2
- routeBar.animate
- height: 161
- y:651
- options:
- time:.5
- curve: Spring
- deactivateSuggestRoute()
- #bookPrompt.text = "TAP TO BOOK"
- #Switch "current" infnormation to "past"
- lastRouteFlash = routeFlash
- lastRouteButton = routeButton
- lastRouteButtonText = routeButtonText
- lastRouteColor = routeColor
- lastDeactivateRouteFunction = deactivateRouteFunction
- hideRouteFunction = laterHideRouteFunction
- pauseVanFunction = laterPauseVanFunction
- Utils.delay 1,->
- suggestRouteIsActive = false
- ###
- USING THE FUNCTION:
- ###
- #Angelino:
- angelinoRouteButton.on Events.Click,->
- #Make sure its not activated by scrolling
- if routesAreScrolling is false
- if canContinue is true
- setupBookingButton(activateAngelino,deactivateAngelino,flashAngelino,angelinoFlash,flashAngelinoButtonOut,flashAngelinoButtonIn,angelinoRouteButton,angelinoRouteButtonText,angelinoGradient,angelinoShadow,angelinoColor,pauseAngelinoVans,hideAngelinoRoute,startAngelinoVans,showAngelinoRoute)
- else
- debugPrint("Double animation prevented")
- else
- currentRoute = "angelino"
- setupStartPointScreen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement