diff --git a/art/readme.txt b/art/readme.txt index 30ca7f8..37918b1 100644 --- a/art/readme.txt +++ b/art/readme.txt @@ -2,9 +2,12 @@ hi. moldy here. thanks for downloading our epic mod vs dave and bambi. hope you do you like secrets? I do too! press 7 on story mode menu. + hi Cam here -if you want to mod this read the readmes in the test folder (make sure to copy it and rename it to your liking) +if you want to mod this go to the wiki + +https://github.com/CamtheKirby/VsDave-Modable/wiki anyways have a good day or night! @@ -376,6 +379,173 @@ anyways have a good day or night! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mods/test/data/charts/test-settings.json b/mods/test/data/charts/test-settings.json deleted file mode 100644 index 20cc920..0000000 --- a/mods/test/data/charts/test-settings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "songCreators": "Kawai Sprite & MtH", - "songHeadings": "funkinHeading", - "creditsTxt": "The testiest song on the planet", - "dialogueMusic": "DaveDialogue", - "hasNoGf": false, - "intro": "", - "windowName": "", - "healthDrain": "", - "healthBarBG": "", - "exploitationEffect": false, - "recursedEffect": false -} \ No newline at end of file diff --git a/mods/test/data/charts/test.json b/mods/test/data/charts/test.json index 869f48d..7203780 100644 --- a/mods/test/data/charts/test.json +++ b/mods/test/data/charts/test.json @@ -1 +1 @@ -{"song":{"player1":"bf","notes":[{"sectionNotes":[],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[12800,0,0],[13199.999,1,0],[13599.999,2,0],[13999.999,3,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[14399.999,0,0],[14799.999,1,0],[15199.999,2,0],[15599.999,3,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[15999.999,0,0],[16199.999,0,0],[16400,1,0],[16600,1,0],[16800,2,0],[17000,2,0],[17200,3,0],[17400,3,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[17600,0,0],[17800,0,0],[18000,1,0],[18200,1,0],[18400,2,0],[18600,2,0],[18800,3,0],[19000,3,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[19200,0,300],[19600,1,300],[20000,2,300],[20400,3,300]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[20800,0,300],[21200,1,300],[21600,2,300],[22000,3,300]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[22400,0,700],[22800,1,300],[23200,2,700],[23600,3,300]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[24000,0,700],[24400,1,300],[24800,2,700],[25200,3,300]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[25600,0,0],[25600,1,0],[26399.998,3,0],[26399.998,2,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[27199.998,0,0],[27199.998,2,0],[27599.998,0,0],[27599.998,2,0],[27999.998,3,0],[27999.998,1,0],[28199.998,1,0],[28199.998,3,0],[28399.998,3,0],[28399.998,1,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[28799.998,0,0],[28799.998,1,0],[29599.998,3,0],[29599.998,2,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[30399.998,0,0],[30399.998,2,0],[30799.998,0,0],[30799.998,2,0],[31199.998,3,0],[31199.998,1,0],[31399.998,1,0],[31399.998,3,0],[31599.998,3,0],[31599.998,1,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[31999.998,0,0],[32099.998,1,0],[32199.998,0,100],[32399.998,3,0],[32499.998,2,0],[32599.998,3,100],[32800,0,0],[32900,1,0],[33000,0,100],[33200,3,0],[33300,2,0],[33400,3,100]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[33600,2,0],[33700,3,0],[33800,2,100],[34000,1,0],[34100,0,0],[34200,1,100],[34400,2,0],[34500,3,0],[34600,2,100],[34800,1,0],[34900,0,0],[35000,1,100]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[35200,0,0],[35300,1,0],[35400,0,100],[35600,3,0],[35700,2,0],[35800,3,100],[36000,0,0],[36100,1,0],[36200,0,100],[36400,3,0],[36500,2,0],[36600,3,100]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[36800,2,0],[36900,3,0],[37000,2,100],[37200,1,0],[37300,0,0],[37400,1,100],[37600,2,0],[37700,3,0],[37800,2,100],[38000,1,0],[38100,0,0],[38200,1,100]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[38400,0,0],[38600,3,0],[38800,1,0],[38900,2,0],[39000,1,0],[39100,2,0],[39200,0,0],[39400,3,0],[39600,1,0],[39700,2,0],[39800,1,0],[39900,2,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[40000,3,0],[40200,0,0],[40400,1,0],[40600,3,0],[40800,0,0],[41000,2,0],[41200,3,0],[41400,0,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[41600,0,0],[41800,3,0],[42000,1,0],[42100,2,0],[42200,1,0],[42300,2,0],[42400,0,0],[42600,3,0],[42800,1,0],[42900,2,0],[43000,1,0],[43100,2,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[43200,3,0],[43400,0,0],[43600,1,0],[43800,3,0],[44000,0,0],[44200,2,0],[44400,3,0],[44600,0,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[44800,0,0],[45066.6641,0,0],[45333.332,0,0],[45600,3,0],[45866.6641,3,0],[46133.332,3,0],[46266.6641,3,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[46400,1,100],[46800,1,200],[47200,1,300],[47600,1,400]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[48000,0,0],[48266.6641,0,0],[48533.332,0,0],[48800,3,0],[49066.6641,3,0],[49333.332,3,0],[49466.6641,3,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[49600,1,100],[50000,1,200],[50400,1,300],[50800,1,400]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[51200,0,800],[51200,1,800],[52599.9961,1,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[52799.9961,3,800],[52799.9961,1,800],[53599.9961,4,700],[53799.9961,5,499.999969],[53999.9961,6,300],[53999.9961,1,0],[53999.9961,2,0],[54199.9961,7,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[54399.9961,7,800],[54399.9961,6,800],[54399.9961,5,800],[54399.9961,4,800],[54399.9961,2,800],[54399.9961,0,800],[55799.9961,3,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[55999.9961,2,800],[55999.9961,3,800],[57199.9961,2,0],[57199.9961,1,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[57599.9961,1,800],[57599.9961,0,800],[58999.9961,1,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[59199.9961,3,800],[59199.9961,1,800],[59999.9961,4,700],[60199.9961,5,499.999969],[60399.9961,6,300],[60399.9961,1,0],[60399.9961,2,0],[60599.9961,7,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[60799.9961,7,800],[60799.9961,6,800],[60799.9961,5,800],[60799.9961,4,800],[60799.9961,0,800],[60799.9961,2,800],[62199.9961,3,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[62399.9961,2,800],[62399.9961,3,800],[63199.9961,6,0],[63299.9961,7,0],[63399.9961,6,0],[63499.9961,7,0],[63599.9961,4,0],[63599.9961,2,0],[63599.9961,1,0],[63649.9961,5,0],[63699.9961,6,0],[63749.9961,7,0],[63799.9961,6,0],[63849.9961,5,0],[63899.9961,4,0],[63949.9961,5,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[63999.9961,3,0],[64199.9961,2,0],[64399.9961,0,0],[64599.9961,3,499.999969],[65199.9961,3,0],[65399.9961,0,400]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[66000,0,0],[66200,1,0],[66400,0,0],[66666.6641,3,0],[66933.33,2,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[67200,3,0],[67300,2,0],[67800,2,0],[67850,0,449.999969],[68400,3,100],[68600,2,0],[68700,3,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[68800,0,0],[69000,1,0],[69200,0,0],[69400,3,0],[69600,2,0],[69800,3,300],[70200,0,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[70400,4,0],[70400,3,0],[70600,6,0],[70600,2,0],[70800,7,0],[70800,0,0],[71000,4,499.999969],[71000,3,499.999969],[71600,4,0],[71600,3,0],[71800,7,400],[71800,0,400]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[72400,7,0],[72400,0,0],[72600,5,0],[72600,1,0],[72800,7,0],[72800,0,0],[73066.6641,4,0],[73066.6641,3,0],[73333.33,6,0],[73333.33,2,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[73600,4,0],[73600,3,0],[73700,6,0],[73700,2,0],[74200,6,0],[74200,2,0],[74250,7,449.999969],[74250,0,449.999969],[74800,4,100],[74800,3,100],[75000,6,0],[75000,2,0],[75100,4,0],[75100,3,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[75200,7,0],[75200,0,0],[75400,5,0],[75400,1,0],[75600,7,0],[75600,0,0],[75800,4,0],[75800,3,0],[76000,6,0],[76000,2,0],[76200,4,300],[76200,3,300],[76600,0,0],[76600,7,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[76800,3,0],[76900,2,0],[77000,3,0],[77100,2,0],[77200,0,0],[77300,2,0],[77400,0,0],[77500,2,0],[77600,4,700],[77600,3,0],[77700,2,0],[77800,3,0],[77900,2,0],[78000,0,0],[78100,2,0],[78200,0,0],[78300,2,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[78400,7,700],[78400,3,0],[78500,1,0],[78600,3,0],[78700,1,0],[78800,0,0],[78900,1,0],[79000,0,0],[79100,1,0],[79200,5,400],[79200,3,0],[79300,1,0],[79400,3,0],[79500,1,0],[79600,0,0],[79700,1,0],[79800,0,0],[79900,1,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[80000,3,0],[80100,2,0],[80200,3,0],[80300,2,0],[80400,0,0],[80500,2,0],[80600,0,0],[80700,2,0],[80800,7,700],[80800,3,0],[80900,2,0],[81000,3,0],[81100,2,0],[81200,0,0],[81300,2,0],[81400,0,0],[81500,2,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[81600,4,700],[81600,3,0],[81700,1,0],[81800,3,0],[81900,1,0],[82000,0,0],[82100,1,0],[82200,0,0],[82300,1,0],[82400,5,400],[82400,3,0],[82500,1,0],[82600,3,0],[82700,1,0],[82800,0,0],[82900,1,0],[83000,0,0],[83100,1,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[83200,2,0],[83300,2,0],[83400,2,0],[83500,2,0],[83600,0,0],[83700,0,0],[83800,0,0],[83900,0,0],[84000,3,0],[84100,3,0],[84200,3,0],[84300,3,0],[84400,1,0],[84500,1,0],[84600,1,0],[84700,1,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[84800,0,0],[84933.33,0,0],[85066.6641,0,0],[85200,2,0],[85333.33,2,0],[85466.6641,2,0],[85600,3,0],[85733.33,3,0],[85866.6641,3,0],[86000,0,0],[86133.33,0,0],[86266.6641,0,0]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[86400,6,600],[86400,2,0],[86500,2,0],[86600,2,0],[86700,2,0],[86800,0,0],[86900,0,0],[87000,0,0],[87100,0,0],[87200,4,600],[87200,3,0],[87300,3,0],[87400,3,0],[87500,3,0],[87600,1,0],[87700,1,0],[87800,1,0],[87900,1,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[88000,7,600],[88000,0,0],[88133.33,0,0],[88266.6641,0,0],[88400,2,0],[88533.33,2,0],[88666.6641,2,0],[88800,5,600],[88800,3,0],[88933.33,3,0],[89066.6641,3,0],[89200,0,0],[89333.33,0,0],[89466.6641,0,0]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[89600,0,3200],[90000,3,300],[90400,2,300],[90800,1,300]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[91200,2,0],[91400,3,0],[91600,2,0],[91800,1,0],[92000,2,300],[92400,3,300]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[92800,0,3200],[93200,3,300],[93600,2,300],[94000,1,300]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[94400,2,0],[94600,3,0],[94800,2,0],[95000,1,0],[95200,2,300],[95600,3,300]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[96000,0,2300],[96400,3,300],[96800,2,300],[97200,1,300]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[97600,2,0],[97800,3,0],[98000,2,0],[98200,1,0],[98400,1,700],[98400,2,300],[98800,3,300]],"lengthInSteps":16,"mustHitSection":false},{"sectionNotes":[[99200,2,300],[99200,0,700],[99600,2,0],[99800,2,0],[100000,3,300],[100000,1,300],[100400,2,300],[100400,0,300]],"lengthInSteps":16,"mustHitSection":true},{"sectionNotes":[[100800,3,300],[100800,1,700],[101200,2,300],[101600,3,300],[101600,1,700],[102000,2,300]],"lengthInSteps":16,"mustHitSection":true},{"lengthInSteps":16,"altAnim":false,"typeOfSection":0,"sectionNotes":[],"bpm":150,"changeBPM":false,"mustHitSection":true}],"player2":"bf-pixel","song":"Test","stage":"test","needsVoices":true,"validScore":true,"bpm":150,"speed":1.6}} \ No newline at end of file +{"song":{"player1":"bf","player2":"bf-pixel","notes":[{"lengthInSteps":16,"sectionNotes":[],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[12800,0,0],[13199.999,1,0],[13599.999,2,0],[13999.999,3,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[14399.999,0,0],[14799.999,1,0],[15199.999,2,0],[15599.999,3,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[15999.999,0,0],[16199.999,0,0],[16400,1,0],[16600,1,0],[16800,2,0],[17000,2,0],[17200,3,0],[17400,3,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[17600,0,0],[17800,0,0],[18000,1,0],[18200,1,0],[18400,2,0],[18600,2,0],[18800,3,0],[19000,3,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[19200,0,300],[19600,1,300],[20000,2,300],[20400,3,300]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[20800,0,300],[21200,1,300],[21600,2,300],[22000,3,300]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[22400,0,700],[22800,1,300],[23200,2,700],[23600,3,300]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[24000,0,700],[24400,1,300],[24800,2,700],[25200,3,300]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[25600,0,0],[25600,1,0],[26399.998,3,0],[26399.998,2,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[27199.998,0,0],[27199.998,2,0],[27599.998,0,0],[27599.998,2,0],[27999.998,3,0],[27999.998,1,0],[28199.998,1,0],[28199.998,3,0],[28399.998,3,0],[28399.998,1,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[28799.998,0,0],[28799.998,1,0],[29599.998,3,0],[29599.998,2,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[30399.998,0,0],[30399.998,2,0],[30799.998,0,0],[30799.998,2,0],[31199.998,3,0],[31199.998,1,0],[31399.998,1,0],[31399.998,3,0],[31599.998,3,0],[31599.998,1,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[31999.998,0,0],[32099.998,1,0],[32199.998,0,100],[32399.998,3,0],[32499.998,2,0],[32599.998,3,100],[32800,0,0],[32900,1,0],[33000,0,100],[33200,3,0],[33300,2,0],[33400,3,100]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[33600,2,0],[33700,3,0],[33800,2,100],[34000,1,0],[34100,0,0],[34200,1,100],[34400,2,0],[34500,3,0],[34600,2,100],[34800,1,0],[34900,0,0],[35000,1,100]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[35200,0,0],[35300,1,0],[35400,0,100],[35600,3,0],[35700,2,0],[35800,3,100],[36000,0,0],[36100,1,0],[36200,0,100],[36400,3,0],[36500,2,0],[36600,3,100]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[36800,2,0],[36900,3,0],[37000,2,100],[37200,1,0],[37300,0,0],[37400,1,100],[37600,2,0],[37700,3,0],[37800,2,100],[38000,1,0],[38100,0,0],[38200,1,100]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[38400,0,0],[38600,3,0],[38800,1,0],[38900,2,0],[39000,1,0],[39100,2,0],[39200,0,0],[39400,3,0],[39600,1,0],[39700,2,0],[39800,1,0],[39900,2,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[40000,3,0],[40200,0,0],[40400,1,0],[40600,3,0],[40800,0,0],[41000,2,0],[41200,3,0],[41400,0,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[41600,0,0],[41800,3,0],[42000,1,0],[42100,2,0],[42200,1,0],[42300,2,0],[42400,0,0],[42600,3,0],[42800,1,0],[42900,2,0],[43000,1,0],[43100,2,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[43200,3,0],[43400,0,0],[43600,1,0],[43800,3,0],[44000,0,0],[44200,2,0],[44400,3,0],[44600,0,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[44800,0,0],[45066.6641,0,0],[45333.332,0,0],[45600,3,0],[45866.6641,3,0],[46133.332,3,0],[46266.6641,3,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[46400,1,100],[46800,1,200],[47200,1,300],[47600,1,400]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[48000,0,0],[48266.6641,0,0],[48533.332,0,0],[48800,3,0],[49066.6641,3,0],[49333.332,3,0],[49466.6641,3,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[49600,1,100],[50000,1,200],[50400,1,300],[50800,1,400]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[51200,0,800],[51200,1,800],[52599.9961,1,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[52799.9961,3,800],[52799.9961,1,800],[53599.9961,4,700],[53799.9961,5,499.999969],[53999.9961,6,300],[53999.9961,1,0],[53999.9961,2,0],[54199.9961,7,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[54399.9961,7,800],[54399.9961,6,800],[54399.9961,5,800],[54399.9961,4,800],[54399.9961,2,800],[54399.9961,0,800],[55799.9961,3,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[55999.9961,2,800],[55999.9961,3,800],[57199.9961,2,0],[57199.9961,1,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[57599.9961,1,800],[57599.9961,0,800],[58999.9961,1,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[59199.9961,3,800],[59199.9961,1,800],[59999.9961,4,700],[60199.9961,5,499.999969],[60399.9961,6,300],[60399.9961,1,0],[60399.9961,2,0],[60599.9961,7,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[60799.9961,7,800],[60799.9961,6,800],[60799.9961,5,800],[60799.9961,4,800],[60799.9961,0,800],[60799.9961,2,800],[62199.9961,3,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[62399.9961,2,800],[62399.9961,3,800],[63199.9961,6,0],[63299.9961,7,0],[63399.9961,6,0],[63499.9961,7,0],[63599.9961,4,0],[63599.9961,2,0],[63599.9961,1,0],[63649.9961,5,0],[63699.9961,6,0],[63749.9961,7,0],[63799.9961,6,0],[63849.9961,5,0],[63899.9961,4,0],[63949.9961,5,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[63999.9961,3,0],[64199.9961,2,0],[64399.9961,0,0],[64599.9961,3,499.999969],[65199.9961,3,0],[65399.9961,0,400]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[66000,0,0],[66200,1,0],[66400,0,0],[66666.6641,3,0],[66933.33,2,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[67200,3,0],[67300,2,0],[67800,2,0],[67850,0,449.999969],[68400,3,100],[68600,2,0],[68700,3,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[68800,0,0],[69000,1,0],[69200,0,0],[69400,3,0],[69600,2,0],[69800,3,300],[70200,0,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[70400,4,0],[70400,3,0],[70600,6,0],[70600,2,0],[70800,7,0],[70800,0,0],[71000,4,499.999969],[71000,3,499.999969],[71600,4,0],[71600,3,0],[71800,7,400],[71800,0,400]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[72400,7,0],[72400,0,0],[72600,5,0],[72600,1,0],[72800,7,0],[72800,0,0],[73066.6641,4,0],[73066.6641,3,0],[73333.33,6,0],[73333.33,2,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[73600,4,0],[73600,3,0],[73700,6,0],[73700,2,0],[74200,6,0],[74200,2,0],[74250,7,449.999969],[74250,0,449.999969],[74800,4,100],[74800,3,100],[75000,6,0],[75000,2,0],[75100,4,0],[75100,3,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[75200,7,0],[75200,0,0],[75400,5,0],[75400,1,0],[75600,7,0],[75600,0,0],[75800,4,0],[75800,3,0],[76000,6,0],[76000,2,0],[76200,4,300],[76200,3,300],[76600,0,0],[76600,7,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[76800,3,0],[76900,2,0],[77000,3,0],[77100,2,0],[77200,0,0],[77300,2,0],[77400,0,0],[77500,2,0],[77600,4,700],[77600,3,0],[77700,2,0],[77800,3,0],[77900,2,0],[78000,0,0],[78100,2,0],[78200,0,0],[78300,2,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[78400,7,700],[78400,3,0],[78500,1,0],[78600,3,0],[78700,1,0],[78800,0,0],[78900,1,0],[79000,0,0],[79100,1,0],[79200,5,400],[79200,3,0],[79300,1,0],[79400,3,0],[79500,1,0],[79600,0,0],[79700,1,0],[79800,0,0],[79900,1,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[80000,3,0],[80100,2,0],[80200,3,0],[80300,2,0],[80400,0,0],[80500,2,0],[80600,0,0],[80700,2,0],[80800,7,700],[80800,3,0],[80900,2,0],[81000,3,0],[81100,2,0],[81200,0,0],[81300,2,0],[81400,0,0],[81500,2,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[81600,4,700],[81600,3,0],[81700,1,0],[81800,3,0],[81900,1,0],[82000,0,0],[82100,1,0],[82200,0,0],[82300,1,0],[82400,5,400],[82400,3,0],[82500,1,0],[82600,3,0],[82700,1,0],[82800,0,0],[82900,1,0],[83000,0,0],[83100,1,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[83200,2,0],[83300,2,0],[83400,2,0],[83500,2,0],[83600,0,0],[83700,0,0],[83800,0,0],[83900,0,0],[84000,3,0],[84100,3,0],[84200,3,0],[84300,3,0],[84400,1,0],[84500,1,0],[84600,1,0],[84700,1,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[84800,0,0],[84933.33,0,0],[85066.6641,0,0],[85200,2,0],[85333.33,2,0],[85466.6641,2,0],[85600,3,0],[85733.33,3,0],[85866.6641,3,0],[86000,0,0],[86133.33,0,0],[86266.6641,0,0]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[86400,6,600],[86400,2,0],[86500,2,0],[86600,2,0],[86700,2,0],[86800,0,0],[86900,0,0],[87000,0,0],[87100,0,0],[87200,4,600],[87200,3,0],[87300,3,0],[87400,3,0],[87500,3,0],[87600,1,0],[87700,1,0],[87800,1,0],[87900,1,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[88000,7,600],[88000,0,0],[88133.33,0,0],[88266.6641,0,0],[88400,2,0],[88533.33,2,0],[88666.6641,2,0],[88800,5,600],[88800,3,0],[88933.33,3,0],[89066.6641,3,0],[89200,0,0],[89333.33,0,0],[89466.6641,0,0]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[89600,0,3200],[90000,3,300],[90400,2,300],[90800,1,300]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[91200,2,0],[91400,3,0],[91600,2,0],[91800,1,0],[92000,2,300],[92400,3,300]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[92800,0,3200],[93200,3,300],[93600,2,300],[94000,1,300]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[94400,2,0],[94600,3,0],[94800,2,0],[95000,1,0],[95200,2,300],[95600,3,300]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[96000,0,2300],[96400,3,300],[96800,2,300],[97200,1,300]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[97600,2,0],[97800,3,0],[98000,2,0],[98200,1,0],[98400,1,700],[98400,2,300],[98800,3,300]],"mustHitSection":false},{"lengthInSteps":16,"sectionNotes":[[99200,2,300],[99200,0,700],[99600,2,0],[99800,2,0],[100000,3,300],[100000,1,300],[100400,2,300],[100400,0,300]],"mustHitSection":true},{"lengthInSteps":16,"sectionNotes":[[100800,3,300],[100800,1,700],[101200,2,300],[101600,3,300],[101600,1,700],[102000,2,300]],"mustHitSection":true},{"sectionNotes":[],"typeOfSection":0,"lengthInSteps":16,"altAnim":false,"mustHitSection":true,"changeBPM":false,"bpm":150},{"lengthInSteps":16,"altAnim":false,"typeOfSection":0,"sectionNotes":[],"bpm":150,"changeBPM":false,"mustHitSection":true}],"song":"Test","creditsTxt":"The testiest song on the planet","songHeadings":"funkinHeading","validScore":true,"speed":1.6,"windowName":"","healthBarBG":"","songCreators":"Kawai Sprite & MtH","intro":"","healthDrain":"","dialogueMusic":"cornGame","needsVoices":true,"stage":"test","bpm":150}} \ No newline at end of file diff --git a/source/ChartingState.hx b/source/ChartingState.hx index aae4602..e6ab29e 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -68,6 +68,15 @@ class ChartingState extends MusicBeatState var bullshitUI:FlxGroup; var writingNotesText:FlxText; var highlight:FlxSprite; + var UI_songTitle:FlxUIInputText; + var UI_songCreators:FlxUIInputText; + var UI_songHeadings:FlxUIInputText; + var UI_creditsTxt:FlxUIInputText; + var UI_dialogueMusic:FlxUIInputText; + var UI_intro:FlxUIInputText; + var UI_windowName:FlxUIInputText; + var UI_healthDrain:FlxUIInputText; + var UI_healthBarBG:FlxUIInputText; var GRID_SIZE:Int = 40; @@ -81,6 +90,7 @@ class ChartingState extends MusicBeatState var _song:SwagSong; var typingShit:FlxInputText; + var whosTypingShit:String; /* * WILL BE THE CURRENT / LAST PLACED NOTE **/ @@ -142,7 +152,18 @@ class ChartingState extends MusicBeatState speed: 1, mania: 0, gf: "gf", - validScore: false + validScore: false, + songCreators: "MoldyGH", + songHeadings: "daveHeading", + creditsTxt: "The testiest song on the planet", + dialogueMusic: "DaveDialogue", + hasNoGf: false, + intro: "", + windowName: "", + healthDrain: "", + healthBarBG: "", + exploitationEffect: false, + recursedEffect: false }; } @@ -153,6 +174,7 @@ class ChartingState extends MusicBeatState snapText = new FlxText(60,10,0,"", 14); snapText.scrollFactor.set(); + gridBlackLine = new FlxSprite(gridBG.x + gridBG.width / 2).makeGraphic(2, Std.int(gridBG.height), FlxColor.BLACK); add(gridBlackLine); @@ -203,7 +225,8 @@ class ChartingState extends MusicBeatState {name: "Song", label: 'Song Data'}, {name: "Section", label: 'Section Data'}, {name: "Note", label: 'Note Data'}, - {name: "Assets", label: 'Assets'} + {name: "Assets", label: 'Assets'}, + {name: "Settings", label: 'Settings'} ]; UI_box = new FlxUITabMenu(null, tabs, true); @@ -228,8 +251,10 @@ class ChartingState extends MusicBeatState function addSongUI():Void { - var UI_songTitle = new FlxUIInputText(10, 10, 70, _song.song, 8); + UI_songTitle = new FlxUIInputText(10, 10, 70, _song.song, 8); typingShit = UI_songTitle; + + var check_voices = new FlxUICheckBox(10, 25, null, null, "Has voice track", 100); check_voices.checked = _song.needsVoices; @@ -379,6 +404,59 @@ cStage = CoolUtil.coolTextFile(Paths.txt('stageList')); var stageLabel = new FlxText(140,180,64,'Stage'); + UI_songCreators = new FlxUIInputText(5, 30, 70, _song.songCreators, 8); + typingShit = UI_songCreators; + + UI_songHeadings = new FlxUIInputText(UI_songCreators.x + 80, 30, 70, _song.songHeadings, 8); + typingShit = UI_songHeadings; + + UI_creditsTxt = new FlxUIInputText(UI_songHeadings.x + 80, 30, 70, _song.creditsTxt, 8); + typingShit = UI_creditsTxt; + + UI_dialogueMusic = new FlxUIInputText(UI_creditsTxt.x + 80, 30, 70, _song.dialogueMusic, 8); + typingShit = UI_dialogueMusic; + + var hasNoGf = new FlxUICheckBox(5, UI_songCreators.y + 40, null, null, "Has No GF?", 100); + hasNoGf.checked = false; + hasNoGf.callback = function() + { + _song.hasNoGf = hasNoGf.checked; + }; + + UI_intro = new FlxUIInputText(hasNoGf.x + 80, UI_songCreators.y + 40, 70, _song.intro, 8); + typingShit = UI_intro; + + UI_windowName = new FlxUIInputText(UI_intro.x + 80, UI_songCreators.y + 40, 70, _song.windowName, 8); + typingShit = UI_windowName; + + UI_healthDrain = new FlxUIInputText(UI_windowName.x + 80, UI_songCreators.y + 40, 70, _song.healthDrain, 8); + typingShit = UI_healthDrain; + + UI_healthBarBG = new FlxUIInputText(5, hasNoGf.y + 40, 70, _song.healthBarBG, 8); + typingShit = UI_healthBarBG; + + var exploitationEffect = new FlxUICheckBox(UI_healthBarBG.x + 90, hasNoGf.y + 40, null, null, "Exploitation Effect?", 100); + exploitationEffect.checked = false; + exploitationEffect.callback = function() + { + _song.exploitationEffect = exploitationEffect.checked; + }; + + var recursedEffect = new FlxUICheckBox(exploitationEffect.x + 100, hasNoGf.y + 40, null, null, "Recursed Effect?", 100); + recursedEffect.checked = false; + recursedEffect.callback = function() + { + _song.recursedEffect = recursedEffect.checked; + }; + + var songCreatorsTxt = new FlxText(5,10,'songCreators'); + var songHeadingsTxt = new FlxText(UI_songCreators.x + 80,10,'songHeadings'); + var creditsTxtTxt = new FlxText(UI_songHeadings.x + 80,10,'creditsTxt'); + var dialogueMusicTxt = new FlxText(UI_creditsTxt.x + 80,10,'dialogueMusic'); + var introTxt = new FlxText(hasNoGf.x + 80,UI_songCreators.y + 20,'Intro'); + var windowNameTxt = new FlxText(introTxt.x + 80,UI_songCreators.y + 20,'windowName'); + var healthDrainTxt = new FlxText(windowNameTxt.x + 80,UI_songCreators.y + 20,'healthDrain'); + var healthBarBGTxt = new FlxText(5,hasNoGf.y + 20,'healthBarBG'); var tab_group_song = new FlxUI(null, UI_box); tab_group_song.name = "Song"; @@ -418,8 +496,31 @@ cStage = CoolUtil.coolTextFile(Paths.txt('stageList')); tab_group_assets.add(player1Label); tab_group_assets.add(player2Label); + var tab_group_settings = new FlxUI(null, UI_box); + tab_group_settings.name = "Settings"; + tab_group_settings.add(UI_songCreators); + tab_group_settings.add(UI_songHeadings); + tab_group_settings.add(UI_creditsTxt); + tab_group_settings.add(UI_dialogueMusic); + tab_group_settings.add(hasNoGf); + tab_group_settings.add(UI_intro); + tab_group_settings.add(UI_windowName); + tab_group_settings.add(UI_healthDrain); + tab_group_settings.add(UI_healthBarBG); + tab_group_settings.add(exploitationEffect); + tab_group_settings.add(recursedEffect); + tab_group_settings.add(songCreatorsTxt); + tab_group_settings.add(songHeadingsTxt); + tab_group_settings.add(creditsTxtTxt); + tab_group_settings.add(dialogueMusicTxt); + tab_group_settings.add(introTxt); + tab_group_settings.add(windowNameTxt); + tab_group_settings.add(healthDrainTxt); + tab_group_settings.add(healthBarBGTxt); + UI_box.addGroup(tab_group_song); UI_box.addGroup(tab_group_assets); + UI_box.addGroup(tab_group_settings); UI_box.scrollFactor.set(); FlxG.camera.follow(strumLine); @@ -539,7 +640,12 @@ cStage = CoolUtil.coolTextFile(Paths.txt('stageList')); FlxG.sound.playMusic(Paths.inst(daSong), 0.6); // WONT WORK FOR TUTORIAL OR TEST SONG!!! REDO LATER + if (FileSystem.exists(Paths.voicesPath(daSong, shagVoice ? "Shaggy" : ""))) { vocals = new FlxSound().loadEmbedded(Paths.voices(daSong, shagVoice ? "Shaggy" : "")); + } else { + vocals = new FlxSound(); + } + FlxG.sound.list.add(vocals); FlxG.sound.music.pause(); @@ -727,7 +833,17 @@ cStage = CoolUtil.coolTextFile(Paths.txt('stageList')); doSnapShit = !doSnapShit; Conductor.songPosition = FlxG.sound.music.time; - _song.song = typingShit.text; + + _song.song = UI_songTitle.text; + _song.songCreators = UI_songCreators.text; + _song.songHeadings = UI_songHeadings.text; + _song.creditsTxt = UI_creditsTxt.text; + _song.dialogueMusic = UI_dialogueMusic.text; + _song.intro = UI_intro.text; + _song.windowName = UI_windowName.text; + _song.healthDrain = UI_healthDrain.text; + _song.healthBarBG = UI_healthBarBG.text; + /* var left = FlxG.keys.justPressed.ONE; var down = FlxG.keys.justPressed.TWO; diff --git a/source/CreditsPopUp.hx b/source/CreditsPopUp.hx index ba48a82..88ba213 100644 --- a/source/CreditsPopUp.hx +++ b/source/CreditsPopUp.hx @@ -30,7 +30,6 @@ class CreditsPopUp extends FlxSpriteGroup var curHeading:SongHeading; public static var songCreator:String = ''; var rawJsonSettings:String; - var jsonSettings:PlayState.Settings; public function new(x:Float, y:Float) { @@ -39,12 +38,6 @@ class CreditsPopUp extends FlxSpriteGroup add(bg); var songCreatorIcon:String = ''; var headingPath:SongHeading = null; - if (FreeplayState.isaCustomSong) { - if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json')) { - rawJsonSettings = File.getContent(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json'); - jsonSettings = cast Json.parse(rawJsonSettings); - } - } switch (PlayState.SONG.song.toLowerCase()) { @@ -74,10 +67,8 @@ class CreditsPopUp extends FlxSpriteGroup case 'roofs': songCreator = 'sibottle'; default: - if (FreeplayState.isaCustomSong) { - if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json')) { - songCreator = jsonSettings.songCreators; - } + if (PlayState.SONG.songCreators != null) { + songCreator = PlayState.SONG.songCreators; } } switch (PlayState.storyWeek) @@ -120,14 +111,13 @@ class CreditsPopUp extends FlxSpriteGroup headingPath = {path: 'songHeadings/expungedHeading', antiAliasing: FlxG.save.data.antialiasing, animation: new Animation('expunged', 'Expunged', 24, true, [false, false]), iconOffset: 0}; default: - if (FreeplayState.isaCustomSong) { - if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json') && !FileSystem.exists(TitleState.modFolder + '/images/songHeadings/' + jsonSettings.songHeadings + '.xml')) { - headingPath = {path: 'songHeadings/' + jsonSettings.songHeadings, antiAliasing: false, iconOffset: 0}; + if (!FileSystem.exists(TitleState.modFolder + '/images/songHeadings/' + PlayState.SONG.songHeadings + '.xml')) { + headingPath = {path: 'songHeadings/' + PlayState.SONG.songHeadings, antiAliasing: false, iconOffset: 0}; } else { headingPath = {path: 'songHeadings/daveHeading', antiAliasing: false, iconOffset: 0}; } - } + } switch (PlayState.SONG.song.toLowerCase()) { @@ -136,13 +126,12 @@ class CreditsPopUp extends FlxSpriteGroup case 'interdimensional': headingPath = {path: 'songHeadings/interdimensionalHeading', antiAliasing: false, iconOffset: 0}; default: - if (FreeplayState.isaCustomSong) { - if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json') && !FileSystem.exists(TitleState.modFolder + '/images/songHeadings/' + jsonSettings.songHeadings + '.xml')) { - headingPath = {path: 'songHeadings/' + jsonSettings.songHeadings, antiAliasing: false, iconOffset: 0}; + + if (!FileSystem.exists(TitleState.modFolder + '/images/songHeadings/' + PlayState.SONG.songHeadings + '.xml')) { + headingPath = {path: 'songHeadings/' + PlayState.SONG.songHeadings, antiAliasing: false, iconOffset: 0}; } else { headingPath = {path: 'songHeadings/daveHeading', antiAliasing: false, iconOffset: 0}; } - } } if (PlayState.recursedStaticWeek) { @@ -167,7 +156,7 @@ class CreditsPopUp extends FlxSpriteGroup else { var info = headingPath.animation; - if (FileSystem.exists('assets/shared/images/' + headingPath.path + '.png')) { + if (FileSystem.exists('assets/shared/images/' + headingPath.path + '.png') ) { bg.frames = Paths.getSparrowAtlas(headingPath.path); bg.animation.addByPrefix(info.name, info.prefixName, info.frames, info.looped, info.flip[0], info.flip[1]); bg.animation.play(info.name); diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx index 7c62420..92aa955 100644 --- a/source/DialogueBox.hx +++ b/source/DialogueBox.hx @@ -78,8 +78,8 @@ class DialogueBox extends FlxSpriteGroup { super(); - if (PlayState.settingsExist && PlayState.jsonSettings.dialogueMusic != null) { - custom = PlayState.jsonSettings.dialogueMusic; + if ( PlayState.SONG.dialogueMusic != null) { + custom = PlayState.SONG.dialogueMusic; } else { custom = ''; } @@ -122,7 +122,7 @@ class DialogueBox extends FlxSpriteGroup case 'rano': FlxG.sound.playMusic(Paths.music('stocknightambianceforranolol'), 0); default: - if (PlayState.settingsExist) { + if (PlayState.SONG.dialogueMusic != null && PlayState.SONG.dialogueMusic != '') { if (custom == '') { FlxG.sound.music.stop(); } else { diff --git a/source/Note.hx b/source/Note.hx index f0e89c8..23d62fa 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -201,7 +201,7 @@ asd = !musthit; notePathLol = 'notes/NOTE_recursed'; } } - if(PlayState.settingsExist && PlayState.jsonSettings.recursedEffect && FreeplayState.isaCustomSong) { + if(PlayState.SONG.recursedEffect) { asd ? { if ((this.strumTime / 50) % 20 > 12 && !isSustainNote) { diff --git a/source/Paths.hx b/source/Paths.hx index 609a5a9..6a36f6a 100644 --- a/source/Paths.hx +++ b/source/Paths.hx @@ -205,6 +205,20 @@ class Paths } } + inline static public function voicesPath(song:String, addon:String = "") + { + if (!FreeplayState.isaCustomSong) { + + if (FileSystem.exists(TitleState.modFolder + '/' + 'assets/songs/${(song.toLowerCase())}/Voices${(addon)}' + '.ogg')) { + return TitleState.modFolder + '/' + 'assets/songs/${(song.toLowerCase())}/Voices${(addon)}' + '.ogg'; + } else { + return 'assets/songs/${song.toLowerCase()}/Voices${addon}.$SOUND_EXT'; + } + } else { + return 'mods/' + TitleState.currentMod + '/songs/${(song)}/Voices${(addon)}.ogg'; + } + } + inline static public function inst(song:String) { replaceSong = false; @@ -226,6 +240,20 @@ class Paths } } + inline static public function instPath(song:String, addon:String = "") + { + if (!FreeplayState.isaCustomSong) { + + if (FileSystem.exists(TitleState.modFolder + '/' + 'assets/songs/${(song.toLowerCase())}/Inst${(addon)}' + '.ogg')) { + return TitleState.modFolder + '/' + 'assets/songs/${(song.toLowerCase())}/Inst${(addon)}' + '.ogg'; + } else { + return 'assets/songs/${song.toLowerCase()}/Inst${addon}.$SOUND_EXT'; + } + } else { + return 'mods/' + TitleState.currentMod + '/songs/${(song)}/Inst${(addon)}.ogg'; + } + } + inline static public function externmusic(song:String) { return 'songs:assets/songs/extern/${song.toLowerCase()}.$SOUND_EXT'; diff --git a/source/PlayState.hx b/source/PlayState.hx index c1ae63f..b7ed954 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -130,20 +130,6 @@ typedef BackgroundJson = var shade:String; } -typedef Settings = { - var songCreators:String; - var songHeadings:String; - var creditsTxt:String; - var dialogueMusic:String; - var hasNoGf:Bool; - var intro:String; - var windowName:String; - var healthDrain:String; - var healthBarBG:String; - var exploitationEffect:Bool; - var recursedEffect:Bool; -} - /*typedef EventJson = { var events:Array; @@ -423,9 +409,6 @@ class PlayState extends MusicBeatState public var rawJsonStage:String; public var jsonStage:StageJson; - public static var rawJsonSettings:String; - public static var jsonSettings:Settings; - var holdCover:FlxSprite; var tristan:BGSprite; @@ -550,8 +533,6 @@ class PlayState extends MusicBeatState var shy:Float; var sh_r:Float = 60; - public static var settingsExist:Bool; - public static var rssongScore:Int = 0; public static var rsmisses:Int = 0; public static var rsaccuracy:Float = 0.00; @@ -581,22 +562,10 @@ class PlayState extends MusicBeatState bothS = FlxG.save.data.bothSides && SONG.song.toLowerCase() != 'shredder' && !isStoryMode; - settingsExist = FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json'); - isHighscore = false; - - resetShader(); - - if (FreeplayState.isaCustomSong && settingsExist) { - rawJsonSettings = File.getContent(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json'); - jsonSettings = cast Json.parse(rawJsonSettings); - } else if (isaReplacedSong && settingsExist) { - rawJsonSettings = File.getContent(TitleState.modFolder + '/' + Paths.chart(PlayState.SONG.song.toLowerCase())); - jsonSettings = cast Json.parse(rawJsonSettings); - } - //trace(jsonSettings.recursedEffect && settingsExist && FreeplayState.isaCustomSong); + //trace(SONG.recursedEffect && FreeplayState.isaCustomSong); switch (SONG.song.toLowerCase()) { @@ -636,12 +605,10 @@ class PlayState extends MusicBeatState add(blackScreen); case 'five-nights': inFiveNights = true; - default: - if ((FreeplayState.isaCustomSong && settingsExist) || (isaReplacedSong && settingsExist)) { - if (jsonSettings.exploitationEffect) { + default: + if (SONG.exploitationEffect) { Main.toggleFuckedFPS(true); } - } } scrollType = FlxG.save.data.downscroll ? 'downscroll' : 'upscroll'; @@ -945,11 +912,13 @@ class PlayState extends MusicBeatState } var noGFSongs = ['memory', 'five-nights', 'bot-trot', 'escape-from-california', 'overdrive']; - if ((FreeplayState.isaCustomSong && settingsExist) || (isaReplacedSong && settingsExist)) { - if (jsonSettings.hasNoGf) { + + if (SONG.hasNoGf) { noGFSongs.push(SONG.song.toLowerCase()); + } else if (FreeplayState.isaCustomSong || isaReplacedSong) { + noGFSongs.remove(SONG.song.toLowerCase()); } - } + if(SONG.gf != null) { @@ -1523,20 +1492,17 @@ class PlayState extends MusicBeatState case 'five-nights': healthBarPath = Paths.image('ui/fnafengine'); default: - if ((FreeplayState.isaCustomSong && settingsExist) || (isaReplacedSong && settingsExist)) { - if (FileSystem.exists(Paths.image('ui/' + jsonSettings.healthBarBG))) { - healthBarPath = Paths.image('ui/' + jsonSettings.healthBarBG); + + if (FileSystem.exists(Paths.image('ui/' + SONG.healthBarBG))) { + healthBarPath = Paths.image('ui/' + SONG.healthBarBG); } else { - if (jsonSettings.healthBarBG != '' && jsonSettings.healthBarBG != null) { + if (SONG.healthBarBG != null && SONG.healthBarBG != '') { customHealthBar = true; - healthBarPath = TitleState.modFolder + '/images/ui/' + jsonSettings.healthBarBG; + healthBarPath = TitleState.modFolder + '/images/ui/' + SONG.healthBarBG; } else { healthBarPath = Paths.image('ui/healthBar'); } } - } else { - healthBarPath = Paths.image('ui/healthBar'); - } } healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(customHealthBar ? Paths.customImage(healthBarPath) : healthBarPath); // I'm learning @@ -1579,16 +1545,10 @@ class PlayState extends MusicBeatState case 'kabunga': credits = LanguageManager.getTextString('kabunga_credit'); default: - if ((FreeplayState.isaCustomSong && settingsExist) || (isaReplacedSong && settingsExist)) { - - if (jsonSettings.creditsTxt == '') { - credits = ''; - } else { - credits = jsonSettings.creditsTxt; - } - } else { - credits = ''; - } + if (SONG.creditsTxt != null && SONG.creditsTxt != '') { + credits = SONG.creditsTxt; + } + } var creditsText:Bool = credits != ''; var textYPos:Float = healthBarBG.y + 50; @@ -1717,7 +1677,48 @@ class PlayState extends MusicBeatState } } - scoreTxt = new FlxText(healthBarBG.x + healthBarBG.width / 2 - 150, healthBarBG.y + 40, FlxG.width, "", 20); + if (inFiveNights) + { + if (FlxG.save.data.chars) { + iconP2 = new HealthIcon((formoverride == "none" || formoverride == "bf") ? SONG.player1 : formoverride, false); + iconP2.y = healthBar.y - (iconP2.height / 2); + add(iconP2); + + iconP1 = new HealthIcon(SONG.player2 == "bambi" ? "bambi-stupid" : SONG.player2, true); + iconP1.y = healthBar.y - (iconP1.height / 2); + add(iconP1); + } else { + iconP2 = new HealthIcon('face', false); + iconP2.y = healthBar.y - (iconP2.height / 2); + add(iconP2); + + iconP1 = new HealthIcon('face', true); + iconP1.y = healthBar.y - (iconP1.height / 2); + add(iconP1); + } + } + else + { + if (FlxG.save.data.chars) { + iconP1 = new HealthIcon((formoverride == "none" || formoverride == "bf") ? SONG.player1 : formoverride, true); + iconP1.y = healthBar.y - (iconP1.height / 2); + add(iconP1); + + iconP2 = new HealthIcon(SONG.player2 == "bambi" ? "bambi-stupid" : SONG.player2, false); + iconP2.y = healthBar.y - (iconP2.height / 2); + add(iconP2); + } else { + iconP2 = new HealthIcon('face', false); + iconP2.y = healthBar.y - (iconP2.height / 2); + add(iconP2); + + iconP1 = new HealthIcon('face', true); + iconP1.y = healthBar.y - (iconP1.height / 2); + add(iconP1); + } + } + + scoreTxt = new FlxText(healthBarBG.x + healthBarBG.width / 2 - 150, healthBarBG.y + 20, FlxG.width, "", 20); scoreTxt.setFormat((SONG.song.toLowerCase() == "overdrive") ? Paths.font("ariblk.ttf") : font, 20 * fontScaler, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); scoreTxt.scrollFactor.set(); scoreTxt.borderSize = 1.5 * fontScaler; @@ -1733,46 +1734,6 @@ class PlayState extends MusicBeatState botplayTxt.visible = botPlay; add(botplayTxt); - if (inFiveNights) - { - if (FlxG.save.data.chars) { - iconP2 = new HealthIcon((formoverride == "none" || formoverride == "bf") ? SONG.player1 : formoverride, false); - iconP2.y = healthBar.y - (iconP2.height / 2); - add(iconP2); - - iconP1 = new HealthIcon(SONG.player2 == "bambi" ? "bambi-stupid" : SONG.player2, true); - iconP1.y = healthBar.y - (iconP1.height / 2); - add(iconP1); - } else { - iconP2 = new HealthIcon('face', false); - iconP2.y = healthBar.y - (iconP2.height / 2); - add(iconP2); - - iconP1 = new HealthIcon('face', true); - iconP1.y = healthBar.y - (iconP1.height / 2); - add(iconP1); - } - } - else - { - if (FlxG.save.data.chars) { - iconP1 = new HealthIcon((formoverride == "none" || formoverride == "bf") ? SONG.player1 : formoverride, true); - iconP1.y = healthBar.y - (iconP1.height / 2); - add(iconP1); - - iconP2 = new HealthIcon(SONG.player2 == "bambi" ? "bambi-stupid" : SONG.player2, false); - iconP2.y = healthBar.y - (iconP2.height / 2); - add(iconP2); - } else { - iconP2 = new HealthIcon('face', false); - iconP2.y = healthBar.y - (iconP2.height / 2); - add(iconP2); - - iconP1 = new HealthIcon('face', true); - iconP1.y = healthBar.y - (iconP1.height / 2); - add(iconP1); - } - } strumLineNotes.cameras = [camHUD]; notes.cameras = [camHUD]; healthBar.cameras = [camHUD]; @@ -2743,21 +2704,14 @@ class PlayState extends MusicBeatState var introAssets:Map> = new Map>(); var introSoundAssets:Map> = new Map>(); var soundAssetsAlt:Array = new Array(); - if ((FreeplayState.isaCustomSong && settingsExist) || (isaReplacedSong && settingsExist)) { - if (SONG.song.toLowerCase() == "exploitation" || jsonSettings.intro == "ex") - introAssets.set('default', ['ui/ready', "ui/set", "ui/go_glitch"]); - else if (SONG.song.toLowerCase() == "overdrive" || jsonSettings.intro == "overdriving") - introAssets.set('default', ['ui/spr_start_sprites_0', "ui/spr_start_sprites_1", "ui/spr_start_sprites_2"]); - else - introAssets.set('default', ['ui/ready', "ui/set", "ui/go"]); - } else { - if (SONG.song.toLowerCase() == "exploitation") + + if (SONG.intro != null && SONG.song.toLowerCase() == "exploitation" || SONG.intro == "ex") introAssets.set('default', ['ui/ready', "ui/set", "ui/go_glitch"]); - else if (SONG.song.toLowerCase() == "overdrive") + else if (SONG.intro != null && SONG.song.toLowerCase() == "overdrive" || SONG.intro == "overdriving") introAssets.set('default', ['ui/spr_start_sprites_0', "ui/spr_start_sprites_1", "ui/spr_start_sprites_2"]); else introAssets.set('default', ['ui/ready', "ui/set", "ui/go"]); - } + introSoundAssets.set('default', ['default/intro3', 'default/intro2', 'default/intro1', 'default/introGo']); introSoundAssets.set('pixel', ['pixel/intro3-pixel', 'pixel/intro2-pixel', 'pixel/intro1-pixel', 'pixel/introGo-pixel']); @@ -2779,15 +2733,11 @@ class PlayState extends MusicBeatState case 'overdrive': soundAssetsAlt = introSoundAssets.get('overdriving'); default: - if ((FreeplayState.isaCustomSong && settingsExist) || (isaReplacedSong && settingsExist)) { - if (jsonSettings.intro == '' || jsonSettings.intro == null) { + if (SONG.intro == null || SONG.intro == '') { soundAssetsAlt = introSoundAssets.get('default'); } else { - soundAssetsAlt = introSoundAssets.get(jsonSettings.intro); + soundAssetsAlt = introSoundAssets.get(SONG.intro); } - } else { - soundAssetsAlt = introSoundAssets.get('default'); - } } var introAlts:Array = introAssets.get('default'); @@ -2990,7 +2940,16 @@ class PlayState extends MusicBeatState if (!paused) { + if (FileSystem.exists(Paths.instPath(PlayState.SONG.song))) { FlxG.sound.playMusic(Paths.inst(PlayState.SONG.song), 1, false); + } else { + PlatformUtil.sendFakeMsgBox("NO INST AT " + Paths.instPath(PlayState.SONG.song)); + if (isStoryMode) { + FlxG.switchState(new StoryMenuState()); + } else { + FlxG.switchState(new FreeplayState()); + } + } vocals.play(); } for (tween in tweenList) @@ -3084,13 +3043,12 @@ class PlayState extends MusicBeatState add(vignette); FlxTween.tween(vignette, {alpha: 0.7}, 1); default: - if ((FreeplayState.isaCustomSong && settingsExist) || (isaReplacedSong && settingsExist)) { - if (jsonSettings.windowName == "bambiWindowNames") { + + if (SONG.windowName == "bambiWindowNames") { Application.current.window.title = banbiWindowNames[new FlxRandom().int(0, banbiWindowNames.length - 1)]; - } else if (jsonSettings.windowName != "" && jsonSettings.windowName != null) { - Application.current.window.title = jsonSettings.windowName; + } else if (SONG.windowName != null && SONG.windowName != "") { + Application.current.window.title = SONG.windowName; } - } } } @@ -3103,10 +3061,11 @@ class PlayState extends MusicBeatState curSong = songData.song; - if (SONG.needsVoices) + if (SONG.needsVoices && FileSystem.exists(Paths.voicesPath(PlayState.SONG.song, localFunny == CharacterFunnyEffect.Tristan ? "-Tristan" : shaggyVoice ? "Shaggy" : ""))) { vocals = new FlxSound().loadEmbedded(Paths.voices(PlayState.SONG.song, localFunny == CharacterFunnyEffect.Tristan ? "-Tristan" : shaggyVoice ? "Shaggy" : "")); - else + }else { vocals = new FlxSound(); + } FlxG.sound.list.add(vocals); @@ -3710,7 +3669,7 @@ class PlayState extends MusicBeatState } } - if (SONG.song.toLowerCase() == 'recursed' || FlxG.save.data.randomNoteTypes > 0 || (settingsExist && jsonSettings.recursedEffect && (FreeplayState.isaCustomSong || isaReplacedSong))) + if (SONG.song.toLowerCase() == 'recursed' || FlxG.save.data.randomNoteTypes > 0 || SONG.recursedEffect ) { var scrollSpeed = 150; @@ -4298,8 +4257,8 @@ class PlayState extends MusicBeatState " | M1ss3s: " + (misses * (modchartoption ? FlxG.random.int(1,9) : 1)) + " | Accuracy: " + (truncateFloat(accuracy, 2) * (modchartoption ? FlxG.random.int(1,9) : 1)) + "% "; default: - if ((FreeplayState.isaCustomSong && settingsExist) || (isaReplacedSong && settingsExist)) { - if (jsonSettings.exploitationEffect) { + + if (SONG.exploitationEffect) { scoreTxt.text = "Scor3: " + (songScore * (modchartoption ? FlxG.random.int(1,9) : 1)) + " | M1ss3s: " + (misses * (modchartoption ? FlxG.random.int(1,9) : 1)) + @@ -4310,12 +4269,6 @@ class PlayState extends MusicBeatState LanguageManager.getTextString('play_miss') + misses + " | " + LanguageManager.getTextString('play_accuracy') + truncateFloat(accuracy, 2) + "%"; } - } else { - scoreTxt.text = - LanguageManager.getTextString('play_score') + Std.string(songScore) + " | " + - LanguageManager.getTextString('play_miss') + misses + " | " + - LanguageManager.getTextString('play_accuracy') + truncateFloat(accuracy, 2) + "%"; - } } if (noMiss) { @@ -4973,23 +4926,22 @@ class PlayState extends MusicBeatState health = 0.001; } default: - if ((FreeplayState.isaCustomSong && settingsExist) || (isaReplacedSong && settingsExist)) { - if (jsonSettings.healthDrain == "cheating") { + if (SONG.healthDrain != null && SONG.healthDrain == "cheating") { health -= healthtolower; - } else if (jsonSettings.healthDrain == "unfairness") { + } else if (SONG.healthDrain != null && SONG.healthDrain == "unfairness") { var healthadj = 3; switch (storyDifficulty) { case 0: healthadj = 4; } health -= (healthtolower / healthadj); - } else if (jsonSettings.healthDrain == "exploitation") { + } else if (SONG.healthDrain != null && SONG.healthDrain == "exploitation") { if (((health + (FlxEase.backInOut(health / 16.5)) - 0.002) >= 0)) { health += ((FlxEase.backInOut(health / 16.5)) * (curBeat <= 160 ? 0.25 : 1)) - 0.002; //some training wheels cuz rapparep say mod too hard } - } else if (jsonSettings.healthDrain == "mealie") { + } else if (SONG.healthDrain != null && SONG.healthDrain == "mealie") { health -= (healthtolower / 1.5); - } else if (jsonSettings.healthDrain == "fn") { + } else if (SONG.healthDrain != null && SONG.healthDrain == "fn") { if ((health - 0.023) > 0) { health -= 0.023; @@ -4999,7 +4951,7 @@ class PlayState extends MusicBeatState health = 0.001; } } - } + } // boyfriend.playAnim('hit',true); dad.holdTimer = 0; @@ -5472,6 +5424,10 @@ class PlayState extends MusicBeatState if (storyDifficulty == 0) CharacterSelectState.unlockCharacter('redshaggy'); } + if (SONG.windowName != null && SONG.windowName != "") { + Application.current.window.title = Main.applicationName; + } + if (isStoryMode) @@ -9037,8 +8993,7 @@ if (oppM) { makeInvisibleNotes(false); } } - if ((FreeplayState.isaCustomSong && settingsExist) || (isaReplacedSong && settingsExist)) { - if (SONG.song.toLowerCase() == 'exploitation' || jsonSettings.exploitationEffect && curStep % 8 == 0) + if (SONG.song.toLowerCase() == 'exploitation' || SONG.exploitationEffect && curStep % 8 == 0) { var fonts = ['arial', 'chalktastic', 'openSans', 'pkmndp', 'barcode', 'vcr']; var chosenFont = fonts[FlxG.random.int(0, fonts.length)]; @@ -9052,22 +9007,7 @@ if (oppM) { songName.font = Paths.font('exploit/${chosenFont}.ttf'); } } - } else { - if (SONG.song.toLowerCase() == 'exploitation' && curStep % 8 == 0) - { - var fonts = ['arial', 'chalktastic', 'openSans', 'pkmndp', 'barcode', 'vcr']; - var chosenFont = fonts[FlxG.random.int(0, fonts.length)]; - kadeEngineWatermark.font = Paths.font('exploit/${chosenFont}.ttf'); - kadeEngineWatermark2.font = Paths.font('exploit/${chosenFont}.ttf'); - creditsWatermark.font = Paths.font('exploit/${chosenFont}.ttf'); - scoreTxt.font = Paths.font('exploit/${chosenFont}.ttf'); - botplayTxt.font = Paths.font('exploit/${chosenFont}.ttf'); - if (songName != null) - { - songName.font = Paths.font('exploit/${chosenFont}.ttf'); - } - } - } + #if desktop if (FlxG.save.data.discord) { DiscordClient.changePresence(detailsText @@ -9779,7 +9719,7 @@ if (oppM) { } #end - if (SONG.song.toLowerCase() == 'recursed' || FlxG.save.data.randomNoteTypes > 0 || (settingsExist && jsonSettings.recursedEffect && (FreeplayState.isaCustomSong || isaReplacedSong))) + if (SONG.song.toLowerCase() == 'recursed' || FlxG.save.data.randomNoteTypes > 0 || SONG.recursedEffect) { cancelRecursedCamTween(); } diff --git a/source/SaveDataHandler.hx b/source/SaveDataHandler.hx index c111abc..303e64a 100644 --- a/source/SaveDataHandler.hx +++ b/source/SaveDataHandler.hx @@ -171,5 +171,8 @@ class SaveDataHandler if (FlxG.save.data.csAllSongs == null) FlxG.save.data.csAllSongs = false; + + if (FlxG.save.data.darkModeWindow == null) + FlxG.save.data.darkModeWindow = true; } } \ No newline at end of file diff --git a/source/Song.hx b/source/Song.hx index 16c0a16..ba806ce 100644 --- a/source/Song.hx +++ b/source/Song.hx @@ -1,5 +1,6 @@ package; +import flixel.FlxG; import Section.SwagSection; import haxe.Json; import haxe.format.JsonParser; @@ -31,6 +32,18 @@ typedef SwagSong = var stage:String; var validScore:Bool; + + var songCreators:String; + var songHeadings:String; + var creditsTxt:String; + var dialogueMusic:String; + var hasNoGf:Bool; + var intro:String; + var windowName:String; + var healthDrain:String; + var healthBarBG:String; + var exploitationEffect:Bool; + var recursedEffect:Bool; } class Song @@ -64,10 +77,18 @@ class Song PlayState.isaReplacedSong = true; rawJson = File.getContent(TitleState.modFolder + '/' + Paths.chart(jsonInput.toLowerCase())).trim(); } - else + else if (FileSystem.exists(Paths.chart(jsonInput.toLowerCase()))) { PlayState.isaReplacedSong = false; rawJson = Assets.getText(Paths.chart(jsonInput.toLowerCase())).trim(); + } else { + rawJson = File.getContent(Paths.chart('warmup')).trim(); + PlatformUtil.sendFakeMsgBox("NO CHART AT " + Paths.chart(jsonInput.toLowerCase())); + if (PlayState.isStoryMode) { + FlxG.switchState(new StoryMenuState()); + } else { + FlxG.switchState(new FreeplayState()); + } } while (!rawJson.endsWith("}")) @@ -80,17 +101,28 @@ class Song public static function loadFromCustomJson(jsonInput:String):SwagSong { + var rawJson = ""; PlayState.isaReplacedSong = false; + if (FileSystem.exists(Paths.customChart(jsonInput.toLowerCase()))) { #if sys - var rawJson = File.getContent(Paths.customChart(jsonInput.toLowerCase())).trim(); + rawJson = File.getContent(Paths.customChart(jsonInput.toLowerCase())).trim(); #else - var rawJson = Assets.getText(Paths.chart(jsonInput.toLowerCase())).trim(); + rawJson = Assets.getText(Paths.chart(jsonInput.toLowerCase())).trim(); #end while (!rawJson.endsWith("}")) { rawJson = rawJson.substr(0, rawJson.length - 1); } + } else { + rawJson = File.getContent(Paths.chart('warmup')).trim(); + PlatformUtil.sendFakeMsgBox("NO CUSTOM CHART AT " + Paths.customChart(jsonInput.toLowerCase())); + if (PlayState.isStoryMode) { + FlxG.switchState(new StoryMenuState()); + } else { + FlxG.switchState(new FreeplayState()); + } + } return parseJSONshit(rawJson); } diff --git a/source/TitleState.hx b/source/TitleState.hx index 5ac971e..b9a37dd 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -27,6 +27,9 @@ import lime.app.Application; #if desktop import Discord.DiscordClient; #end +#if cpp +import cpp.CPPInterface; +#end // only load this reference if its debug because its only needed for debug??? idk it might help with the file size or something #if debug @@ -72,11 +75,13 @@ class TitleState extends MusicBeatState override public function create():Void { - //fun = FlxG.random.int(0, 999); - //if(fun == 1) - //{ - // LoadingState.loadAndSwitchState(new SusState()); - //} + #if !debug + fun = FlxG.random.int(0, 999); + if(fun == 1) + { + LoadingState.loadAndSwitchState(new SusState()); + } + #end @@ -126,6 +131,14 @@ class TitleState extends MusicBeatState awaitingExploitation = FlxG.save.data.exploitationState == 'awaiting'; + + #if windows + if (FlxG.save.data.darkModeWindow) + CPPInterface.darkMode(); + else + CPPInterface.lightMode(); + #end + #if FREEPLAY FlxG.switchState(new FreeplayState()); #elseif CHARTING @@ -146,6 +159,12 @@ class TitleState extends MusicBeatState } } trace(mods + ' ' + currentMod); + + if (!mods.contains(currentMod)) { + FlxG.save.data.Mod = ''; + currentMod = ''; + } + var rawBGDJson:String; if (FileSystem.exists(Paths.json('BaseGameDeleter'))) { diff --git a/source/cpp/CPPInterface.hx b/source/cpp/CPPInterface.hx new file mode 100644 index 0000000..e451f3b --- /dev/null +++ b/source/cpp/CPPInterface.hx @@ -0,0 +1,50 @@ +package cpp; + +import cpp.UInt64; +import cpp.ConstCharStar; + +/** + * ! LITTERLY THE ONLY REASON THIS EXIST IS BECAUSE IF YOU NATIVELY INTERACT WITH THE CPPWindows.hx FILE + * ! THE COMPILIER WILL CRY + */ +class CPPInterface +{ + #if windows + public static function darkMode() + { + CPPWindows.setWindowColorMode(DARK); + } + + public static function lightMode() + { + CPPWindows.setWindowColorMode(LIGHT); + } + + public static function setWindowAlpha(a:Float) + { + CPPWindows.setWindowAlpha(a); + } + + public static function _setWindowLayered() + { + CPPWindows._setWindowLayered(); + } + + public static function messageBox(msg:ConstCharStar = null, title:ConstCharStar = null, ?handler:NullVoid> = null) + { + CPPWindows.messageBox(msg, title, handler); + } + #end + + #if windows + public static function getRam():UInt64 + { + return CPPWindows.obtainRAM(); + } + #elseif linux + public static function getRam():UInt64 + { + return CPPLinux.obtainRAM(); + } + #end +} diff --git a/source/cpp/CPPWindows.hx b/source/cpp/CPPWindows.hx new file mode 100644 index 0000000..7a160dd --- /dev/null +++ b/source/cpp/CPPWindows.hx @@ -0,0 +1,118 @@ +package cpp; + +import cpp.ConstCharStar; +import cpp.Native; +import cpp.UInt64; + +#if cpp +#if windows +@:buildXml(' + + + + ') +@:headerCode(' + #include + #include + #include + #include + #include + #include + ') +#end +#end +class CPPWindows +{ + #if cpp + #if windows + @:functionCode(' + int darkMode = mode; + HWND window = GetActiveWindow(); + if (S_OK != DwmSetWindowAttribute(window, 19, &darkMode, sizeof(darkMode))) { + DwmSetWindowAttribute(window, 20, &darkMode, sizeof(darkMode)); + } + UpdateWindow(window); + ') + public static function _setWindowColorMode(mode:Int) + { + } + + public static function setWindowColorMode(mode:WindowColorMode) + { + var darkMode:Int = cast(mode, Int); + + if (darkMode > 1 || darkMode < 0) + { + trace("WindowColorMode Not Found..."); + + return; + } + + _setWindowColorMode(darkMode); + } + + @:functionCode(' + HWND window = GetActiveWindow(); + SetWindowLong(window, GWL_EXSTYLE, GetWindowLong(window, GWL_EXSTYLE) ^ WS_EX_LAYERED); + ') + @:noCompletion + public static function _setWindowLayered() + { + } + + @:functionCode(' + HWND window = GetActiveWindow(); + + float a = alpha; + + if (alpha > 1) { + a = 1; + } + if (alpha < 0) { + a = 0; + } + + SetLayeredWindowAttributes(window, 0, (255 * (a * 100)) / 100, LWA_ALPHA); + + ') + /** + * Set Whole Window's Opacity + * ! MAKE SURE TO CALL _setWindowLayered(); BEFORE RUNNING THIS + * @param alpha + */ + public static function setWindowAlpha(alpha:Float) + { + return alpha; + } + + @:functionCode(" + unsigned long long allocatedRAM = 0; + GetPhysicallyInstalledSystemMemory(&allocatedRAM); + return (allocatedRAM / 1024); + ") + public static function obtainRAM():UInt64 + { + return 0; + } + + // ! https://github.com/brightfyregit/Indie-Cross-Public/blob/master/source/SpecsDetector.hx#L87-L102 + public static function messageBox(msg:ConstCharStar = null, title:ConstCharStar = null, ?handler:NullVoid>) + { + var msgID:Int = untyped MessageBox(null, msg, title, untyped __cpp__("MB_ICONERROR | MB_OK")); + + if (handler != null) + handler(msgID); + + return true; + } + #end + #end +} + +#if windows +enum abstract WindowColorMode(Int) +{ + var DARK:WindowColorMode = 1; + var LIGHT:WindowColorMode = 0; +} +#end diff --git a/source/options/OptionsMenu.hx b/source/options/OptionsMenu.hx index 99b8a30..8f20e27 100644 --- a/source/options/OptionsMenu.hx +++ b/source/options/OptionsMenu.hx @@ -67,6 +67,7 @@ typedef OptionsJson = var adminMode:Bool; var wantShaders:Bool; var checkVersion:Bool; + var darkModeWindow:Bool; } class OptionsMenu extends MusicBeatState @@ -285,7 +286,8 @@ class OptionsMenu extends MusicBeatState "comboStack": FlxG.save.data.comboStack, "discord": FlxG.save.data.discord, "healthBO": FlxG.save.data.healthBO, - "checkVersion": FlxG.save.data.checkVersion + "checkVersion": FlxG.save.data.checkVersion, + "darkModeWindow": FlxG.save.data.darkModeWindow }; var data:String = Json.stringify(json); @@ -392,6 +394,7 @@ class OptionsMenu extends MusicBeatState FlxG.save.data.discord = jsonOptions.discord; FlxG.save.data.healthBO = jsonOptions.healthBO; FlxG.save.data.checkVersion = jsonOptions.checkVersion; + FlxG.save.data.darkModeWindow = jsonOptions.darkModeWindow; _file = null; diff --git a/source/options/Visuals.hx b/source/options/Visuals.hx index ee402e6..8d26cd2 100644 --- a/source/options/Visuals.hx +++ b/source/options/Visuals.hx @@ -20,6 +20,9 @@ import Discord.DiscordClient; #end import sys.io.Process; import sys.io.File; +#if cpp +import cpp.CPPInterface; +#end class Visuals extends MusicBeatState { @@ -75,6 +78,7 @@ class Visuals extends MusicBeatState + "\n" + (FlxG.save.data.discord ? "Discord Rich Presence ON" : "Discord Rich Presence OFF") + "\n" + ("Health Bar and Icon Transparency") + "\n" + (FlxG.save.data.checkVersion ? "Check For Updates ON" : "Check For Updates OFF") + + "\n" + (FlxG.save.data.darkModeWindow ? "Window Bar Dark Mode ON" : "Window Bar Dark Mode OFF") ); grpControls = new FlxTypedGroup(); @@ -210,6 +214,13 @@ class Visuals extends MusicBeatState case 16: FlxG.save.data.checkVersion = !FlxG.save.data.checkVersion; updateGroupControls(FlxG.save.data.checkVersion ? 'Check For Updates ON' : 'Check For Updates OFF', 12, 'Vertical'); + case 17: + FlxG.save.data.darkModeWindow = !FlxG.save.data.darkModeWindow; + updateGroupControls(FlxG.save.data.darkModeWindow ? 'Window Bar Dark Mode ON' : 'Window Bar Dark Mode OFF', 12, 'Vertical'); + if (FlxG.save.data.darkModeWindow) + CPPInterface.darkMode(); + else + CPPInterface.lightMode(); } } }