Advertisement
Guest User

Untitled

a guest
Dec 7th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 60.77 KB | None | 0 0
  1. --[[
  2. Basically rewriting the c++ code to not be total shit so this can also not be total shit.
  3. ]]
  4.  
  5. local jcKeys = tableKeys(colorConfig:get_data().judgment)
  6. local jcT = {} -- A "T" following a variable name will designate an object of type table.
  7.  
  8. for i=1, #jcKeys do
  9. jcT[jcKeys[i]] = byJudgment(jcKeys[i])
  10. end
  11.  
  12. local jdgT = { -- Table of judgments for the judgecounter
  13. "TapNoteScore_W1",
  14. "TapNoteScore_W2",
  15. "TapNoteScore_W3",
  16. "TapNoteScore_W4",
  17. "TapNoteScore_W5",
  18. "TapNoteScore_Miss",
  19. "HoldNoteScore_Held",
  20. "HoldNoteScore_LetGo",
  21. }
  22.  
  23. local dvCur
  24. local jdgCur -- Note: only for judgments with OFFSETS, might reorganize a bit later
  25. local positive = getMainColor("positive")
  26. local highlight = getMainColor("highlight")
  27. local negative = getMainColor('negative')
  28.  
  29. -- We can also pull in some localized aliases for workhorse functions for a modest speed increase
  30. local Round = notShit.round
  31. local Floor = notShit.floor
  32. local diffusealpha = Actor.diffusealpha
  33. local diffuse = Actor.diffuse
  34. local finishtweening = Actor.finishtweening
  35. local linear = Actor.linear
  36. local x = Actor.x
  37. local queuecommand = Actor.queuecommand
  38. local playcommand = Actor.queuecommand
  39. local settext = BitmapText.settext
  40. local Broadcast = MessageManager.Broadcast
  41.  
  42. -- Screenwide params
  43. --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
  44. isCentered = PREFSMAN:GetPreference("Center1Player")
  45. local CenterX = SCREEN_CENTER_X
  46. local mpOffset = 0
  47. if not isCentered then
  48. CenterX = THEME:GetMetric("ScreenGameplay",string.format("PlayerP1%sX",ToEnumShortString(GAMESTATE:GetCurrentStyle():GetStyleType())))
  49. mpOffset = SCREEN_CENTER_X
  50. end
  51. --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
  52.  
  53. -- Those are the X and Y for things that are going to be able to be moved with the listener
  54. local eb -- Errorbar children
  55. local dt -- Differential tracker children
  56. local mb -- Minibar actor frame
  57. local fb -- Fullbar actor frame
  58. local dp -- Display percent actor frame
  59.  
  60. local screen -- the screen after it is loaded
  61. local messageBox -- the message box from when you try to move something
  62. local judgeCounter -- pa counter actor frame
  63.  
  64. local WIDESCREENWHY = -5
  65. local WIDESCREENWHX = -5
  66.  
  67. --error bar things
  68. local errorBarX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarX
  69. local errorBarY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarY
  70. local errorBarWidth = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarWidth -- felt like this is necessary in order to do stuff
  71. local errorBarHeight = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarHeight
  72. local errorBarFrameWidth = capWideScale(get43size(errorBarWidth),errorBarWidth)
  73. local wscale = errorBarFrameWidth/180
  74.  
  75. --percent display things
  76. local displayPercentX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentX
  77. local displayPercentY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentY
  78. local displayPercentZoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.DisplayPercentZoom
  79.  
  80. --pa counter things
  81. local judgeCounterX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterX
  82. local judgeCounterY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterY
  83.  
  84. --differential tracker things
  85. local targetTrackerMode = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).TargetTrackerMode
  86. local targetTrackerX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerX
  87. local targetTrackerY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerY
  88. local targetTrackerZoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.TargetTrackerZoom
  89.  
  90. if IsUsingWideScreen( ) then
  91. targetTrackerY = targetTrackerY + WIDESCREENWHY
  92. targetTrackerX = targetTrackerX - WIDESCREENWHX
  93. end
  94.  
  95. --mini progress bar things
  96. local miniProgressBarX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarX
  97. local miniProgressBarY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarY
  98.  
  99. -- CUZ WIDESCREEN DEFAULTS SCREAAAAAAAAAAAAAAAAAAAAAAAAAM -mina
  100. if IsUsingWideScreen( ) then
  101. miniProgressBarY = miniProgressBarY + WIDESCREENWHY
  102. miniProgressBarX = miniProgressBarX - WIDESCREENWHX
  103. end
  104.  
  105. --full progress bar things
  106. local fullProgressBarX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarX
  107. local fullProgressBarY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarY
  108. local fullProgressBarWidth = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarWidth
  109. local fullProgressBarHeight = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarHeight
  110.  
  111. --receptor/notefield things
  112. local noteField
  113. local noteColumns
  114. local noteFieldX = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldX
  115. local noteFieldY = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldY
  116. local noteFieldWidth = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldWidth
  117. local noteFieldHeight = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldHeight
  118.  
  119. --guess checking if things are enabled before changing them is good for not having a log full of errors
  120. local enabledErrorBar = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).ErrorBar
  121. local enabledMiniBar = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).MiniProgressBar
  122. local enabledFullBar = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).FullProgressBar
  123. local enabledTargetTracker = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).TargetTracker
  124. local enabledDisplayPercent = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).DisplayPercent
  125. local enabledJudgeCounter = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).JudgeCounter
  126.  
  127. -- restart button
  128. local function froot(loop)
  129. if loop.DeviceInput.button == "DeviceButton_`" then
  130. SCREENMAN:GetTopScreen():SetPrevScreenName("ScreenStageInformation"):begin_backing_out()
  131. end
  132. end
  133.  
  134. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  135. **Main listener that moves and resizes things**
  136. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  137.  
  138. ]]
  139. local onePressed = false
  140. local twoPressed = false
  141. local threePressed = false
  142. local fourPressed = false
  143. local fivePressed = false
  144. local sixPressed = false
  145. local sevenPressed = false
  146. local eightPressed = false
  147. local ninePressed = false
  148. local zeroPressed = false
  149. local qPressed = false
  150. local wPressed = false
  151. local ePressed = false
  152. local rPressed = false
  153. local tPressed = false
  154. local yPressed = false
  155. local uPressed = false
  156. local iPressed = false
  157. local oPressed = false
  158. local pPressed = false
  159. local changed = false
  160.  
  161. local function firstHalfInput(event)
  162. if getAutoplay() ~= 0 then
  163. -- this is starting to not look pretty, might rework on this piece of code to make it look smaller / lol i had to split in two functions because it told me there were more than 60 values
  164. if event.DeviceInput.button == "DeviceButton_1" then
  165. onePressed = not (event.type == "InputEventType_Release")
  166. end
  167. if event.DeviceInput.button == "DeviceButton_2" then
  168. twoPressed = not (event.type == "InputEventType_Release")
  169. end
  170. if event.DeviceInput.button == "DeviceButton_3" then
  171. threePressed = not (event.type == "InputEventType_Release")
  172. end
  173. if event.DeviceInput.button == "DeviceButton_4" then
  174. fourPressed = not (event.type == "InputEventType_Release")
  175. end
  176. if event.DeviceInput.button == "DeviceButton_5" then
  177. fivePressed = not (event.type == "InputEventType_Release")
  178. end
  179. if event.DeviceInput.button == "DeviceButton_6" then
  180. sixPressed = not (event.type == "InputEventType_Release")
  181. end
  182. if event.DeviceInput.button == "DeviceButton_7" then
  183. sevenPressed = not (event.type == "InputEventType_Release")
  184. end
  185. if event.DeviceInput.button == "DeviceButton_8" then
  186. eightPressed = not (event.type == "InputEventType_Release")
  187. end
  188. if event.DeviceInput.button == "DeviceButton_9" then
  189. ninePressed = not (event.type == "InputEventType_Release")
  190. end
  191. if event.DeviceInput.button == "DeviceButton_0" then
  192. zeroPressed = not (event.type == "InputEventType_Release")
  193. end
  194. messageBox:GetChild("judgmentPosText"):visible(onePressed):playcommand("Update")
  195. messageBox:GetChild("judgmentSizeText"):visible(twoPressed):playcommand("Update")
  196. messageBox:GetChild("comboPosText"):visible(threePressed):playcommand("Update")
  197. messageBox:GetChild("comboSizeText"):visible(fourPressed):playcommand("Update")
  198. messageBox:GetChild("errorBarPosText"):visible(fivePressed):playcommand("Update")
  199. messageBox:GetChild("errorBarSizeText"):visible(sixPressed):playcommand("Update")
  200. messageBox:GetChild("targetTrackerPosText"):visible(sevenPressed):playcommand("Update")
  201. messageBox:GetChild("targetTrackerSizeText"):visible(eightPressed):playcommand("Update")
  202. messageBox:GetChild("fullProgressBarPosText"):visible(ninePressed):playcommand("Update")
  203. messageBox:GetChild("fullProgressBarSizeText"):visible(zeroPressed):playcommand("Update")
  204. -- changes errorbar x/y
  205. if fivePressed and enabledErrorBar and event.type ~= "InputEventType_Release" then
  206. if event.DeviceInput.button == "DeviceButton_up" then
  207. errorBarY = errorBarY - 5
  208. eb.Center:y(errorBarY)
  209. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarY = errorBarY
  210. changed = true
  211. end
  212. if event.DeviceInput.button == "DeviceButton_down" then
  213. errorBarY = errorBarY + 5
  214. eb.Center:y(errorBarY)
  215. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarY = errorBarY
  216. changed = true
  217. end
  218. if event.DeviceInput.button == "DeviceButton_left" then
  219. errorBarX = errorBarX - 5
  220. eb.Center:x(errorBarX)
  221. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarX = errorBarX
  222. changed = true
  223. end
  224. if event.DeviceInput.button == "DeviceButton_right" then
  225. errorBarX = errorBarX + 5
  226. eb.Center:x(errorBarX)
  227. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ErrorBarX = errorBarX
  228. changed = true
  229. end
  230. if changed then
  231. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  232. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  233. changed = false
  234. end
  235. end
  236. -- changes errorbar size
  237. if sixPressed and enabledErrorBar and event.type ~= "InputEventType_Release" then
  238. if event.DeviceInput.button == "DeviceButton_up" then
  239. errorBarHeight = errorBarHeight + 1
  240. eb.Center:zoomtoheight(errorBarHeight)
  241. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarHeight = errorBarHeight
  242. changed = true
  243. end
  244. if event.DeviceInput.button == "DeviceButton_down" then
  245. errorBarHeight = errorBarHeight - 1
  246. eb.Center:zoomtoheight(errorBarHeight)
  247. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarHeight = errorBarHeight
  248. changed = true
  249. end
  250. if event.DeviceInput.button == "DeviceButton_left" then
  251. errorBarWidth = errorBarWidth - 10
  252. errorBarFrameWidth = capWideScale(get43size(errorBarWidth),errorBarWidth)
  253. wscale = errorBarFrameWidth/180
  254. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarWidth = errorBarWidth
  255. changed = true
  256. end
  257. if event.DeviceInput.button == "DeviceButton_right" then
  258. errorBarWidth = errorBarWidth + 10
  259. errorBarFrameWidth = capWideScale(get43size(errorBarWidth),errorBarWidth)
  260. wscale = errorBarFrameWidth/180
  261. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ErrorBarWidth = errorBarWidth
  262. changed = true
  263. end
  264. if changed then
  265. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  266. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  267. changed = false
  268. end
  269. end
  270. -- changes differential tracker x/y
  271. if sevenPressed and enabledTargetTracker and event.type ~= "InputEventType_Release" then
  272. if event.DeviceInput.button == "DeviceButton_up" then
  273. targetTrackerY = targetTrackerY - 5
  274. if targetTrackerMode == 0 then
  275. dt.PercentDifferential:y(targetTrackerY)
  276. else
  277. dt.PBDifferential:y(targetTrackerY)
  278. end
  279. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerY = targetTrackerY
  280. changed = true
  281. end
  282. if event.DeviceInput.button == "DeviceButton_down" then
  283. targetTrackerY = targetTrackerY + 5
  284. if targetTrackerMode == 0 then
  285. dt.PercentDifferential:y(targetTrackerY)
  286. else
  287. dt.PBDifferential:y(targetTrackerY)
  288. end
  289. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerY = targetTrackerY
  290. changed = true
  291. end
  292. if event.DeviceInput.button == "DeviceButton_left" then
  293. targetTrackerX = targetTrackerX - 5
  294. if targetTrackerMode == 0 then
  295. dt.PercentDifferential:x(targetTrackerX)
  296. else
  297. dt.PBDifferential:x(targetTrackerX)
  298. end
  299. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerX = targetTrackerX
  300. changed = true
  301. end
  302. if event.DeviceInput.button == "DeviceButton_right" then
  303. targetTrackerX = targetTrackerX + 5
  304. if targetTrackerMode == 0 then
  305. dt.PercentDifferential:x(targetTrackerX)
  306. else
  307. dt.PBDifferential:x(targetTrackerX)
  308. end
  309. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.TargetTrackerX = targetTrackerX
  310. changed = true
  311. end
  312. if changed then
  313. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  314. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  315. changed = false
  316. end
  317. end
  318. -- changes differential tracker size
  319. if eightPressed and enabledTargetTracker and event.type ~= "InputEventType_Release" then
  320. if event.DeviceInput.button == "DeviceButton_up" then
  321. targetTrackerZoom = targetTrackerZoom + 0.01
  322. if targetTrackerMode == 0 then
  323. dt.PercentDifferential:zoom(targetTrackerZoom)
  324. else
  325. dt.PBDifferential:zoom(targetTrackerZoom)
  326. end
  327. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.TargetTrackerZoom = targetTrackerZoom
  328. changed = true
  329. end
  330. if event.DeviceInput.button == "DeviceButton_down" then
  331. targetTrackerZoom = targetTrackerZoom - 0.01
  332. if targetTrackerMode == 0 then
  333. dt.PercentDifferential:zoom(targetTrackerZoom)
  334. else
  335. dt.PBDifferential:zoom(targetTrackerZoom)
  336. end
  337. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.TargetTrackerZoom = targetTrackerZoom
  338. changed = true
  339. end
  340. if changed then
  341. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  342. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  343. changed = false
  344. end
  345. end
  346. -- changes full progress bar x/y
  347. if ninePressed and enabledFullBar and event.type ~= "InputEventType_Release" then
  348. if event.DeviceInput.button == "DeviceButton_up" then
  349. fullProgressBarY = fullProgressBarY - 3
  350. fb:y(fullProgressBarY)
  351. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarY = fullProgressBarY
  352. changed = true
  353. end
  354. if event.DeviceInput.button == "DeviceButton_down" then
  355. fullProgressBarY = fullProgressBarY + 3
  356. fb:y(fullProgressBarY)
  357. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarY = fullProgressBarY
  358. changed = true
  359. end
  360. if event.DeviceInput.button == "DeviceButton_left" then
  361. fullProgressBarX = fullProgressBarX - 5
  362. fb:x(fullProgressBarX)
  363. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarX = fullProgressBarX
  364. changed = true
  365. end
  366. if event.DeviceInput.button == "DeviceButton_right" then
  367. fullProgressBarX = fullProgressBarX + 5
  368. fb:x(fullProgressBarX)
  369. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.FullProgressBarX = fullProgressBarX
  370. changed = true
  371. end
  372. if changed then
  373. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  374. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  375. changed = false
  376. end
  377. end
  378. -- changes full progress bar width/height
  379. if zeroPressed and enabledFullBar and event.type ~= "InputEventType_Release" then
  380. if event.DeviceInput.button == "DeviceButton_up" then
  381. fullProgressBarHeight = fullProgressBarHeight + 0.1
  382. fb:zoomtoheight(fullProgressBarHeight)
  383. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarHeight = fullProgressBarHeight
  384. changed = true
  385. end
  386. if event.DeviceInput.button == "DeviceButton_down" then
  387. fullProgressBarHeight = fullProgressBarHeight - 0.1
  388. fb:zoomtoheight(fullProgressBarHeight)
  389. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarHeight = fullProgressBarHeight
  390. changed = true
  391. end
  392. if event.DeviceInput.button == "DeviceButton_left" then
  393. fullProgressBarWidth = fullProgressBarWidth - 0.01
  394. fb:zoomtowidth(fullProgressBarWidth)
  395. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarWidth = fullProgressBarWidth
  396. changed = true
  397. end
  398. if event.DeviceInput.button == "DeviceButton_right" then
  399. fullProgressBarWidth = fullProgressBarWidth + 0.01
  400. fb:zoomtowidth(fullProgressBarWidth)
  401. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.FullProgressBarWidth = fullProgressBarWidth
  402. changed = true
  403. end
  404. if changed then
  405. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  406. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  407. changed = false
  408. end
  409. end
  410.  
  411. end
  412. return false
  413. end
  414.  
  415. local function secondHalfInput(event)
  416. if getAutoplay() ~= 0 then
  417. if event.DeviceInput.button == "DeviceButton_q" then
  418. qPressed = not (event.type == "InputEventType_Release")
  419. end
  420. if event.DeviceInput.button == "DeviceButton_w" then
  421. wPressed = not (event.type == "InputEventType_Release")
  422. end
  423. if event.DeviceInput.button == "DeviceButton_e" then
  424. ePressed = not (event.type == "InputEventType_Release")
  425. end
  426. if event.DeviceInput.button == "DeviceButton_r" then
  427. rPressed = not (event.type == "InputEventType_Release")
  428. end
  429. if event.DeviceInput.button == "DeviceButton_t" then
  430. tPressed = not (event.type == "InputEventType_Release")
  431. end
  432. if event.DeviceInput.button == "DeviceButton_y" then
  433. yPressed = not (event.type == "InputEventType_Release")
  434. end
  435. if event.DeviceInput.button == "DeviceButton_u" then
  436. uPressed = not (event.type == "InputEventType_Release")
  437. end
  438. if event.DeviceInput.button == "DeviceButton_i" then
  439. iPressed = not (event.type == "InputEventType_Release")
  440. end
  441. if event.DeviceInput.button == "DeviceButton_o" then
  442. oPressed = not (event.type == "InputEventType_Release")
  443. end
  444. if event.DeviceInput.button == "DeviceButton_p" then
  445. pPressed = not (event.type == "InputEventType_Release")
  446. end
  447. messageBox:GetChild("miniProgressBarPosText"):visible(qPressed):playcommand("Update")
  448. messageBox:GetChild("displayPercentPosText"):visible(wPressed):playcommand("Update")
  449. messageBox:GetChild("displayPercentSizeText"):visible(ePressed):playcommand("Update")
  450. messageBox:GetChild("noteFieldPosText"):visible(rPressed):playcommand("Update")
  451. messageBox:GetChild("noteFieldSizeText"):visible(tPressed):playcommand("Update")
  452. messageBox:GetChild("npsDisplayPosText"):visible(yPressed):playcommand("Update")
  453. messageBox:GetChild("npsDisplaySizeText"):visible(uPressed):playcommand("Update")
  454. messageBox:GetChild("npsGraphPosText"):visible(iPressed):playcommand("Update")
  455. messageBox:GetChild("npsGraphSizeText"):visible(oPressed):playcommand("Update")
  456. messageBox:GetChild("judgeCounterPosText"):visible(pPressed):playcommand("Update")
  457. -- changes mini progress bar x/y
  458. if qPressed and enabledMiniBar and event.type ~= "InputEventType_Release" then
  459. if event.DeviceInput.button == "DeviceButton_up" then
  460. miniProgressBarY = miniProgressBarY - 5
  461. mb:y(miniProgressBarY)
  462. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarY = miniProgressBarY
  463. changed = true
  464. end
  465. if event.DeviceInput.button == "DeviceButton_down" then
  466. miniProgressBarY = miniProgressBarY + 5
  467. mb:y(miniProgressBarY)
  468. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarY = miniProgressBarY
  469. changed = true
  470. end
  471. if event.DeviceInput.button == "DeviceButton_left" then
  472. miniProgressBarX = miniProgressBarX - 5
  473. mb:x(miniProgressBarX)
  474. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarX = miniProgressBarX
  475. changed = true
  476. end
  477. if event.DeviceInput.button == "DeviceButton_right" then
  478. miniProgressBarX = miniProgressBarX + 5
  479. mb:x(miniProgressBarX)
  480. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.MiniProgressBarX = miniProgressBarX
  481. changed = true
  482. end
  483. if changed then
  484. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  485. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  486. changed = false
  487. end
  488. end
  489. -- changes display percent x/y
  490. if wPressed and enabledDisplayPercent and event.type ~= "InputEventType_Release" then
  491. if event.DeviceInput.button == "DeviceButton_up" then
  492. displayPercentY = displayPercentY - 5
  493. dp:addy(-5)
  494. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentY = displayPercentY
  495. changed = true
  496. end
  497. if event.DeviceInput.button == "DeviceButton_down" then
  498. displayPercentY = displayPercentY + 5
  499. dp:addy(5)
  500. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentY = displayPercentY
  501. changed = true
  502. end
  503. if event.DeviceInput.button == "DeviceButton_left" then
  504. displayPercentX = displayPercentX - 5
  505. dp:addx(-5)
  506. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentX = displayPercentX
  507. changed = true
  508. end
  509. if event.DeviceInput.button == "DeviceButton_right" then
  510. displayPercentX = displayPercentX + 5
  511. dp:addx(5)
  512. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.DisplayPercentX = displayPercentX
  513. changed = true
  514. end
  515. if changed then
  516. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  517. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  518. changed = false
  519. end
  520. end
  521. -- changes display percent size
  522. if ePressed and enabledDisplayPercent and event.type ~= "InputEventType_Release" then
  523. if event.DeviceInput.button == "DeviceButton_up" then
  524. displayPercentZoom = displayPercentZoom + 0.01
  525. dp:zoom(displayPercentZoom)
  526. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.DisplayPercentZoom = displayPercentZoom
  527. changed = true
  528. end
  529. if event.DeviceInput.button == "DeviceButton_down" then
  530. displayPercentZoom = displayPercentZoom - 0.01
  531. dp:zoom(displayPercentZoom)
  532. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.DisplayPercentZoom = displayPercentZoom
  533. changed = true
  534. end
  535. if changed then
  536. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  537. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  538. changed = false
  539. end
  540. end
  541. -- changes the noteField/receptor x/y
  542. if rPressed and event.type ~= "InputEventType_Release" then
  543. if event.DeviceInput.button == "DeviceButton_up" then
  544. noteFieldY = noteFieldY - 3
  545. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldY = noteFieldY
  546. noteField:addy(-3)
  547. changed = true
  548. end
  549. if event.DeviceInput.button == "DeviceButton_down" then
  550. noteFieldY = noteFieldY + 3
  551. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldY = noteFieldY
  552. noteField:addy(3)
  553. changed = true
  554. end
  555. if event.DeviceInput.button == "DeviceButton_left" then
  556. noteFieldX = noteFieldX - 3
  557. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldX = noteFieldX
  558. noteField:addx(-3)
  559. changed = true
  560. end
  561. if event.DeviceInput.button == "DeviceButton_right" then
  562. noteFieldX = noteFieldX + 3
  563. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NotefieldX = noteFieldX
  564. noteField:addx(3)
  565. changed = true
  566. end
  567. if changed then
  568. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  569. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  570. changed = false
  571. end
  572. end
  573. -- changes the noteField/receptor width/height
  574. if tPressed and event.type ~= "InputEventType_Release" then
  575. if event.DeviceInput.button == "DeviceButton_up" then
  576. noteFieldHeight = noteFieldHeight + 0.01
  577. for i, actor in ipairs(noteColumns) do
  578. actor:zoomtoheight(noteFieldHeight)
  579. end
  580. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldHeight = noteFieldHeight
  581. changed = true
  582. end
  583. if event.DeviceInput.button == "DeviceButton_down" then
  584. noteFieldHeight = noteFieldHeight - 0.01
  585. for i, actor in ipairs(noteColumns) do
  586. actor:zoomtoheight(noteFieldHeight)
  587. end
  588. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldHeight = noteFieldHeight
  589. changed = true
  590. end
  591. if event.DeviceInput.button == "DeviceButton_left" then
  592. noteFieldWidth = noteFieldWidth - 0.01
  593. for i, actor in ipairs(noteColumns) do
  594. actor:zoomtowidth(noteFieldWidth)
  595. end
  596. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldWidth = noteFieldWidth
  597. changed = true
  598. end
  599. if event.DeviceInput.button == "DeviceButton_right" then
  600. noteFieldWidth = noteFieldWidth + 0.01
  601. for i, actor in ipairs(noteColumns) do
  602. actor:zoomtowidth(noteFieldWidth)
  603. end
  604. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NotefieldWidth = noteFieldWidth
  605. changed = true
  606. end
  607. if changed then
  608. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  609. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  610. changed = false
  611. end
  612. end
  613. -- changes pa counter x/y
  614. if pPressed and enabledJudgeCounter and event.type ~= "InputEventType_Release" then
  615. if event.DeviceInput.button == "DeviceButton_up" then
  616. judgeCounterY = judgeCounterY - 3
  617. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterY = judgeCounterY
  618. judgeCounter:addy(-3)
  619. changed = true
  620. end
  621. if event.DeviceInput.button == "DeviceButton_down" then
  622. judgeCounterY = judgeCounterY + 3
  623. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterY = judgeCounterY
  624. judgeCounter:addy(3)
  625. changed = true
  626. end
  627. if event.DeviceInput.button == "DeviceButton_left" then
  628. judgeCounterX = judgeCounterX - 3
  629. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterX = judgeCounterX
  630. judgeCounter:addx(-3)
  631. changed = true
  632. end
  633. if event.DeviceInput.button == "DeviceButton_right" then
  634. judgeCounterX = judgeCounterX + 3
  635. playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeCounterX = judgeCounterX
  636. judgeCounter:addx(3)
  637. changed = true
  638. end
  639. if changed then
  640. playerConfig:set_dirty(pn_to_profile_slot(PLAYER_1))
  641. playerConfig:save(pn_to_profile_slot(PLAYER_1))
  642. changed = false
  643. end
  644. end
  645. end
  646. return false
  647. end
  648.  
  649.  
  650. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  651. **Wife deviance tracker. Basically half the point of the theme.**
  652. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  653.  
  654. For every doot there is an equal and opposite scoot.
  655. ]]
  656.  
  657. local t = Def.ActorFrame{
  658. Name = "WifePerch",
  659. OnCommand=function()
  660. -- Discord thingies
  661. local largeImageTooltip = GetPlayerOrMachineProfile(PLAYER_1):GetDisplayName() .. ": " .. string.format("%5.2f", GetPlayerOrMachineProfile(PLAYER_1):GetPlayerRating())
  662. local detail = GAMESTATE:GetCurrentSong():GetDisplayMainTitle() .. " " .. string.gsub(getCurRateDisplayString(), "Music", "") .. " [" .. GAMESTATE:GetCurrentSong():GetGroupName() .. "]"
  663. -- truncated to 128 characters(discord hard limit)
  664. detail = #detail < 128 and detail or string.sub(detail, 1, 124) .. "..."
  665. local state = "MSD: " .. string.format("%05.2f", GAMESTATE:GetCurrentSteps(PLAYER_1):GetMSD(getCurRateValue(),1))
  666. local endTime = os.time() + GetPlayableTime()
  667. GAMESTATE:UpdateDiscordPresence(largeImageTooltip, detail, state, endTime)
  668.  
  669. if not IsNetSMOnline() then
  670. SCREENMAN:GetTopScreen():AddInputCallback(froot)
  671. end
  672. if(playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CustomizeGameplay) then
  673. SCREENMAN:GetTopScreen():AddInputCallback(firstHalfInput)
  674. SCREENMAN:GetTopScreen():AddInputCallback(secondHalfInput)
  675. end
  676. screen = SCREENMAN:GetTopScreen()
  677. noteField = screen:GetChild("PlayerP1"):GetChild("NoteField")
  678. noteField:addx(noteFieldX)
  679. noteField:addy(noteFieldY)
  680. noteColumns = noteField:get_column_actors()
  681. for i, actor in ipairs(noteColumns) do
  682. actor:zoomtowidth(noteFieldWidth)
  683. actor:zoomtoheight(noteFieldHeight)
  684. end
  685. end,
  686. JudgmentMessageCommand=function(self, msg)
  687. if msg.Offset ~= nil then
  688. dvCur = msg.Offset
  689. jdgCur = msg.Judgment
  690. Broadcast(MESSAGEMAN, "SpottedOffset")
  691. end
  692. end,
  693. }
  694.  
  695. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  696. **LaneCover**
  697. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  698.  
  699. Old scwh lanecover back for now. Equivalent to "screencutting" on ffr; essentially hides notes for a fixed distance before they appear
  700. on screen so you can adjust the time arrows display on screen without modifying their spacing from each other.
  701. ]]
  702.  
  703. t[#t+1] = LoadActor("lanecover")
  704.  
  705.  
  706. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  707. **Player Target Differential: Ghost target rewrite, average score gone for now**
  708. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  709.  
  710. Point differential to AA.
  711. ]]
  712.  
  713. -- Mostly clientside now. We set our desired target goal and listen to the results rather than calculating ourselves.
  714. local target = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).TargetGoal
  715. GAMESTATE:GetPlayerState(PLAYER_1):SetTargetGoal(target/100)
  716.  
  717. -- We can save space by wrapping the personal best and set percent trackers into one function, however
  718. -- this would make the actor needlessly cumbersome and unnecessarily punish those who don't use the
  719. -- personal best tracker (although everything is efficient enough now it probably wouldn't matter)
  720.  
  721. -- moved it for better manipulation
  722. local d = Def.ActorFrame{
  723. InitCommand = function(self)
  724. dt = self:GetChildren()
  725. end,
  726. }
  727.  
  728. if targetTrackerMode == 0 then
  729. d[#d+1] = LoadFont("Common Normal")..{
  730. Name = "PercentDifferential",
  731. InitCommand=function(self)
  732. self:xy(targetTrackerX,targetTrackerY):zoom(targetTrackerZoom):halign(0):valign(1)
  733. end,
  734. JudgmentMessageCommand=function(self,msg)
  735. local tDiff = msg.WifeDifferential
  736. if tDiff >= 0 then
  737. diffuse(self,positive)
  738. else
  739. diffuse(self,negative)
  740. end
  741. self:settextf("%5.2f (%5.2f%%)", tDiff, target)
  742. end
  743. }
  744. else
  745. d[#d+1] = LoadFont("Common Normal")..{
  746. Name = "PBDifferential",
  747. InitCommand=function(self)
  748. self:xy(targetTrackerX,targetTrackerY):zoom(targetTrackerZoom):halign(0):valign(1)
  749. end,
  750. JudgmentMessageCommand=function(self,msg)
  751. local tDiff = msg.WifePBDifferential
  752. if tDiff then
  753. local pbtarget = msg.WifePBGoal
  754. if tDiff >= 0 then
  755. diffuse(self,color("#00ff00"))
  756. else
  757. diffuse(self,negative)
  758. end
  759. self:settextf("%5.2f (%5.2f%%)", tDiff, pbtarget*100)
  760. else
  761. tDiff = msg.WifeDifferential
  762. if tDiff >= 0 then
  763. diffuse(self,positive)
  764. else
  765. diffuse(self,negative)
  766. end
  767. self:settextf("%5.2f (%5.2f%%)", tDiff, target)
  768. end
  769. end
  770. }
  771. end
  772.  
  773. if enabledTargetTracker then
  774. t[#t+1] = d
  775. end
  776.  
  777. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  778. **Display Percent**
  779. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  780. Displays the current percent for the score.
  781. ]]
  782.  
  783. local cp = Def.ActorFrame{
  784. InitCommand = function(self)
  785. dp = self
  786. self:zoom(displayPercentZoom):addx(displayPercentX):addy(displayPercentY)
  787. end,
  788. Def.Quad{
  789. InitCommand=function(self)
  790. self:xy(60 + mpOffset,(SCREEN_HEIGHT*0.62)-90):zoomto( 60, 13):diffuse(color("0,0,0,0.4")):horizalign(left):vertalign(top)
  791. end
  792. },
  793. -- Displays your current percentage score
  794. LoadFont("Common Large")..{
  795. Name = "DisplayPercent",
  796. InitCommand=function(self)
  797. self:xy(115 + mpOffset,220):zoom(0.3):halign(1):valign(1)
  798. end,
  799. OnCommand=function(self)
  800. self:settextf("%05.2f%%", 0)
  801. end,
  802. JudgmentMessageCommand=function(self,msg)
  803. self:settextf("%05.2f%%", Floor(msg.WifePercent*100)/100)
  804. end
  805. },
  806. }
  807.  
  808. if enabledDisplayPercent then
  809. t[#t+1] = cp
  810. end
  811.  
  812. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  813. **Player judgment counter (aka pa counter)**
  814. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  815. Counts judgments.
  816. --]]
  817.  
  818. -- User Parameters
  819. --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
  820. local frameX = 60 + mpOffset -- X position of the frame
  821. local frameY = (SCREEN_HEIGHT*0.62)-90 -- Y Position of the frame
  822. local spacing = 10 -- Spacing between the judgetypes
  823. local frameWidth = 60 -- Width of the Frame
  824. local frameHeight = ((#jdgT-1)*spacing) - 8 -- Height of the Frame
  825. local judgeFontSize = 0.40 -- Font sizes for different text elements
  826. local countFontSize = 0.35
  827. local gradeFontSize = 0.45
  828. --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
  829.  
  830. local jdgCounts = {} -- Child references for the judge counter
  831.  
  832. local j = Def.ActorFrame{
  833. InitCommand=function(self)
  834. judgeCounter = self
  835. self:addx(judgeCounterX):addy(judgeCounterY)
  836. end,
  837. OnCommand=function(self)
  838. for i=1,#jdgT do
  839. jdgCounts[jdgT[i]] = self:GetChild(jdgT[i])
  840. end
  841. end,
  842. JudgmentMessageCommand=function(self, msg)
  843. if jdgCounts[msg.Judgment] then
  844. settext(jdgCounts[msg.Judgment],msg.Val)
  845. end
  846. end
  847. }
  848.  
  849. local function makeJudgeText(judge,index) -- Makes text
  850. return LoadFont("Common normal")..{
  851. InitCommand=function(self)
  852. self:xy(frameX+5,frameY+7+(index*spacing)):zoom(judgeFontSize):halign(0)
  853. end,
  854. OnCommand=function(self)
  855. settext(self,getShortJudgeStrings(judge))
  856. diffuse(self,jcT[judge])
  857. end
  858. }
  859. end
  860.  
  861. local function makeJudgeCount(judge,index) -- Makes county things for taps....
  862. return LoadFont("Common Normal")..{
  863. Name = judge,
  864. InitCommand=function(self)
  865. self:xy(frameWidth+frameX-5,frameY+7+(index*spacing)):zoom(countFontSize):horizalign(right):settext(0)
  866. end}
  867. end
  868.  
  869.  
  870. -- Background
  871. j[#j+1] = Def.Quad{InitCommand=function(self)
  872. self:xy(frameX,frameY+13):zoomto(frameWidth,frameHeight+18):diffuse(color("0,0,0,0.4")):horizalign(left):vertalign(top)
  873. end}
  874.  
  875. -- Build judgeboard
  876. for i=1,#jdgT do
  877. j[#j+1] = makeJudgeText(jdgT[i],i)
  878. j[#j+1] = makeJudgeCount(jdgT[i],i)
  879. end
  880.  
  881. -- Now add the completed judgment table to the primary actor frame t if enabled
  882. if enabledJudgeCounter then
  883. t[#t+1] = j
  884. end
  885.  
  886.  
  887.  
  888. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  889. **Player ErrorBar**
  890. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  891.  
  892. Visual display of deviance values.
  893. --]]
  894.  
  895. -- User Parameters
  896. --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
  897. local barcount = 30 -- Number of bars. Older bars will refresh if judgments/barDuration exceeds this value. You don't need more than 40.
  898. local barWidth = 2 -- Width of the ticks.
  899. local barDuration = 0.75 -- Time duration in seconds before the ticks fade out. Doesn't need to be higher than 1. Maybe if you have 300 bars I guess.
  900. --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
  901. local currentbar = 1 -- so we know which error bar we need to update
  902. local ingots = {} -- references to the error bars
  903.  
  904. -- Makes the error bars. They position themselves relative to the center of the screen based on your dv and diffuse to your judgement value before disappating or refreshing
  905. -- Should eventually be handled by the game itself to optimize performance
  906. function smeltErrorBar(index)
  907. return Def.Quad{
  908. Name = index,
  909. InitCommand=function(self)
  910. self:xy(errorBarX,errorBarY):zoomto(barWidth,errorBarHeight):diffusealpha(0)
  911. end,
  912. UpdateErrorBarCommand=function(self) -- probably a more efficient way to achieve this effect, should test stuff later
  913. finishtweening(self) -- note: it really looks like shit without the fade out
  914. diffusealpha(self,1)
  915. diffuse(self,jcT[jdgCur])
  916. x(self,errorBarX+dvCur*wscale)
  917. self:y(errorBarY) -- i dont know why man it doenst work the other way ( y(self,errorBarY) )
  918. self:zoomtoheight(errorBarHeight)
  919. linear(self,barDuration)
  920. diffusealpha(self,0)
  921. end
  922. }
  923. end
  924.  
  925. local e = Def.ActorFrame{
  926. InitCommand = function(self)
  927. eb = self:GetChildren()
  928. for i=1,barcount do -- basically the equivalent of using GetChildren() if it returned unnamed children numerically indexed
  929. ingots[#ingots+1] = self:GetChild(i)
  930. end
  931. end,
  932. SpottedOffsetMessageCommand=function(self)
  933. currentbar = ((currentbar)%barcount) + 1
  934. playcommand(ingots[currentbar],"UpdateErrorBar") -- Update the next bar in the queue
  935. end,
  936. DootCommand=function(self)
  937. self:RemoveChild("DestroyMe")
  938. self:RemoveChild("DestroyMe2")
  939. end,
  940.  
  941. Def.Quad {
  942. Name = "Center",
  943. InitCommand=function(self)
  944. self:diffuse(getMainColor('highlight')):xy(errorBarX,errorBarY):zoomto(2,errorBarHeight)
  945. end
  946. },
  947. -- Indicates which side is which (early/late) These should be destroyed after the song starts.
  948. LoadFont("Common Normal") .. {
  949. Name = "DestroyMe",
  950. InitCommand=function(self)
  951. self:xy(errorBarX+errorBarFrameWidth/4,errorBarY):zoom(0.35)
  952. end,
  953. BeginCommand=function(self)
  954. self:settext("Late"):diffusealpha(0):smooth(0.5):diffusealpha(0.5):sleep(1.5):smooth(0.5):diffusealpha(0)
  955. end,
  956. },
  957. LoadFont("Common Normal") .. {
  958. Name = "DestroyMe2",
  959. InitCommand=function(self)
  960. self:xy(errorBarX-errorBarFrameWidth/4,errorBarY):zoom(0.35)
  961. end,
  962. BeginCommand=function(self)
  963. self:settext("Early"):diffusealpha(0):smooth(0.5):diffusealpha(0.5):sleep(1.5):smooth(0.5):diffusealpha(0):queuecommand("Doot")
  964. end,
  965. DootCommand=function(self)
  966. self:GetParent():queuecommand("Doot")
  967. end
  968. }
  969. }
  970.  
  971. -- Initialize bars
  972. for i=1,barcount do
  973. e[#e+1] = smeltErrorBar(i)
  974. end
  975.  
  976. -- Add the completed errorbar frame to the primary actor frame t if enabled
  977. if enabledErrorBar then
  978. t[#t+1] = e
  979. end
  980.  
  981.  
  982.  
  983. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  984. **Player Info**
  985. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  986.  
  987. Avatar and such, now you can turn it off. Planning to have player mods etc exported similarly to the nowplaying, and an avatar only option
  988. ]]
  989. if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).PlayerInfo then
  990. t[#t+1] = LoadActor("playerinfo")
  991. end
  992.  
  993. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  994. **Full Progressbar**
  995. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  996.  
  997. Song Completion Meter that doesn't eat 100 fps. Courtesy of simply love. Decided to make the full progress bar and mini progress bar
  998. separate entities. So you can have both, or one or the other, or neither.
  999. ]]
  1000.  
  1001. -- User params
  1002. --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
  1003. local width = SCREEN_WIDTH/2-100
  1004. local height = 10
  1005. local alpha = 0.7
  1006. --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
  1007.  
  1008. local p = Def.ActorFrame{
  1009. InitCommand = function(self)
  1010. self:xy(fullProgressBarX,fullProgressBarY)
  1011. self:zoomto(fullProgressBarWidth,fullProgressBarHeight)
  1012. fb = self
  1013. end,
  1014. Def.Quad{
  1015. InitCommand=function(self)
  1016. self:zoomto(width,height):diffuse(color("#666666")):diffusealpha(alpha)
  1017. end,
  1018. },
  1019. Def.SongMeterDisplay{
  1020. InitCommand=function(self)
  1021. self:SetUpdateRate(0.5)
  1022. end,
  1023. StreamWidth=width,
  1024. Stream=Def.Quad{InitCommand=function(self)
  1025. self:zoomy(height):diffuse(getMainColor("highlight"))
  1026. end}
  1027. },
  1028. LoadFont("Common Normal")..{ -- title
  1029. InitCommand=function(self)
  1030. self:zoom(0.35):maxwidth(width*2)
  1031. end,
  1032. BeginCommand=function(self)
  1033. self:settext(GAMESTATE:GetCurrentSong():GetDisplayMainTitle())
  1034. end,
  1035. DoneLoadingNextSongMessageCommand=function(self)
  1036. self:settext(GAMESTATE:GetCurrentSong():GetDisplayMainTitle())
  1037. end
  1038. },
  1039. LoadFont("Common Normal")..{ -- total time
  1040. InitCommand=function(self)
  1041. self:x(width/2):zoom(0.35):maxwidth(width*2):halign(1)
  1042. end,
  1043. BeginCommand=function(self)
  1044. local ttime = GetPlayableTime()
  1045. settext(self,SecondsToMMSS(ttime))
  1046. diffuse(self, ByMusicLength(ttime))
  1047. end,
  1048. DoneLoadingNextSongMessageCommand=function(self)
  1049. local ttime = GetPlayableTime()
  1050. settext(self,SecondsToMMSS(ttime))
  1051. diffuse(self, ByMusicLength(ttime))
  1052. end
  1053. }
  1054. }
  1055.  
  1056. if enabledFullBar then
  1057. t[#t+1] = p
  1058. end
  1059.  
  1060.  
  1061.  
  1062. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1063. **Mini Progressbar**
  1064. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1065.  
  1066. Song Completion Meter that doesn't eat 100 fps. Courtesy of simply love. Decided to make the full progress bar and mini progress bar
  1067. separate entities. So you can have both, or one or the other, or neither.
  1068. ]]
  1069.  
  1070. local width = 34
  1071. local height = 4
  1072. local alpha = 0.3
  1073.  
  1074. mb = Def.ActorFrame{
  1075. InitCommand = function(self)
  1076. self:xy(miniProgressBarX,miniProgressBarY)
  1077. mb = self
  1078. end,
  1079. Def.Quad{
  1080. InitCommand=function(self)
  1081. self:zoomto(width,height):diffuse(color("#666666")):diffusealpha(alpha)
  1082. end,
  1083. },
  1084. Def.Quad{
  1085. InitCommand=function(self)
  1086. self:x(1+width/2):zoomto(1,height):diffuse(color("#555555"))
  1087. end,
  1088. },
  1089. Def.SongMeterDisplay{
  1090. InitCommand=function(self)
  1091. self:SetUpdateRate(0.5)
  1092. end,
  1093. StreamWidth=width,
  1094. Stream=Def.Quad{
  1095. InitCommand=function(self)
  1096. self:zoomy(height):diffuse(getMainColor("highlight"))
  1097. end,
  1098. }
  1099. }
  1100. }
  1101.  
  1102. if enabledMiniBar then
  1103. t[#t+1] = mb
  1104. end
  1105.  
  1106. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1107. **Music Rate Display**
  1108. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1109. ]]
  1110.  
  1111. t[#t+1] = LoadFont("Common Normal")..{
  1112. InitCommand=function(self)
  1113. self:xy(SCREEN_CENTER_X,SCREEN_BOTTOM-10):zoom(0.35):settext(getCurRateDisplayString())
  1114. end,
  1115. DoneLoadingNextSongMessageCommand=function(self)
  1116. self:settext(getCurRateDisplayString())
  1117. end
  1118. }
  1119.  
  1120. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1121. **BPM Display**
  1122. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1123.  
  1124. Better optimized frame update bpm display.
  1125. ]]
  1126.  
  1127. local BPM
  1128. local a = GAMESTATE:GetPlayerState(PLAYER_1):GetSongPosition()
  1129. local r = GAMESTATE:GetSongOptionsObject("ModsLevel_Current"):MusicRate() * 60
  1130. local GetBPS = SongPosition.GetCurBPS
  1131.  
  1132. local function UpdateBPM(self)
  1133. local bpm = GetBPS(a) * r
  1134. settext(BPM,Round(bpm,2))
  1135. end
  1136.  
  1137. t[#t+1] = Def.ActorFrame{
  1138. InitCommand=function(self)
  1139. BPM = self:GetChild("BPM")
  1140. if #GAMESTATE:GetCurrentSong():GetTimingData():GetBPMs() > 1 then -- dont bother updating for single bpm files
  1141. self:SetUpdateFunction(UpdateBPM)
  1142. self:SetUpdateRate(0.5)
  1143. else
  1144. settext(BPM,Round(GetBPS(a) * r,2))
  1145. end
  1146. end,
  1147. LoadFont("Common Normal")..{
  1148. Name="BPM",
  1149. InitCommand=function(self)
  1150. self:x(SCREEN_CENTER_X):y(SCREEN_BOTTOM-20):halign(0.5):zoom(0.40)
  1151. end
  1152. },
  1153. DoneLoadingNextSongMessageCommand=function(self)
  1154. self:queuecommand("Init")
  1155. end
  1156. }
  1157.  
  1158.  
  1159.  
  1160. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1161. **Combo Display**
  1162. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1163.  
  1164. ]]
  1165.  
  1166. local x = 0
  1167. local y = 60
  1168.  
  1169. -- CUZ WIDESCREEN DEFAULTS SCREAAAAAAAAAAAAAAAAAAAAAAAAAM -mina
  1170. if IsUsingWideScreen( ) then
  1171. y = y - WIDESCREENWHY
  1172. x = x + WIDESCREENWHX
  1173. end
  1174.  
  1175. --This just initializes the initial point or not idk not needed to mess with this any more
  1176. function ComboTransformCommand( self, params )
  1177. self:x( x )
  1178. self:y( y )
  1179. end
  1180.  
  1181.  
  1182.  
  1183.  
  1184. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1185. **Judgment Display**
  1186. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1187.  
  1188. moving here eventually
  1189. ]]
  1190.  
  1191.  
  1192.  
  1193. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1194. **NPS Display**
  1195. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1196.  
  1197. re-enabling the old nps calc/graph for now
  1198. ]]
  1199.  
  1200. t[#t+1] = LoadActor("npscalc")
  1201.  
  1202.  
  1203.  
  1204. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1205. **NPS graph**
  1206. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1207.  
  1208. ditto
  1209. ]]
  1210.  
  1211. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1212. **Message boxes for moving things**
  1213. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1214. offset window esque boxes so its more intuitive to use the moving feature
  1215. ]]
  1216. if(playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CustomizeGameplay) then
  1217. t[#t+1] = Def.ActorFrame{
  1218. InitCommand=function(self)
  1219. messageBox = self
  1220. end,
  1221. Def.BitmapText{
  1222. Name= "errorBarPosText", Font= "Common Normal",
  1223. InitCommand= function(self)
  1224. self:horizalign(left):vertalign(top)
  1225. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1226. end,
  1227. UpdateCommand=function(self)
  1228. local text= {
  1229. "Error Bar Position:",
  1230. "X: " .. errorBarX,
  1231. "Y: " .. errorBarY,
  1232. }
  1233. self:settext(table.concat(text, "\n"))
  1234. end,
  1235. },
  1236. Def.BitmapText{
  1237. Name= "errorBarSizeText", Font= "Common Normal",
  1238. InitCommand= function(self)
  1239. self:horizalign(left):vertalign(top)
  1240. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1241. end,
  1242. UpdateCommand=function(self)
  1243. local text= {
  1244. "Error Bar Size:",
  1245. "Width: " .. errorBarWidth,
  1246. "Height: " .. errorBarHeight,
  1247. }
  1248. self:settext(table.concat(text, "\n"))
  1249. end,
  1250. },
  1251. Def.BitmapText{
  1252. Name= "targetTrackerPosText", Font= "Common Normal",
  1253. InitCommand= function(self)
  1254. self:horizalign(left):vertalign(top)
  1255. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1256. end,
  1257. UpdateCommand=function(self)
  1258. local text= {
  1259. "Goal Tracker Position:",
  1260. "X: " .. targetTrackerX,
  1261. "Y: " .. targetTrackerY,
  1262. }
  1263. self:settext(table.concat(text, "\n"))
  1264. end,
  1265. },
  1266. Def.BitmapText{
  1267. Name= "targetTrackerSizeText", Font= "Common Normal",
  1268. InitCommand= function(self)
  1269. self:horizalign(left):vertalign(top)
  1270. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1271. end,
  1272. UpdateCommand=function(self)
  1273. local text= {
  1274. "Goal Tracker Size:",
  1275. "Zoom: " .. targetTrackerZoom,
  1276. }
  1277. self:settext(table.concat(text, "\n"))
  1278. end,
  1279. },
  1280. Def.BitmapText{
  1281. Name= "fullProgressBarPosText", Font= "Common Normal",
  1282. InitCommand= function(self)
  1283. self:horizalign(left):vertalign(top)
  1284. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1285. end,
  1286. UpdateCommand=function(self)
  1287. local text= {
  1288. "Full Progress Bar Position:",
  1289. "X: " .. fullProgressBarX,
  1290. "Y: " .. fullProgressBarY,
  1291. }
  1292. self:settext(table.concat(text, "\n"))
  1293. end,
  1294. },
  1295. Def.BitmapText{
  1296. Name= "fullProgressBarSizeText", Font= "Common Normal",
  1297. InitCommand= function(self)
  1298. self:horizalign(left):vertalign(top)
  1299. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1300. end,
  1301. UpdateCommand=function(self)
  1302. local text= {
  1303. "Full Progress Bar Size:",
  1304. "Width: " .. fullProgressBarWidth,
  1305. "Height: " .. fullProgressBarHeight,
  1306. }
  1307. self:settext(table.concat(text, "\n"))
  1308. end,
  1309. },
  1310. Def.BitmapText{
  1311. Name= "miniProgressBarPosText", Font= "Common Normal",
  1312. InitCommand= function(self)
  1313. self:horizalign(left):vertalign(top)
  1314. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1315. end,
  1316. UpdateCommand=function(self)
  1317. local text= {
  1318. "Mini Progress Bar Position:",
  1319. "X: " .. miniProgressBarX,
  1320. "Y: " .. miniProgressBarY,
  1321. }
  1322. self:settext(table.concat(text, "\n"))
  1323. end,
  1324. },
  1325. Def.BitmapText{
  1326. Name= "displayPercentPosText", Font= "Common Normal",
  1327. InitCommand= function(self)
  1328. self:horizalign(left):vertalign(top)
  1329. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1330. end,
  1331. UpdateCommand=function(self)
  1332. local text= {
  1333. "Current Percent Position:",
  1334. "X: " .. displayPercentX,
  1335. "Y: " .. displayPercentY,
  1336. }
  1337. self:settext(table.concat(text, "\n"))
  1338. end,
  1339. },
  1340. Def.BitmapText{
  1341. Name= "displayPercentSizeText", Font= "Common Normal",
  1342. InitCommand= function(self)
  1343. self:horizalign(left):vertalign(top)
  1344. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1345. end,
  1346. UpdateCommand=function(self)
  1347. local text= {
  1348. "Current Percent Size:",
  1349. "Zoom: " .. displayPercentZoom,
  1350. }
  1351. self:settext(table.concat(text, "\n"))
  1352. end,
  1353. },
  1354. Def.BitmapText{
  1355. Name= "noteFieldPosText", Font= "Common Normal",
  1356. InitCommand= function(self)
  1357. self:horizalign(left):vertalign(top)
  1358. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1359. end,
  1360. UpdateCommand=function(self)
  1361. local text= {
  1362. "Notefield Position:",
  1363. "X: " .. noteFieldX,
  1364. "Y: " .. noteFieldY,
  1365. }
  1366. self:settext(table.concat(text, "\n"))
  1367. end,
  1368. },
  1369. Def.BitmapText{
  1370. Name= "noteFieldSizeText", Font= "Common Normal",
  1371. InitCommand= function(self)
  1372. self:horizalign(left):vertalign(top)
  1373. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1374. end,
  1375. UpdateCommand=function(self)
  1376. local text= {
  1377. "Notefield Size:",
  1378. "Width: " .. noteFieldWidth,
  1379. "Height: " .. noteFieldHeight,
  1380. }
  1381. self:settext(table.concat(text, "\n"))
  1382. end,
  1383. },
  1384. Def.BitmapText{
  1385. Name= "judgeCounterPosText", Font= "Common Normal",
  1386. InitCommand= function(self)
  1387. self:horizalign(left):vertalign(top)
  1388. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1389. end,
  1390. UpdateCommand=function(self)
  1391. local text= {
  1392. "Judge Counter Position:",
  1393. "X: " .. judgeCounterX,
  1394. "Y: " .. judgeCounterY,
  1395. }
  1396. self:settext(table.concat(text, "\n"))
  1397. end,
  1398. },
  1399. -- had to throw this here because it was getting x/y fucked up
  1400. Def.BitmapText{
  1401. Name= "judgmentPosText", Font= "Common Normal",
  1402. InitCommand= function(self)
  1403. self:horizalign(left):vertalign(top)
  1404. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1405. end,
  1406. UpdateCommand=function(self)
  1407. local x = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeX
  1408. local y = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.JudgeY
  1409. local text= {
  1410. "Judgment Label Position:",
  1411. "X: " .. x,
  1412. "Y: " .. y,
  1413. }
  1414. self:settext(table.concat(text, "\n"))
  1415. end,
  1416. },
  1417. Def.BitmapText{
  1418. Name= "judgmentSizeText", Font= "Common Normal",
  1419. InitCommand= function(self)
  1420. self:horizalign(left):vertalign(top)
  1421. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1422. end,
  1423. UpdateCommand=function(self)
  1424. local zoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.JudgeZoom
  1425. local text= {
  1426. "Judgment Label Size:",
  1427. "Zoom: " .. zoom,
  1428. }
  1429. self:settext(table.concat(text, "\n"))
  1430. end,
  1431. },
  1432. Def.BitmapText{
  1433. Name= "comboPosText", Font= "Common Normal",
  1434. InitCommand= function(self)
  1435. self:horizalign(left):vertalign(top)
  1436. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1437. end,
  1438. UpdateCommand=function(self)
  1439. local x = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ComboX
  1440. local y = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.ComboY
  1441.  
  1442. local text= {
  1443. "Combo Position:",
  1444. "X: " .. x,
  1445. "Y: " .. y,
  1446. }
  1447. self:settext(table.concat(text, "\n"))
  1448. end,
  1449. },
  1450. Def.BitmapText{
  1451. Name= "comboSizeText", Font= "Common Normal",
  1452. InitCommand= function(self)
  1453. self:horizalign(left):vertalign(top)
  1454. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1455. end,
  1456. UpdateCommand=function(self)
  1457. local zoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.ComboZoom
  1458. local text= {
  1459. "Combo Size:",
  1460. "Zoom: " .. zoom,
  1461. }
  1462. self:settext(table.concat(text, "\n"))
  1463. end,
  1464. },
  1465. Def.BitmapText{
  1466. Name= "npsDisplayPosText", Font= "Common Normal",
  1467. InitCommand= function(self)
  1468. self:horizalign(left):vertalign(top)
  1469. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1470. end,
  1471. UpdateCommand=function(self)
  1472. local x = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSDisplayX
  1473. local y = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSDisplayY
  1474. local text= {
  1475. "NPS Display Position:",
  1476. "X: " .. x,
  1477. "Y: " .. y,
  1478. }
  1479. self:settext(table.concat(text, "\n"))
  1480. end,
  1481. },
  1482. Def.BitmapText{
  1483. Name= "npsDisplaySizeText", Font= "Common Normal",
  1484. InitCommand= function(self)
  1485. self:horizalign(left):vertalign(top)
  1486. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1487. end,
  1488. UpdateCommand=function(self)
  1489. local zoom = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSDisplayZoom
  1490. local text= {
  1491. "NPS Display Size:",
  1492. "Zoom: " .. zoom,
  1493. }
  1494. self:settext(table.concat(text, "\n"))
  1495. end,
  1496. },
  1497. Def.BitmapText{
  1498. Name= "npsGraphPosText", Font= "Common Normal",
  1499. InitCommand= function(self)
  1500. self:horizalign(left):vertalign(top)
  1501. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1502. end,
  1503. UpdateCommand=function(self)
  1504. local x = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSGraphX
  1505. local y = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplayXYCoordinates.NPSGraphY
  1506. local text= {
  1507. "NPS Graph Position:",
  1508. "X: " .. x,
  1509. "Y: " .. y,
  1510. }
  1511. self:settext(table.concat(text, "\n"))
  1512. end,
  1513. },
  1514. Def.BitmapText{
  1515. Name= "npsGraphSizeText", Font= "Common Normal",
  1516. InitCommand= function(self)
  1517. self:horizalign(left):vertalign(top)
  1518. :shadowlength(2):xy(10, 20):zoom(.5):visible(false)
  1519. end,
  1520. UpdateCommand=function(self)
  1521. local width = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSGraphWidth
  1522. local height = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).GameplaySizes.NPSGraphHeight
  1523. local text= {
  1524. "NPS Display Size:",
  1525. "Width: " .. width,
  1526. "Height: " .. height,
  1527. }
  1528. self:settext(table.concat(text, "\n"))
  1529. end,
  1530. },
  1531. Def.BitmapText{
  1532. Name= "Instructions", Font= "Common Normal",
  1533. InitCommand= function(self)
  1534. self:horizalign(left):vertalign(top)
  1535. :xy(SCREEN_WIDTH - 240, 110):zoom(.5):visible(true)
  1536. end,
  1537. OnCommand=function(self)
  1538. local text= {
  1539. "Enable AutoplayCPU with shift+f8\n",
  1540. "Hold the following and press the arrow",
  1541. "keys to alter the associated element\n",
  1542. "1: Judgement Text Position",
  1543. "2: Judgement Text Size",
  1544. "3: Combo Text Position",
  1545. "4: Combo Text Size",
  1546. "5: Error Bar Text Position",
  1547. "6: Error Bar Text Size",
  1548. "7: Target Tracker Text Position",
  1549. "8: Target Tracker Text Size",
  1550. "9: Full Progress Bar Position",
  1551. "0: Full Progress Bar Size",
  1552. "q: Mini Progress Bar Position",
  1553. "w: Display Percent Text Position",
  1554. "e: Display Percent Text Size",
  1555. "r: Notefield Position",
  1556. "t: Notefield Size",
  1557. "y: NPS Display Text Position",
  1558. "u: NPS Display Text Size",
  1559. "i: NPS Graph Position",
  1560. "o: NPS Graph Size",
  1561. "p: Judge Counter Position",
  1562. }
  1563. self:settext(table.concat(text, "\n"))
  1564. end
  1565. },
  1566. }
  1567. end
  1568. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1569. **Footer brought in from ultralight**
  1570. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]]
  1571. t[#t+1] = LoadActor("footer")..{
  1572. InitCommand=function(self)
  1573. self:CenterX():y(SCREEN_BOTTOM+20):valign(1)
  1574. end;
  1575. }
  1576.  
  1577. --[[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1578. **Song progress meter display brought in from ultralight**
  1579. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]]
  1580. t[#t+1] = Def.ActorFrame{
  1581. Name="SongMeterDisplayFrame";
  1582.  
  1583. InitCommand=function(self)
  1584. self:xy(SCREEN_WIDTH/2,SCREEN_HEIGHT-3):halign(0):valign(1):draworder(120):y(452)
  1585. end;
  1586.  
  1587. Def.Quad{
  1588. Name="LineBG";
  1589. InitCommand=function(self)
  1590. self:zoomto(SCREEN_WIDTH,4):diffuse(color("1,1,1,0.5"))
  1591. end;
  1592. }
  1593.  
  1594. Def.Quad{
  1595. Name="LineLeft";
  1596. InitCommand=function(self)
  1597. self:x(0-SCREEN_WIDTH):zoomto(1,6):diffusealpha(0.75)
  1598. end;
  1599. }
  1600.  
  1601. Def.Quad{
  1602. Name="LineRight";
  1603. InitCommand=function(self)
  1604. self:x(SCREEN_WIDTH):zoomto(1,6):diffusealpha(0.75)
  1605. end;
  1606. }
  1607.  
  1608. Def.SongMeterDisplay {
  1609. InitCommand=function(self)
  1610. self:SetStreamWidth(SCREEN_WIDTH);
  1611. Stream=Def.Actor{};
  1612. Tip=Def.ActorFrame{
  1613. Def.Quad{
  1614. InitCommand=function(self)
  1615. self:zoomto(6,6):diffuse(CustomDifficultyToColor(GAMESTATE:GetCurrentSteps(PLAYER_1):GetDifficulty())):rotationz(45):pulse:effectclock('beatnooffset'):effectmagnitude(1,0.75,1)
  1616. end;
  1617. }
  1618.  
  1619. Def.Quad{
  1620. InitCommand=function(self)
  1621. self:zoomto(4,4):diffuse(HSV(0,0,1)):rotationz(45):pulse:effectclock('beatnooffset'):effectmagnitude(1,0.75,1)
  1622. end;
  1623. }
  1624. }
  1625. }
  1626. return t
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement