Skip to content

Commit cd41696

Browse files
committed
Remove spritesAreAngy, handle exceptions in git processes.
Signed-off-by: TechnikTil <techniktil@tilnotdrip.org>
1 parent 0517d17 commit cd41696

2 files changed

Lines changed: 48 additions & 43 deletions

File tree

Project.hxp

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -220,63 +220,87 @@ class Project extends HXProject
220220

221221
function isGitInitialized():Bool
222222
{
223-
var gitProcess:Process = new Process('git', ['status']);
223+
try
224+
{
225+
var gitProcess:Process = new Process('git', ['status']);
224226

225-
var exitCode:Int = gitProcess.exitCode();
226-
gitProcess.close();
227+
var exitCode:Int = gitProcess.exitCode();
228+
gitProcess.close();
229+
230+
return exitCode == 0;
231+
}
232+
catch(e:Exception)
233+
{
234+
return false;
235+
}
227236

228-
return exitCode == 0;
229237
}
230238

231239
function getGitHash():String
232240
{
233-
var gitProcess:Process = new Process('git', ['rev-parse', 'HEAD']);
241+
try
242+
{
243+
var gitProcess:Process = new Process('git', ['rev-parse', 'HEAD']);
234244

235-
var gitHash:String = gitProcess.stdout.readLine().trim();
236-
var exitCode:Int = gitProcess.exitCode();
237-
gitProcess.close();
245+
var gitHash:String = gitProcess.stdout.readLine().trim();
246+
var exitCode:Int = gitProcess.exitCode();
247+
gitProcess.close();
238248

239-
if (exitCode != 0)
249+
if (exitCode != 0)
250+
throw new Exception("Non-Zero Exit Code");
251+
252+
return gitHash;
253+
}
254+
catch(e:Exception)
240255
{
241256
trace('[WARNING] Unable to get current git repository hash.');
242257
return null;
243258
}
244-
245-
return gitHash;
246259
}
247260

248261
function getGitBranch():String
249262
{
250-
var gitProcess:Process = new Process('git', ['rev-parse', '--abbrev-ref', 'HEAD']);
263+
try
264+
{
265+
var gitProcess:Process = new Process('git', ['rev-parse', '--abbrev-ref', 'HEAD']);
251266

252-
var gitBranch:String = gitProcess.stdout.readLine().trim();
253-
var exitCode:Int = gitProcess.exitCode();
254-
gitProcess.close();
267+
var gitBranch:String = gitProcess.stdout.readLine().trim();
268+
var exitCode:Int = gitProcess.exitCode();
269+
gitProcess.close();
255270

256-
if (exitCode != 0)
271+
if (exitCode != 0)
272+
throw new Exception("Non-Zero Exit Code");
273+
274+
return gitBranch;
275+
}
276+
catch(e:Exception)
257277
{
258278
trace('[WARNING] Unable to get current git repository branch.');
259279
return null;
260280
}
261-
262-
return gitBranch;
263281
}
264282

265283
function getGitModified():Bool
266284
{
267-
var gitProcess:Process = new Process('git', ['status', '--porcelain']);
285+
try
286+
{
287+
var gitProcess:Process = new Process('git', ['status', '--porcelain']);
268288

269-
var gitModifiedFiles:String = gitProcess.stdout.readLine().trim();
270-
var exitCode:Int = gitProcess.exitCode();
271-
gitProcess.close();
289+
var gitModifiedFiles:String = gitProcess.stdout.readLine().trim();
290+
var exitCode:Int = gitProcess.exitCode();
291+
gitProcess.close();
272292

273-
if (exitCode != 0)
293+
if (exitCode != 0)
294+
throw new Exception("Non-Zero Exit Code");
295+
296+
return gitModifiedFiles.length > 0;
297+
}
298+
catch(e:Exception)
274299
{
275300
trace('[WARNING] Unable to get current git repository status.');
276301
return false;
277302
}
278303

279-
return gitModifiedFiles.length > 0;
280304
}
281305
}
282306

src/funkin/objects/FunkinSprite.hx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package funkin.objects;
22

3-
import flixel.FlxCamera;
43
import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;
5-
import flixel.math.FlxPoint;
64
import flixel.util.FlxSignal.FlxTypedSignal;
75
import flxanimate.FlxAnimate;
86
import funkin.structures.ObjectStructure;
@@ -12,12 +10,6 @@ import funkin.structures.ObjectStructure;
1210
*/
1311
class FunkinSprite extends FlxSprite
1412
{
15-
/**
16-
* uh oh! the letters are ANGRY!!
17-
* wont work on animate atlases :(
18-
*/
19-
static var spritesAreAngy:Bool = FlxG.random.bool(0.9125);
20-
2113
/**
2214
* Draws this `FunkinSprite`, but invisible.
2315
* This is basically visible/alpha, but it doesn't lag when you make it visible again.
@@ -161,17 +153,6 @@ class FunkinSprite extends FlxSprite
161153
atlas.colorTransform = colorTransform;
162154
}
163155

164-
// crusher, do you FUCKING dare import these.
165-
override public function getScreenPosition(?result:FlxPoint, ?camera:FlxCamera):FlxPoint
166-
{
167-
var point:FlxPoint = super.getScreenPosition(result, camera);
168-
169-
if (spritesAreAngy)
170-
point.add(FlxG.random.float(-2, 2), FlxG.random.float(-2, 2));
171-
172-
return point;
173-
}
174-
175156
// ANIMATION BINDINGS
176157

177158
/**

0 commit comments

Comments
 (0)