Compare commits
32
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bc968b800 | ||
|
|
d1f92b47ed | ||
|
|
d45675119a | ||
|
|
7ba1a2bd8b | ||
|
|
08bd13d3f3 | ||
|
|
6654d53f91 | ||
|
|
caa062a5aa | ||
|
|
96e0695497 | ||
|
|
6b3f341e4c | ||
|
|
08397633b2 | ||
|
|
35c030d6c2 | ||
|
|
97833fc6d9 | ||
|
|
46f2ef5e09 | ||
|
|
575450068d | ||
|
|
8e659e38a5 | ||
|
|
abe162bbb1 | ||
|
|
a306eb8cb9 | ||
|
|
194e7014e9 | ||
|
|
f3640412bb | ||
|
|
3bd020fe0b | ||
|
|
36526435ac | ||
|
|
bbd08f0065 | ||
|
|
b4f9559d19 | ||
|
|
6a3d97b45e | ||
|
|
5ce383c4e3 | ||
|
|
64fc9d91a1 | ||
|
|
daa2093e26 | ||
|
|
444457db2a | ||
|
|
d6c6f250d3 | ||
|
|
0d0311f8d9 | ||
|
|
c88937dde9 | ||
|
|
6e1a5f9fe5 |
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>nigger</title>
|
||||
<title>test</title>
|
||||
<link rel="shortcut icon" type="image/png" href="./favicon.png">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Generated
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "nigger",
|
||||
"name": "test",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "nigger",
|
||||
"name": "test",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"config": {
|
||||
|
||||
@@ -10,47 +10,20 @@ import game.ui.console.Console;
|
||||
|
||||
class ConVar{
|
||||
static var CVarMap:Map<String, CVar> = [];
|
||||
static var CCmdMap:Map<String, CCmd> = [];
|
||||
/**
|
||||
* Registers a new CVar
|
||||
* @param _name The name of the CVar. This is the way it is called in the console or referred to in code.
|
||||
* @param _type CVar type as defined in the CVarType enum.
|
||||
* @param _value The default value for this CVar. This needs to be in line with its CVarType.
|
||||
* @param _flags CVar flags as defined in the CVarFlags enum.
|
||||
* @param _helpString Help string that gets printed out in console when no value is specified.
|
||||
* @param _callback The function that gets called when the CVar is set. Calls empty Void when left undefined.
|
||||
* @param _callOnCreate Whether the callback function gets called or not after registering.
|
||||
* @param _bMin Specifies if the CVar has a minimum numeric value.
|
||||
* @param _fMin Specifies the minimum numeric value.
|
||||
* @param _fMax Specifies the maximum numeric value.
|
||||
* @param _bMax Specifies if the CVar has a maximum numeric value.
|
||||
*/
|
||||
public static inline function registerCVar(_name:String, _type:CVarType, _value:Dynamic, ?_flags:CVarFlag, ?_helpString:String = "", ?_callback:Void->Void, ?_callOnCreate:Bool=false, _bMin:Bool=false, _fMin:Float=0, _fMax:Float=0, _bMax:Bool = false):CVar
|
||||
public static inline function registerCVar(_name:String, _type:CVarType, _value, _callback:Void->Void,_callOnSet:Bool=false)
|
||||
{
|
||||
if(CVarMap[_name]!=null || CCmdMap[_name]!=null){
|
||||
Console.devMsg("Tried setting already defined convar: " + _name + ", returning null instead");
|
||||
return null;
|
||||
if(CVarMap[_name]!=null){
|
||||
|
||||
return;
|
||||
}
|
||||
if(_bMin && _value < _fMin) _value = _fMin;
|
||||
if(_bMax && _value > _fMax) _value = _fMax;
|
||||
var cvar:CVar = CVarMap[_name] = {
|
||||
CVarMap[_name] = {
|
||||
name : _name,
|
||||
type : _type,
|
||||
value : _value,
|
||||
flags: _flags,
|
||||
helpString: _helpString,
|
||||
bMin : _bMin,
|
||||
fMin : _fMin,
|
||||
fMax : _fMax,
|
||||
bMax : _bMax,
|
||||
callback : _callback == null ? ()->{} : _callback
|
||||
}
|
||||
if(_callback != null && _callOnCreate){
|
||||
_callback();
|
||||
}
|
||||
return cvar;
|
||||
}
|
||||
public static inline function registerCCmd(_name:String, ?_callback:Array<String>->Void):CCmd
|
||||
public static inline function setCVar(_name:String, _value:Dynamic)
|
||||
{
|
||||
if(CVarMap[_name]!=null || CCmdMap[_name]!=null){
|
||||
Console.devMsg("Tried setting already defined command: " + _name + ", returning null instead");
|
||||
@@ -104,7 +77,7 @@ class ConVar{
|
||||
|
||||
}
|
||||
else{
|
||||
Console.devMsg("trying to set null convar '"+_name+"'");
|
||||
Console.consoleIndex.devMsg("trying to set null convar '"+_name+"'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,11 +11,9 @@ class Mode
|
||||
{
|
||||
return Lib.application.window;
|
||||
}
|
||||
|
||||
public static function setVideoMode(width:Int, height:Int, fs:Int = null){
|
||||
getWindow().resize(width,height);
|
||||
if(fs != null){
|
||||
switchFsMode(fs);
|
||||
}
|
||||
}
|
||||
public static var cvMatSetVideoMode:CCmd = ConVar.registerCCmd("mat_setvideomode",(args:Array<String>)->{
|
||||
setVideoMode(Std.parseInt(args[0]), Std.parseInt(args[1]), Std.parseInt(args[2]));
|
||||
|
||||
Reference in New Issue
Block a user