Skip to content

Commit

Permalink
added tjson
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Jan 16, 2025
1 parent 7b9b42f commit 4b32833
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<set name="BUILD_DIR" value="export/release" unless="debug" />

<source path="source" />

<assets path="assets" />
<assets path="mods" if="FUTURE_POLYMOD" />

Expand All @@ -40,6 +39,7 @@
<haxelib name="funkin.vis" />
<haxelib name="grig.audio" />

<haxelib name="tjson" />
<haxelib name="hscript" if="SIMPLE_SCRIPT" />
<haxelib name="polymod" if="FUTURE_POLYMOD" />
<haxelib name="hxcpp-debug-server" if="desktop debug" />
Expand Down
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* [ ] Discord Rich Presence Support
* [ ] Sustain Notes + New song
* [ ] Improve Chart Editor
* [ ] Improve Note Assets
* [ ] Silly Visualizer Option
* [ ] Gameplay Modifiers
* [ ] Noteskins
4 changes: 4 additions & 0 deletions haxelibs.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"name": "hscript",
"type": "haxelib"
},
{
"name": "tjson",
"type": "haxelib"
},
{
"name": "funkin.vis",
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions source/backend/Achievements.hx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Achievements {
if (achievementName != "") {
achievements.push(achievementName);
try {
Json.parse(Paths.getText(Paths.json('achievements/$achievementName')));
TJSON.parse(Paths.getText(Paths.json('achievements/$achievementName')));
trace("Achievement '" + achievement + "' loaded");
} catch (e:Dynamic) {
trace('Error loading achievement: $e');
Expand Down Expand Up @@ -104,7 +104,7 @@ class Achievements {
public static function showAchievement(ach:String, ?onFinish:Void->Void) {
var sprGroup:FlxSpriteGroup = new FlxSpriteGroup();

var coolAchieve:AchievementData = cast Json.parse(File.getContent(Paths.json('achievements/$ach')));
var coolAchieve:AchievementData = cast TJSON.parse(File.getContent(Paths.json('achievements/$ach')));

var achBG:FlxSprite = new FlxSprite(60, 50).makeGraphic(420, 120, FlxColor.BLACK);
achBG.scrollFactor.set();
Expand Down
2 changes: 1 addition & 1 deletion source/backend/Localization.hx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Localization {
jsonContent = Paths.getText(path(DEFAULT_LANGUAGE));
}

return Json.parse(jsonContent);
return TJSON.parse(jsonContent);
}

public static function switchLanguage(newLanguage:String) {
Expand Down
1 change: 1 addition & 0 deletions source/import.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import lime.app.Application;

import haxe.*;
import haxe.io.Path;
import tjson.TJSON;

#if sys
import sys.*;
Expand Down
1 change: 1 addition & 0 deletions source/modding/Hscript.hx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class Hscript extends FlxBasic {
#if sys
setVariable('Sys', Sys);
#end
setVariable('TJSON', TJSON);
setVariable('Type', Type);
setVariable('Xml', Xml);

Expand Down
2 changes: 1 addition & 1 deletion source/states/AchievementsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class AchievementsState extends ExtendableState {

function initAchievementData() {
for (i in 0...Achievements.achievements.length) {
var coolAchieve:AchievementData = cast Json.parse(File.getContent(Paths.json('achievements/' + Achievements.achievements[i])));
var coolAchieve:AchievementData = cast TJSON.parse(File.getContent(Paths.json('achievements/' + Achievements.achievements[i])));
achievementArray.push(coolAchieve);

var stringToUse:String = coolAchieve.name;
Expand Down
2 changes: 1 addition & 1 deletion source/states/CreditsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CreditsState extends ExtendableState {
override function create() {
super.create();

credData = Json.parse(Paths.getTextFromFile('credits.json'));
credData = TJSON.parse(Paths.getTextFromFile('credits.json'));

camFollow = new FlxObject(80, 0, 0, 0);
camFollow.screenCenter(X);
Expand Down
6 changes: 5 additions & 1 deletion source/states/SongSelectState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class SongSelectState extends ExtendableState {
Paths.clearStoredMemory();
Paths.clearUnusedMemory();

songListData = Json.parse(Paths.getTextFromFile('songs.json'));
songListData = TJSON.parse(Paths.getTextFromFile('songs.json'));

var bg:FlxSprite = new GameSprite().loadGraphic(Paths.image('menu/backgrounds/selector_bg'));
add(bg);
Expand All @@ -52,6 +52,10 @@ class SongSelectState extends ExtendableState {
grid.velocity.set(40, 40);
add(grid);

var bgPanel:FlxSprite = new FlxSprite(0, FlxG.height / 2).makeGraphic(FlxG.width, 760, FlxColor.BLACK);
bgPanel.alpha = 0.8;
add(bgPanel);

coverGrp = new FlxTypedGroup<Cover>();
add(coverGrp);

Expand Down

0 comments on commit 4b32833

Please sign in to comment.