This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.macro.Expr; | |
class OrMacro { | |
/** | |
* @return The first non-null argument. | |
*/ | |
public static macro function or(options:Array<Expr>):Expr { | |
var ifElseStatements:Expr = options[options.length - 1]; | |
var i:Int = options.length - 1; | |
while(i --> 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if !flash | |
import openfl.errors.Error; | |
import openfl.gl.GL; | |
import haxe.PosInfos; | |
import haxe.Log; | |
/** | |
* Usage: Put "GLCheck.check()" before and after anything that you suspect is causing a | |
* GL error. If the second call displays the error, you've found the problem. If the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2016 Joseph Cloutier | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import openfl.Assets; | |
import openfl.Lib; | |
import openfl.display.Shape; | |
import openfl.display.Sprite; | |
import openfl.display.Tile; | |
import openfl.display.Tilemap; | |
import openfl.display.Tileset; | |
import openfl.events.Event; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SortFunctions { | |
public static function alphabetical(a:String, b:String):Int { | |
if(a < b) { | |
return -1; | |
} else if(a > b) { | |
return 1; | |
} else { | |
return 0; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@:cppInclude('time.h') | |
class CPPRandomSeed { | |
public static function seed() { | |
#if cpp | |
untyped __cpp__('srand(time(NULL))'); | |
#end | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import openfl.display.Stage; | |
import openfl.Lib; | |
class ShowAllScale { | |
private static var nominalWidth:Int; | |
private static var nominalHeight:Int; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SheetSetup = SheetSetup || (function() { | |
'use strict'; | |
var settings = { | |
/** | |
* Set null to disable chat. | |
*/ | |
chatName: "Sheet Setup", | |
/** | |
* Set null to leave player name blank. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//A spellcasting macro for PF2e in FoundryVTT. Casts the remastered Dragon Form | |
//spell, giving you both the battle form and the dragon breath action. | |
//Note: Sea, Sky, and Underworld dragons have burst-shaped dragon breath, which | |
//the spell does not account for. The macro assumes a 20-foot burst, but this is | |
//not supported by the rules, so ask your GM before picking these dragons. | |
//Options | |
//------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//A macro for PF2e in FoundryVTT that helps you create improvised weapons | |
//on the fly. It provides a menu of traits and damage types to pick from, | |
//and will create and equip the item once you're done. | |
//As usual, remember that your GM has final say on what an improvised | |
//weapon does. Work with them to figure out what statistics make sense. | |
//In particular, it won't always make sense to increase the weapon's | |
//damage die, even though the macro allows it. | |
//Options |