Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. setupBookingButton = (activateRouteFunction,deactivateRouteFunction,flashFunction,routeFlash,flashButtonOutAnimation,flashButtonInAnimation,routeButton,routeButtonText,routeGradient,routeShadow,routeColor,laterPauseVanFunction,laterHideRouteFunction,startVanFunction,showRouteFunction) ->
  2. debugPrint("Setting canContinue to false.")
  3. canContinue = false
  4.  
  5. #Animate button, its flash effect and its text
  6. Utils.delay 1.25,->
  7. canContinue = true
  8. debugPrint("Starting flash animations, setting canContinue to true.")
  9. flashButtonInAnimation.stop()
  10. flashButtonOutAnimation.stop()
  11. flashButtonOutAnimation.start()
  12. flashBookPromptIn.stop()
  13. flashBookPromptOut.stop()
  14. flashBookPromptOut.start()
  15.  
  16. debugPrint("Animating routeButton.")
  17.  
  18. if suggestRouteIsActive is false
  19. debugPrint("Suggest route is not active.")
  20. routeButton.animate
  21. backgroundColor: null
  22. gradient: routeGradient
  23. shadowY: 0
  24. shadowColor: routeShadow+"1)"
  25. shadowBlur: 10
  26. options:
  27. time:.25
  28. if lastButtonIsSuggest is null
  29. debugPrint("Suggest route is not active+last button is not suggest, proceeding normally.")
  30. activateRouteFunction()
  31. #Flash route and hide others
  32. flashFunction()
  33. routeFlash.opacity=1
  34. routeButtonText.animate
  35. color: "white"
  36. shadowColor: "rgba(0,0,0,0.1)"
  37. options:
  38. time:.25
  39. else
  40. debugPrint("Last button is suggest, fuck")
  41. else
  42. debugPrint("Suggest route is active, setting up for suggest route.")
  43. lastButtonIsSuggest = true
  44. bookPrompt.text = "SUGGEST ROUTE"
  45. suggestRouteIconColor.animate
  46. backgroundColor: "white"
  47. options:
  48. time:.25
  49. hideAllRoutes()
  50. pauseAllVans()
  51.  
  52. debugPrint("Placing and animating book prompt.")
  53. #Place bookPrompt into place and setup
  54. bookPrompt.props=
  55. color: routeColor
  56. opacity:0
  57. x:routeButton.x-16
  58. y:routeButton.y+51
  59. bookPrompt.animate
  60. y: 46
  61. opacity: 1
  62. options:
  63. time: 0.25
  64. curve: Bezier.ease
  65.  
  66. #If a button has already been selected...
  67. if buttonIsSelected is true
  68. debugPrint("A button has already been selected.")
  69. #Special stuff for suggestRouteButton
  70. if suggestRouteIsActive is false
  71. debugPrint("Suggest route not active, proceeding normal.")
  72. if lastButtonIsSuggest is null
  73. debugPrint("Last button is not suggest, proceeding normal.")
  74. hideRouteFunction()
  75. pauseVanFunction()
  76. startVanFunction()
  77. showRouteFunction()
  78. lastRouteFlash.opacity=0
  79. lastRouteButtonText.animate
  80. color: lastRouteColor
  81. shadowColor: "rgba(0,0,0,0)"
  82. options:
  83. time:.25
  84. else
  85. debugPrint("Last button IS suggest, continuing with suggest button syntax.")
  86. suggestRouteIconColor.animate
  87. backgroundColor: highlightColor
  88. options:
  89. time:.25
  90. routeButtonText.animate
  91. color: "white"
  92. shadowColor: "rgba(0,0,0,0)"
  93. options:
  94. time:.25
  95. lastRouteButton.animate
  96. lastRouteButtonText.animate
  97. color: "white"
  98. shadowColor: "rgba(0,0,0,0)"
  99. options:
  100. time:.25
  101. else
  102. debugPrint("Suggest route is active, setting lastButtonIsSuggest to TRUE.")
  103. lastButtonIsSuggest = true
  104. lastDeactivateRouteFunction()
  105.  
  106. #Start vans for route, show this route
  107.  
  108. #If not...
  109. else
  110. debugPrint("A button hasn't been selected yet, animating view down.")
  111. buttonIsSelected = true
  112. hideAllRoutes()
  113. pauseAllVans()
  114. if suggestRouteIsActive is false
  115. debugPrint("Suggest route is not active, starting vans and showing route.")
  116. startVanFunction()
  117. showRouteFunction()
  118. for layer, i in routeBarObjects
  119. layer.animate
  120. y:layer.y-38
  121. options:
  122. time:.5
  123. curve: Spring
  124. instructionBar.animate
  125. opacity: 0
  126. options:
  127. time:.2
  128. routeBar.animate
  129. height: 161
  130. y:651
  131. options:
  132. time:.5
  133. curve: Spring
  134. deactivateSuggestRoute()
  135.  
  136. #bookPrompt.text = "TAP TO BOOK"
  137. #Switch "current" infnormation to "past"
  138. lastRouteFlash = routeFlash
  139. lastRouteButton = routeButton
  140. lastRouteButtonText = routeButtonText
  141. lastRouteColor = routeColor
  142. lastDeactivateRouteFunction = deactivateRouteFunction
  143. hideRouteFunction = laterHideRouteFunction
  144. pauseVanFunction = laterPauseVanFunction
  145. Utils.delay 1,->
  146. suggestRouteIsActive = false
  147.  
  148.  
  149.  
  150.  
  151. ###
  152. USING THE FUNCTION:
  153. ###
  154.  
  155. #Angelino:
  156. angelinoRouteButton.on Events.Click,->
  157. #Make sure its not activated by scrolling
  158. if routesAreScrolling is false
  159. if canContinue is true
  160. setupBookingButton(activateAngelino,deactivateAngelino,flashAngelino,angelinoFlash,flashAngelinoButtonOut,flashAngelinoButtonIn,angelinoRouteButton,angelinoRouteButtonText,angelinoGradient,angelinoShadow,angelinoColor,pauseAngelinoVans,hideAngelinoRoute,startAngelinoVans,showAngelinoRoute)
  161. else
  162. debugPrint("Double animation prevented")
  163. else
  164. currentRoute = "angelino"
  165. setupStartPointScreen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement