Merge branch 'main' into translations-system

This commit is contained in:
Ne_Eo
2024-11-03 22:46:36 +01:00
23 changed files with 199 additions and 134 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ Also, the command `.\cne test` uses the source assets folder instead of the expo
## Codename Engine
Codename Engine is a new Friday Night Funkin' Engine aimed at simplifying modding, along with extensiblity and ease of use.<br>
Make sure to read the wiki and join the Discord server linked there!<br>
#### It includes many new features, as seen [here](FEATURES.md)<br>
### Before making issues or need help with something, check our website [HERE](https://fnf-cne-devs.github.io/) (it contains a wiki of how to mod with EXAMPLES, an api, lists of mods made with Codename Engine and more)!!!
#### The Engine includes many new features, as seen [here](FEATURES.md)<br>
#### Wanna see the new features added in the most recent update? Click [here](PATCHNOTES.md)<br>
## How to download
-7
View File
@@ -1,7 +0,0 @@
<!DOCTYPE codename-mod-credits>
<!-- TEMPLATE FOR CUSTOM CREDITS!!! -->
<menu name="Mod Credits" desc="Modify mod credits here">
<!-- \/ You can also set the portrait shader as false as you can see below in the github one -->
<credit name="Credit Example" desc="Click me to know more about me!" icon="credit icon example" size="130" url="https://youtu.be/fugtxz1znVw"/>
<github user="NexIsDumb" customName="Nex is Dumb" desc="The bitch who made these credits menus" size="100" portrait="false" color="#808080"/>
</menu>
-15
View File
@@ -1,15 +0,0 @@
<!DOCTYPE codename-mod-options>
<!-- TEMPLATE FOR CUSTOM OPTIONS!!! -->
<menu name="Mod Options" desc="Modify mod options here">
<checkbox id="checkboxExample" name="Checkbox example" />
<number id="numberExample" name="Number example" min="0" max="10" change="1"/>
<choice id="choiceExample" name="Choice Example">
<value name="Disabled" value="disabled"/>
<value name="This only" value="thisOnly"/>
<value name="All" value="all"/>
</choice>
<menu name="Submenu Example" desc="Submenu test">
<checkbox id="levelOfIdk2" name="Level of idk" />
</menu>
</menu>
+7 -9
View File
@@ -3,19 +3,17 @@
// Used for editors
int steps = 16;
int stepsInside = 2;
float strength = 0.0075;
const int steps = 16;
const int stepsInside = 2;
const float strength = 0.0075;
vec4 getColor(vec2 pos) {
vec2 ps = (pos);
ps = clamp(ps, vec2(0.0), 1.0 - (1.0 / openfl_TextureSize.xy));
return flixel_texture2D(bitmap, (ps));
pos = clamp(pos, vec2(0.0), vec2(1.0));//1.0 - (1.0 / openfl_TextureSize.xy));
return flixel_texture2D(bitmap, pos);
}
void main() {
// vec2 camPos = getCamPos(openfl_TextureCoordv);
vec2 camPos = openfl_TextureCoordv;
if (camPos.x < 0.0 || camPos.x > 1.0 || camPos.y < 0.0 || camPos.y > 1.0)
return;
vec4 color = getColor(camPos);
float fsteps = float(steps);
+15 -44
View File
@@ -2,58 +2,29 @@
// Used for editors (faster)
//#define iResolution _camSize
#define getTexture textureCam
#define iResolution openfl_TextureSize
//#define getTexture flixel_texture2D
float uBlur = 0.015;
float uBrightness = 0.6;
const float uBlur = 0.015;
const float uBrightness = 0.6;
vec4 getColor(vec2 pos) {
vec2 ps = (pos);
if (ps.x < 0.0) ps.x = 0.0;
//else if (ps.x > 1.0 - (1.0 / iResolution.x)) ps.x = 1.0 - (1.0 / iResolution.x);
else if (ps.x > 1.0) return vec4(0.0);
if (ps.y < 0.0) ps.y = 0.0;
//else if (ps.y > 1.0 - (1.0 / iResolution.y)) return ps.y = 1.0 - (1.0 / iResolution.y);
else if (ps.y > 1.0) return vec4(0.0);
return flixel_texture2D(bitmap, (ps));
pos = clamp(pos, vec2(0.0), vec2(1.0));//1.0 - (1.0 / openfl_TextureSize.xy));
return flixel_texture2D(bitmap, pos);
}
vec2 fixvec2(float x, float y) { // makes an uv the same across sizes
vec2 val = vec2(x, y);
val.xy *= vec2(1280.0, 720.0);
val.xy /= iResolution.xy;
return val;
}
vec2 fixvec2(vec2 uv) { // makes an uv the same across sizes
vec2 val = uv;
val.xy *= vec2(1280.0, 720.0);
val.xy /= iResolution.xy;
return val;
}
uniform sampler2D noiseTexture;
uniform vec2 noiseTextureSize;
vec2 random(vec2 p) {
p = vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3)));
return fract(sin(p)*4375.5);
p *= openfl_TextureSize;
return texture2D(noiseTexture, p / noiseTextureSize).rg - vec2(0.5);
}
void main() {
vec2 camPos = (openfl_TextureCoordv);
//vec2 camPos = openfl_TextureCoordv;
if (camPos.x < 0.0 || camPos.x > 1.0 || camPos.y < 0.0 || camPos.y > 1.0)
return;
vec2 camPos = openfl_TextureCoordv;
vec2 blur = vec2(uBlur) * vec2(1.0, openfl_TextureSize.x / openfl_TextureSize.y);
//vec4 color = getColor(camPos);
vec2 blur = vec2(uBlur) * vec2(1.0, iResolution.x / iResolution.y);
vec4 a = getColor(camPos+(random(camPos)*blur - blur / 2.0)) * uBrightness;
a += getColor(camPos+(random(camPos+0.1)*blur - blur / 2.0)) * uBrightness;
a += getColor(camPos+(random(camPos+0.2)*blur - blur / 2.0)) * uBrightness;
//a += getColor(camPos+(random(camPos+0.3)*blur - blur / 2.0)) * uBrightness;
gl_FragColor = a / 3.0;
vec4 a = getColor(camPos+random(camPos)*blur);
a += getColor(camPos+random(camPos+0.1)*blur);
//a += getColor(camPos+random(camPos+0.2)*blur);
//a += getColor(camPos+random(camPos+0.3)*blur);
gl_FragColor = (a / 2.0) * uBrightness;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 KiB

+6 -2
View File
@@ -219,7 +219,7 @@ class StringTools {
If `start` is the empty String `""`, the result is true.
**/
public static #if (java || python || (js && js_es >= 6)) inline #end function startsWith(s:String, start:String):Bool {
public static #if (java || python || (js && js_es >= 6) || cpp) inline #end function startsWith(s:String, start:String):Bool {
#if java
return (cast s : java.NativeString).startsWith(start);
#elseif hl
@@ -230,6 +230,8 @@ class StringTools {
return (cast s).startsWith(start);
#elseif lua
return untyped __lua__("{0}:sub(1, #{1}) == {1}", s, start);
#elseif cpp
return untyped s.__StartsWith(start);
#else
return (s.length >= start.length && s.indexOf(start, 0) == 0);
#end
@@ -242,7 +244,7 @@ class StringTools {
If `end` is the empty String `""`, the result is true.
**/
public static #if (java || python || (js && js_es >= 6)) inline #end function endsWith(s:String, end:String):Bool {
public static #if (java || python || (js && js_es >= 6) || cpp) inline #end function endsWith(s:String, end:String):Bool {
#if java
return (cast s : java.NativeString).endsWith(end);
#elseif hl
@@ -255,6 +257,8 @@ class StringTools {
return (cast s).endsWith(end);
#elseif lua
return end == "" || untyped __lua__("{0}:sub(-#{1}) == {1}", s, end);
#elseif cpp
return untyped s.__EndsWith(end);
#else
var elen = end.length;
var slen = s.length;
+50 -15
View File
@@ -11,8 +11,7 @@ class Logs {
public static var nativeTrace = Log.trace;
public static function init() {
Log.trace = function(v : Dynamic, ?infos : Null<haxe.PosInfos>) {
Log.trace = function(v:Dynamic, ?infos:Null<haxe.PosInfos>) {
var data = [
logText('${infos.fileName}:${infos.lineNumber}: ', CYAN),
logText(Std.string(v))
@@ -28,22 +27,48 @@ class Logs {
__showInConsole(prepareColoredTrace(data, TRACE));
};
LogFrontEnd.onLogs = function(Data, Style, FireOnce) {
LogFrontEnd.onLogs = function(data, style, fireOnce) {
var prefix = "[FLIXEL]";
var color:ConsoleColor = LIGHTGRAY;
var level:Level = INFO;
if (Style == LogStyle.CONSOLE) {prefix = "> "; color = WHITE; level = INFO; } else
if (Style == LogStyle.ERROR) {prefix = "[FLIXEL]"; color = RED; level = ERROR; } else
if (Style == LogStyle.NORMAL) {prefix = "[FLIXEL]"; color = WHITE; level = INFO; } else
if (Style == LogStyle.NOTICE) {prefix = "[FLIXEL]"; color = GREEN; level = VERBOSE;} else
if (Style == LogStyle.WARNING) {prefix = "[FLIXEL]"; color = YELLOW; level = WARNING;}
if (style == LogStyle.CONSOLE) // cant place a switch here as these arent inline values - Nex
{
prefix = "> ";
color = WHITE;
level = INFO;
}
else if (style == LogStyle.ERROR)
{
prefix = "[FLIXEL]";
color = RED;
level = ERROR;
}
else if (style == LogStyle.NORMAL)
{
prefix = "[FLIXEL]";
color = WHITE;
level = INFO;
}
else if (style == LogStyle.NOTICE)
{
prefix = "[FLIXEL]";
color = GREEN;
level = VERBOSE;
}
else if (style == LogStyle.WARNING)
{
prefix = "[FLIXEL]";
color = YELLOW;
level = WARNING;
}
var d:Dynamic = Data;
var d:Dynamic = data;
if (!(d is Array))
d = [d];
var a:Array<Dynamic> = d;
var strs = [for(e in a) Std.string(e)];
for(e in strs) {
for(e in strs)
{
Logs.trace('$prefix $e', level, color);
}
};
@@ -55,7 +80,8 @@ class Logs {
logText('[ '),
logText('${Std.string(time.getHours()).addZeros(2)}:${Std.string(time.getMinutes()).addZeros(2)}:${Std.string(time.getSeconds()).addZeros(2)}', DARKMAGENTA),
logText(' |'),
switch(level) {
switch (level)
{
case WARNING: logText(' WARNING ', DARKYELLOW);
case ERROR: logText(' ERROR ', DARKRED);
case TRACE: logText(' TRACE ', GRAY);
@@ -79,7 +105,7 @@ class Logs {
}
public static function __showInConsole(text:Array<LogText>) {
#if sys
#if (sys && !mobile)
while(__showing) {
Sys.sleep(0.05);
}
@@ -91,15 +117,23 @@ class Logs {
NativeAPI.setConsoleColors();
Sys.print("\r\n");
__showing = false;
#elseif mobile
while(__showing) {
Sys.sleep(0.05);
}
__showing = true;
@:privateAccess
Sys.print([for(t in text) t.text].join(""));
__showing = false;
#else
@:privateAccess
nativeTrace([for(t in text) t.text].join(""));
#end
}
public static function traceColored(text:Array<LogText>, level:Level = INFO) {
public static function traceColored(text:Array<LogText>, level:Level = INFO)
__showInConsole(prepareColoredTrace(text, level));
}
public static function trace(text:String, level:Level = INFO, color:ConsoleColor = LIGHTGRAY, ?prefix:String) {
var text = [logText(text, color)];
if(prefix != null) text.insert(0, getPrefix(prefix));
@@ -144,7 +178,8 @@ enum abstract Level(Int) {
var SUCCESS = 5;
var FAILURE = 6;
}
typedef LogText = {
var text:String;
var color:ConsoleColor;
}
}
+4 -1
View File
@@ -751,7 +751,10 @@ class CoolUtil
*/
@:noUsing public static inline function openURL(url:String) {
#if linux
Sys.command('/usr/bin/xdg-open', [url]);
// generally `xdg-open` should work in every distro
var cmd = Sys.command("xdg-open", [url]);
// run old command JUST IN CASE it fails, which it shouldn't
if (cmd != 0) cmd = Sys.command("/usr/bin/xdg-open", [url]);
#else
FlxG.openURL(url);
#end
+4 -2
View File
@@ -140,14 +140,16 @@ class MemoryUtil {
reg.match(process.stdout.readAll().toString());
if (process.exitCode() == 0) return reg.matched(1);
#elseif linux
var process = new HiddenProcess("sudo", ["dmidecode", "--type", "17"]);
/*var process = new HiddenProcess("sudo", ["dmidecode", "--type", "17"]);
if (process.exitCode() != 0) return "Unknown";
var lines = process.stdout.readAll().toString().split("\n");
for (line in lines) {
if (line.startsWith("Type:")) {
return line.substring("Type:".length).trim();
}
}
}*/
// TODO: sort of unsafe? also requires users to use `sudo`
// when launching the engine through the CLI, REIMPLEMENT LATER.
#end
return "Unknown";
}
@@ -4,6 +4,7 @@ import funkin.game.Character;
import funkin.options.OptionsScreen;
import funkin.options.type.IconOption;
import funkin.options.type.NewOption;
import funkin.options.type.TextOption;
import funkin.options.type.OptionType;
class CharacterSelection extends EditorTreeMenu
@@ -16,22 +17,46 @@ class CharacterSelection extends EditorTreeMenu
bgType = "charter";
super.create();
var modsList:Array<String> = Character.getList(true);
var isMods:Bool = true;
var modsList:Array<String> = Character.getList(true, true);
var list:Array<OptionType> = [
for (char in (modsList.length == 0 ? Character.getList(false) : modsList))
new IconOption(char, translate("acceptCharacter"), Character.getIconFromCharName(char),
function() {
FlxG.switchState(new CharacterEditor(char));
})
];
if(modsList.length == 0) {
modsList = Character.getList(false, true);
isMods = false;
}
var newChar = translate("newCharacter");
list.insert(0, new NewOption(newChar, newChar, function() {
openSubState(new UIWarningSubstate(translate("warnings.notImplemented-title"), translate("warnings.notImplemented-body"), [
{label: TU.translate("editor.ok"), color: 0xFFFF0000, onClick: function(t) {}}
]));
}));
function generateList(modsList:Array<String>, isMods:Bool, folderPath:String = ""):Array<OptionType> {
var list:Array<OptionType> = [];
for(char in modsList) {
if(char.endsWith("/")) {
var folderName = CoolUtil.getFilename(char.substr(0, char.length-1));
list.push(new TextOption(folderName + " >", translate("acceptFolder"), function() {
var newModsList = Character.getList(isMods, true, char);
var newList:Array<OptionType> = generateList(newModsList, isMods, folderPath + folderName + "/");
optionsTree.add(new OptionsScreen(folderPath + folderName, translate("desc-folder", [folderPath + folderName + "/"]), newList));
}));
} else {
list.push(new IconOption(char, translate("acceptCharacter"), Character.getIconFromCharName(folderPath + char, char),
function() {
FlxG.switchState(new CharacterEditor(folderPath + char));
})
);
}
}
var newChar = translate("newCharacter");
list.insert(0, new NewOption(newChar, newChar, function() {
openSubState(new UIWarningSubstate(translate("warnings.notImplemented-title"), translate("warnings.notImplemented-body"), [
{label: TU.translate("editor.ok"), color: 0xFFFF0000, onClick: function(t) {}}
]));
}));
return list;
}
var list = generateList(modsList, isMods);
main = new OptionsScreen(TU.translate("characterEditor.name"), translate("desc"), list);
@@ -174,7 +174,11 @@ class CharterEventScreen extends UISubstateWindow {
colorWheel;
case TDropDown(options):
addLabel();
var dropdown = new UIDropDown(eventName.x, y, 320, 32, options, Std.int(Math.abs(options.indexOf(cast value))));
var optionIndex = options.indexOf(cast value);
if(optionIndex < 0) {
optionIndex = 0;
}
var dropdown = new UIDropDown(eventName.x, y, 320, 32, options, optionIndex);
paramsPanel.add(dropdown); paramsFields.push(dropdown);
dropdown;
case TCharacter:
+14 -1
View File
@@ -1,5 +1,8 @@
package funkin.editors.ui;
import openfl.display.ShaderParameter;
import openfl.display.ShaderInput;
import openfl.filters.ShaderFilter;
import flixel.tweens.FlxTween;
import funkin.backend.shaders.CustomShader;
import openfl.filters.ShaderFilter;
@@ -7,7 +10,17 @@ import openfl.filters.ShaderFilter;
// TODO: make UIWarningSubstate extend this
class UISubstateWindow extends MusicBeatSubstate {
var camShaders:Array<FlxCamera> = [];
var blurShader:CustomShader = new CustomShader(Options.intensiveBlur ? "engine/editorBlur" : "engine/editorBlurFast");
var blurShader:CustomShader = {
var _ = new CustomShader(Options.intensiveBlur ? "engine/editorBlur" : "engine/editorBlurFast");
if(!Options.intensiveBlur) {
var noiseTexture:ShaderInput<openfl.display.BitmapData> = _.data.noiseTexture;
noiseTexture.input = Assets.getBitmapData("assets/shaders/noise256.png");
noiseTexture.wrap = REPEAT;
var noiseTextureSize:ShaderParameter<Float> = _.data.noiseTextureSize;
noiseTextureSize.value = [noiseTexture.input.width, noiseTexture.input.height];
}
_;
};
var titleSpr:UIText;
var messageSpr:UIText;
+14 -1
View File
@@ -1,5 +1,8 @@
package funkin.editors.ui;
import openfl.display.ShaderParameter;
import openfl.display.ShaderInput;
import openfl.filters.ShaderFilter;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import funkin.backend.shaders.CustomShader;
@@ -7,7 +10,17 @@ import openfl.filters.ShaderFilter;
class UIWarningSubstate extends MusicBeatSubstate {
var camShaders:Array<FlxCamera> = [];
var blurShader:CustomShader = new CustomShader(Options.intensiveBlur ? "engine/editorBlur" : "engine/editorBlurFast");
var blurShader:CustomShader = {
var _ = new CustomShader(Options.intensiveBlur ? "engine/editorBlur" : "engine/editorBlurFast");
if(!Options.intensiveBlur) {
var noiseTexture:ShaderInput<openfl.display.BitmapData> = _.data.noiseTexture;
noiseTexture.input = Assets.getBitmapData("assets/shaders/noise256.png");
noiseTexture.wrap = REPEAT;
var noiseTextureSize:ShaderParameter<Float> = _.data.noiseTextureSize;
noiseTextureSize.value = [noiseTexture.input.width, noiseTexture.input.height];
}
_;
};
var title:String;
var message:String;
+16 -7
View File
@@ -519,9 +519,10 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
return xml;
}
public static function getIconFromCharName(?character:String) {
public static function getIconFromCharName(?character:String, ?defaultIcon:String = null) {
if(character == null) return "face";
var icon:String = character;
if(defaultIcon == null) defaultIcon = character;
var icon:String = defaultIcon;
var xml:Access = getXMLFromCharName(character);
if (xml != null && xml.x.exists("icon")) icon = xml.x.get("icon");
@@ -529,9 +530,17 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
return icon;
}
public static function getList(?mods:Bool = false):Array<String>
return [
for (path in Paths.getFolderContent('data/characters/', true, mods ? MODS : BOTH))
if (Path.extension(path) == "xml") CoolUtil.getFilename(path)
];
public static function getList(?mods:Bool = false, includeFolders:Bool = false, folder:String = 'data/characters/'):Array<String> {
var list:Array<String> = [];
if(includeFolders) {
for (path in Paths.getFolderDirectories(folder, true, mods ? MODS : BOTH)) {
if(!path.endsWith("/")) path += "/";
list.push(path);
}
}
for (path in Paths.getFolderContent(folder, true, mods ? MODS : BOTH))
if (Path.extension(path) == "xml")
list.push(CoolUtil.getFilename(path));
return list;
}
}
+3 -5
View File
@@ -90,11 +90,9 @@ class HealthIcon extends FlxSprite
if (animation.curAnim != null) {
var i:Int = -1;
var oldKey:Int = -1;
for(k=>icon in healthSteps) {
if (k > oldKey && k < health * 100) {
oldKey = k;
i = icon;
}
for (k=>icon in healthSteps) if (k > oldKey && k <= health * 100) {
oldKey = k;
i = icon;
}
if (i >= 0 && curAnimState != i) {
var event = EventManager.get(funkin.backend.scripting.events.HealthIconChangeEvent).recycle(i, this);
@@ -91,7 +91,7 @@ class DialogueCutscene extends Cutscene {
musicVolume: node.has.musicVolume ? (volume = Std.parseFloat(node.att.speed).getDefaultFloat(0.8)) : null,
changeMusic: node.has.changeMusic ? FlxG.sound.load(Paths.music(node.att.changeMusic), volume, true) : null,
playSound: node.has.playSound ? FlxG.sound.load(Paths.sound(node.att.playSound)) : null,
nextSound: node.has.nextSound ? FlxG.sound.load(Paths.music(node.att.nextSound)) : null,
nextSound: node.has.nextSound ? FlxG.sound.load(Paths.sound(node.att.nextSound)) : null,
textSound: null
};
@@ -217,4 +217,4 @@ typedef DialogueLine = {
var nextSound:FlxSound;
var textSound:FlxSound;
var changeDefAnim:String;
}
}
+1 -1
View File
@@ -163,7 +163,7 @@ class MainMenuState extends MusicBeatState
var event = event("onSelectItem", EventManager.get(NameEvent).recycle(daChoice));
if (event.cancelled) return;
switch (daChoice)
switch (event.name)
{
case 'story mode': FlxG.switchState(new StoryMenuState());
case 'freeplay': FlxG.switchState(new FreeplayState());
+4 -2
View File
@@ -14,6 +14,7 @@ import funkin.editors.charter.Charter;
import funkin.menus.StoryMenuState;
import funkin.options.OptionsMenu;
import funkin.options.keybinds.KeybindsOptions;
import funkin.options.TreeMenu;
class PauseSubState extends MusicBeatSubstate
{
@@ -167,9 +168,10 @@ class PauseSubState extends MusicBeatSubstate
persistentDraw = false;
openSubState(new KeybindsOptions());
case "Change Options":
TreeMenu.lastState = PlayState;
FlxG.switchState(new OptionsMenu());
case "Exit to charter":
FlxG.switchState(new funkin.editors.charter.Charter(PlayState.SONG.meta.name, PlayState.difficulty, false));
FlxG.switchState(new Charter(PlayState.SONG.meta.name, PlayState.difficulty, false));
case "Exit to menu":
if (PlayState.chartingMode && Charter.undos.unsaved)
game.saveWarn(false);
@@ -217,4 +219,4 @@ class PauseSubState extends MusicBeatSubstate
item.alpha = (item.targetY == 0) ? 1 : 0.6;
}
}
}
}
+9 -2
View File
@@ -114,6 +114,12 @@ class StoryMenuState extends MusicBeatState {
}
}
// default difficulty should be the middle difficulty in the array
// to be consistent with base game and whatnot, you know the drill
curDifficulty = Math.floor(weeks[0].difficulties.length * 0.5);
// debug stuff lol
Logs.trace('Middle Difficulty for Week 1 is ${weeks[0].difficulties[curDifficulty]} (ID: $curDifficulty)');
changeWeek(0, true);
DiscordUtil.call("onMenuLoaded", ["Story Menu"]);
@@ -163,6 +169,7 @@ class StoryMenuState extends MusicBeatState {
if (!force) CoolUtil.playMenuSFX();
for(k=>e in weekSprites.members) {
e.targetY = k - curWeek;
e.alpha = k == curWeek ? 1.0 : 0.6;
}
var str = new StringBuf();
str.add(TU.translate("story.tracks") + "\n\n");
@@ -354,13 +361,13 @@ class StoryMenuState extends MusicBeatState {
if (char.animation.exists("confirm"))
char.animation.play("confirm");
PlayState.loadWeek(weeks[curWeek], weeks[curWeek].difficulties[curDifficulty]);
PlayState.loadWeek(event.week, event.difficulty);
new FlxTimer().start(1, function(tmr:FlxTimer)
{
FlxG.switchState(new PlayState());
});
weekSprites.members[curWeek].startFlashing();
weekSprites.members[event.weekID].startFlashing();
}
}
+4 -1
View File
@@ -367,7 +367,10 @@ class System
#elseif mac
Sys.command("/usr/bin/open", [path]);
#elseif linux
Sys.command("/usr/bin/xdg-open", [path]);
// generally `xdg-open` should work in every distro
var cmd = Sys.command("xdg-open", [path, "&"]);
// run old command JUST IN CASE it fails, which it shouldn't
if (cmd != 0) cmd = Sys.command("/usr/bin/xdg-open", [path, "&"]);
#elseif (js && html5)
Browser.window.open(path, "_blank");
#elseif flash