Progress on mouse_modes
This commit is contained in:
@@ -33,7 +33,7 @@ function Color(hex = '#000000')
|
||||
|
||||
this.rgb_to_hex = function(rgb)
|
||||
{
|
||||
return "#"+("0" + parseInt(rgb[0],10).toString(16)).slice(-2)+("0" + parseInt(rgb[1],10).toString(16)).slice(-2)+("0" + parseInt(rgb[2],10).toString(16)).slice(-2);
|
||||
return "#"+parseInt(rgb.r,10).toString(16)+parseInt(rgb.g,10).toString(16)+parseInt(rgb.b,10).toString(16);
|
||||
}
|
||||
|
||||
this.brightness = function()
|
||||
|
||||
13
scripts/units/mode.js
Normal file
13
scripts/units/mode.js
Normal file
@@ -0,0 +1,13 @@
|
||||
function Mode(name,key = "")
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.host = null;
|
||||
this.name = name;
|
||||
this.key = key;
|
||||
|
||||
this.render = function()
|
||||
{
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,33 @@
|
||||
function Setting(key,value)
|
||||
function Setting(name,value)
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.candidates = [];
|
||||
this.key = key;
|
||||
|
||||
if(value == "true"){ this.value = true; }
|
||||
else if(value == "false"){ this.value = false; }
|
||||
else{ this.value = value; }
|
||||
this.host = null;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
|
||||
this.render = function()
|
||||
{
|
||||
return this.key+"="+this.value;
|
||||
return "?";
|
||||
}
|
||||
|
||||
this.update = function(value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
this.to_f = function()
|
||||
{
|
||||
return parseFloat(this.value);
|
||||
}
|
||||
|
||||
this.to_rect = function()
|
||||
{
|
||||
return new Rect(this.value);
|
||||
}
|
||||
|
||||
this.to_pos = function()
|
||||
{
|
||||
return new Position(this.value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user