Skip to content

Commit

Permalink
idk what im doing
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored May 27, 2024
1 parent b4bf19e commit ecc86ea
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
APIStuff.hx
.DS_STORE
NGio.hx
/io/
io/

art/mod.url
!mods/introMod/
Expand Down
10 changes: 6 additions & 4 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@
<set name="BUILD_DIR" value="export/32bit" if="32bits" />

<source path="source" />
<assets path="assets" exclude="*.ogg" if="web" />
<assets path="assets" exclude="*.mp3|*.mp4" unless="web" />

<assets path="assets" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets" exclude="*.fla|*.mp3|*.mp4|*.wav" unless="web" />
<assets path="assets/artemis" library="artemis" if="windows"/>
<assets path="assets/videos" library="videos" if="VIDEOS_ALLOWED || WEBM_ALLOWED || FLASH_MOVIE"/>

<assets path="mods" embed="false" type="template" if="MODS_ALLOWED" />
<assets path="modsList.txt" if="MODS_ALLOWED" />

<assets path='art/readme.txt' rename='about.txt' />
<assets path='art/readme.txt' rename='about.txt' libary="art"/>
<assets path='LICENSE' rename='LICENSE.txt' />

<!-- [ Libraries ] -->
Expand All @@ -84,7 +86,6 @@
<haxelib name="actuate" /> <!-- Used for extension-webm -->
<haxelib name="extension-webm" if="WEBM_ALLOWED" />
<haxelib name="hxCodec" if="VIDEOS_ALLOWED" />
<haxelib name="swf" if="FLASH_MOVIE" />

<haxelib name="linc_discord-rpc" if="desktop" />
<haxelib name="hxcpp-debug-server" if="desktop debug" />
Expand All @@ -104,6 +105,7 @@
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />
<haxedef name="HXCPP_CHECK_POINTER" if="CRASH_HANDLER" />
<haxedef name="HXCPP_STACK_LINE" if="CRASH_HANDLER" />
<haxedef name="HXCPP_STACK_TRACE" if="CRASH_HANDLER" />
<haxedef name="HXCPP_GC_BIG_BLOCKS" />

<haxedef name="no-deprecation-warnings" />
Expand Down
4 changes: 0 additions & 4 deletions compileData/haxelibs.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@
"name": "hxCodec",
"type": "haxelib"
},
{
"name": "swf",
"type": "haxelib"
},
{
"name": "fnf-modcharting-tools",
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions mods/locales/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ okay okay
so basically, you just need two main text files

'languagesList' - simply your list of languages (de, en, es, fr, it, and so on...)
'languagesData' - this is so the languages can be pushed into LanguageSubState
'languagesData' - this is so the languages can be pushed into LanguageState

formatting example:
languagesData formatting example:
Deustch:de
English:en
etc...
Expand Down
10 changes: 5 additions & 5 deletions source/meta/state/BruhState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ class BruhState extends MusicBeatState
override function create()
{
super.create();
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('kbhgames'));
add(bg);
add(new FlxSprite().loadGraphic(Paths.image('kbhgames')));
}

override function update(elapsed:Float)
{
if (FlxG.keys.justPressed.ESCAPE)
CoolUtil.browserLoad('https://github.com/Joalor64GH/Joalor64-Engine-Rewrite/releases/latest');
else if (FlxG.keys.justPressed.ENTER)
if (FlxG.keys.justPressed.ESCAPE || FlxG.keys.justPressed.ENTER) {
FlxG.switchState(() -> new MainMenuState());
if (!FlxG.keys.justPressed.ENTER)
CoolUtil.browserLoad('https://github.com/Joalor64GH/Joalor64-Engine-Rewrite/releases/latest');
}
super.update(elapsed);
}
}
124 changes: 68 additions & 56 deletions source/meta/state/CreditsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import sys.io.File;

class CreditsState extends MusicBeatState
{
var curSelected:Int = -1;
var camFollow = new FlxPoint(FlxG.width * 0.5, FlxG.height * 0.5);
var camFollowPos = new FlxObject();

var realIndex:Int = 0;
var curSelected(default, set):Int = -1;

private var grpOptions:FlxTypedGroup<Alphabet>;
private var iconArray:Array<AttachedSprite> = [];
Expand Down Expand Up @@ -38,9 +42,18 @@ class CreditsState extends MusicBeatState
#end

persistentUpdate = true;

FlxG.camera.follow(camFollowPos);
FlxG.camera.bgColor = FlxColor.BLACK;
camFollowPos.setPosition(camFollow.x, camFollow.y);

bg = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
bg.screenCenter().scrollFactor.set();
if (FlxG.height < FlxG.width)
bg.scale.x = bg.scale.y = (FlxG.height * 1.05) / bg.frameHeight;
else
bg.scale.x = bg.scale.y = (FlxG.width * 1.05) / bg.frameWidth;
add(bg);
bg.screenCenter();

grpOptions = new FlxTypedGroup<Alphabet>();
add(grpOptions);
Expand Down Expand Up @@ -318,11 +331,12 @@ class CreditsState extends MusicBeatState

for (i in 0...creditsStuff.length)
{
var id = realIndex++;
var isSelectable:Bool = !unselectableCheck(i);
var optionText:Alphabet = new Alphabet(FlxG.width / 2, 300, creditsStuff[i][0], !isSelectable);
var optionText:Alphabet = new Alphabet(0, 240 * id, creditsStuff[i][0], !isSelectable);
optionText.x = 120;
optionText.targetX = 90;
optionText.isMenuItem = true;
optionText.targetY = i;
optionText.changeX = false;
optionText.snapToPosition();
grpOptions.add(optionText);

Expand All @@ -332,7 +346,8 @@ class CreditsState extends MusicBeatState
Mods.currentModDirectory = creditsStuff[i][5];

var icon:AttachedSprite = new AttachedSprite('credits/' + creditsStuff[i][1]);
icon.xAdd = optionText.width + 10;
icon.xAdd = optionText.width + 15;
icon.yAdd = 15;
icon.sprTracker = optionText;

// using a FlxGroup is too much fuss!
Expand All @@ -344,7 +359,7 @@ class CreditsState extends MusicBeatState
curSelected = i;
}
else
optionText.alignment = CENTERED;
optionText.screenCenter(X);
}

descBox = new AttachedSprite();
Expand All @@ -353,6 +368,7 @@ class CreditsState extends MusicBeatState
descBox.yAdd = -10;
descBox.alphaMult = 0.6;
descBox.alpha = 0.6;
descBox.scrollFactor.set();
add(descBox);

descText = new FlxText(50, FlxG.height + offsetThing - 25, 1180, "", 32);
Expand All @@ -376,7 +392,7 @@ class CreditsState extends MusicBeatState
#if sys
ArtemisIntegration.setBackgroundFlxColor (intendedColor);
#end
changeSelection();
updateSelection();
super.create();
}

Expand All @@ -386,9 +402,14 @@ class CreditsState extends MusicBeatState
override function update(elapsed:Float)
{
if (FlxG.sound.music.volume < 0.7)
{
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
}

var farAwaySpeedup = 0.002 * Math.max(0, Math.abs(camFollowPos.y - camFollow.y) - 360);
var lerpVal = Math.exp(-elapsed * (9.6 + farAwaySpeedup));
camFollowPos.setPosition(
FlxMath.lerp(camFollow.x, camFollowPos.x, lerpVal),
FlxMath.lerp(camFollow.y, camFollowPos.y, lerpVal)
);

if (!quitting)
{
Expand All @@ -403,12 +424,12 @@ class CreditsState extends MusicBeatState

if (upP)
{
changeSelection(-shiftMult);
curSelected - shiftMult;
holdTime = 0;
}
if (downP)
{
changeSelection(shiftMult);
curSelected + shiftMult;
holdTime = 0;
}

Expand All @@ -419,9 +440,7 @@ class CreditsState extends MusicBeatState
var checkNewHold:Int = Math.floor((holdTime - 0.5) * 10);

if (holdTime > 0.5 && checkNewHold - checkLastHold > 0)
{
changeSelection((checkNewHold - checkLastHold) * (controls.UI_UP ? -shiftMult : shiftMult));
}
curSelected += (checkNewHold - checkLastHold) * (controls.UI_UP ? -shiftMult : shiftMult);
}
}

Expand All @@ -445,14 +464,11 @@ class CreditsState extends MusicBeatState
if (controls.BACK)
{
if (colorTween != null)
{
colorTween.cancel();
}

FlxG.sound.play(Paths.sound('cancelMenu'));
if (ClientPrefs.simpleMain)
FlxG.switchState(() -> new SimpleMainMenuState());
else
FlxG.switchState(() -> new MainMenuState());
FlxG.switchState((ClientPrefs.simpleMain) ? () -> new SimpleMainMenuState() : () -> new MainMenuState());

quitting = true;
}
}
Expand All @@ -469,29 +485,34 @@ class CreditsState extends MusicBeatState
item.x = FlxMath.lerp(lastX, item.x - 70, lerpVal);
}
else
{
item.x = FlxMath.lerp(item.x, 200 + -40 * Math.abs(item.targetY), lerpVal);
}
}
}
super.update(elapsed);
}

var moveTween:FlxTween = null;

function changeSelection(change:Int = 0)
function set_curSelected(change:Int)
{
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
do
{
curSelected += change;
if (curSelected < 0)
if (change < 0)
curSelected = creditsStuff.length - 1;
if (curSelected >= creditsStuff.length)
if (change >= creditsStuff.length)
curSelected = 0;
}
while (unselectableCheck(curSelected));

updateSelection();
return curSelected = change;
}

function updateSelection(playSound:Bool = true)
{
if (playSound)
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);

var newColor:FlxColor = CoolUtil.colorFromString(creditsStuff[curSelected][4]);
trace('The BG color is: $newColor');
if (newColor != intendedColor)
Expand All @@ -504,35 +525,30 @@ class CreditsState extends MusicBeatState
ArtemisIntegration.setBackgroundFlxColor (intendedColor);
#end
colorTween = FlxTween.color(bg, 1, bg.color, intendedColor, {
onComplete: function(twn:FlxTween)
{
colorTween = null;
}
onComplete: function(twn:FlxTween) -> colorTween = null;
});
}

var bullShit:Int = 0;

for (item in grpOptions.members)
for (num => item in grpOptions.members)
{
item.targetY = bullShit - curSelected;
bullShit++;

if (!unselectableCheck(bullShit - 1))
{
item.alpha = 0.6;
if (item.targetY == 0)
{
item.alpha = 1;
}
}
item.targetY = num - curSelected;
if (!unselectableCheck(num - 1))
item.alpha = (item.targetY == 0) ? 1 : 0.6;
}

var selectedOption:Alphabet = grpOptions.members[curSelected];

if (selectedOption != null) {
var title = selectedOption;
camFollow.y = title.y + title.height * 0.5 + 20;
}
else if (unselectableCheck(curSelected))
camFollow.y = FlxG.height * 0.5;

descText.text = creditsStuff[curSelected][2];
descText.y = FlxG.height - descText.height + offsetThing - 60;

if (moveTween != null)
moveTween.cancel();
if (moveTween != null) moveTween.cancel();
moveTween = FlxTween.tween(descText, {y: descText.y + 75}, 0.25, {ease: FlxEase.sineOut});

descBox.setGraphicSize(Std.int(descText.width + 20), Std.int(descText.height + 25));
Expand All @@ -543,19 +559,15 @@ class CreditsState extends MusicBeatState
function pushModCreditsToList(folder:String)
{
var creditsFile:String = null;
if (folder != null && folder.trim().length > 0)
creditsFile = Paths.mods(folder + '/data/credits.txt');
else
creditsFile = Paths.mods('data/credits.txt');
creditsFile = (folder != null && folder.trim().length > 0) ?
Paths.mods(folder + '/data/credits.txt') : Paths.mods('data/credits.txt');

if (FileSystem.exists(creditsFile))
{
var firstarray:Array<String> = File.getContent(creditsFile).split('\n');
for (i in firstarray)
{
for (i in firstarray) {
var arr:Array<String> = i.replace('\\n', '\n').split("::");
if (arr.length >= 5)
arr.push(folder);
if (arr.length >= 5) arr.push(folder);
creditsStuff.push(arr);
}
creditsStuff.push(['']);
Expand Down
Loading

0 comments on commit ecc86ea

Please sign in to comment.