diff --git a/index.html b/index.html index a39c62a..65b0d80 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@
Loading..
- +
diff --git a/links/main.css b/links/main.css index d63adb8..f303aad 100644 --- a/links/main.css +++ b/links/main.css @@ -13,16 +13,18 @@ canvas:hover { cursor: crosshair;} #commander { display:none; z-index: 2000; position:fixed; } #commander.visible { display:block; } #commander.hidden { display:none; } -#commander input { background:black; padding:5px 15px; position:fixed; bottom:0; color:white; font-size:12px; left:0; border:0; width:calc(100vw); cursor:pointer; display:block;} +#commander input { background:none; padding:10px; position:fixed; bottom:0; color:white; font-size:11px; left:0; border:0; width:calc(100vw); cursor:pointer; display:block; color:RGBA(0,0,0,0); height:35px;} #commander input:before { content:"input"; color:red;} -#commander_hint { background: black;position: fixed;bottom: 27px;padding: 5px 15px 0 15px;line-height: 17px;font-size: 10px;width: 100vw;color: #999;} -#commander_hint .module { color:#ffffff; display:inline-block; margin-right:10px;} +#commander_hint { background: #333;position: fixed;bottom: 0px;left:0px;padding: 10px;font-size: 11px;width: calc(100vw - 20px);color: #999; height:15px;} +#commander_hint .rune { color:#72dec2; display:inline-block; margin-right:10px;} +#commander_hint .module { color:#ccc; display:inline-block; margin-right:10px;} +#commander_hint .command { color:#fff; display:inline-block; margin-right:10px;} #commander_hint .param { font-style: italic;} -#commander_hint .param:after { content:", "; } +#commander_hint .param:after { content:" "; } #commander_hint .param:last-child:after { content:"";} #commander_hint .value { color:#ff0000;} -#commander_hint .value:after { content:", "; color:#999; } +#commander_hint .value:after { content:" "; color:#999; } #commander_hint .value:last-child:after { content:"";} -#commander_hint .variable_key { color:#ccc; font-weight:bold;} -#commander_hint .variable_value { color:#ccc;} \ No newline at end of file +#commander_hint .variable_key { color:#aaa; font-weight:bold;} +#commander_hint .variable_value { color:#aaa;} \ No newline at end of file diff --git a/scripts/core/commander.hint.js b/scripts/core/commander.hint.js index 8a19c81..1d121e0 100644 --- a/scripts/core/commander.hint.js +++ b/scripts/core/commander.hint.js @@ -10,6 +10,10 @@ function Hint(element) this.element.innerHTML = this.message(module,cmd); this.element.style.display = "block"; } + else if(commander && commander.element_input.value != ""){ + this.element.innerHTML = commander.element_input.value; + this.element.style.display = "block"; + } else{ this.element.innerHTML = this.default(); this.element.style.display = "block"; @@ -18,31 +22,26 @@ function Hint(element) this.message = function(module,cmd) { - var s = ""+module.constructor.name+""; + var s = ""+module.rune+""+module.constructor.name+""; + s += cmd.content.join("") != "" ? ""+cmd.content.join(" ")+"" : ""; + + // Params + var e = 0; while(e < 10){ if(!module.parameters[e]){ break; } var param_name = module.parameters[e].name; - s += cmd[param_name.toLowerCase()]() ? ""+cmd[param_name.toLowerCase()]().render()+"" : ""+param_name+""; + s += cmd[param_name.toLowerCase()]() ? "" : ""+param_name+""; e += 1; } - - s += " "; - - s += this.print_variables(module); - - return s; - } - - this.print_variables = function(module) - { - if(module.variables.length < 1){ return "";} - - var s = ""; - - for (var key in module.variables){ - s += ""+key+"="+module.variables[key]+" "; + + // Variables + if(module.variables){ + for (var key in module.variables){ + if(cmd.variable(key)){continue;} + s += ""+key+"="+module.variables[key]+" "; + } } return s; diff --git a/scripts/core/commander.js b/scripts/core/commander.js index a78dff8..e49dd90 100644 --- a/scripts/core/commander.js +++ b/scripts/core/commander.js @@ -54,6 +54,7 @@ function Commander(element,element_input) { this.element.setAttribute('class','visible'); this.element_input.focus(); + this.element_input.value = ""; } this.always = function() { diff --git a/scripts/modules/Find Results b/scripts/modules/Find Results deleted file mode 100644 index 3290219..0000000 --- a/scripts/modules/Find Results +++ /dev/null @@ -1,120 +0,0 @@ -Searching 62 files for "canvas.con" - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/brush.pointer.js: - 26 this.distance += position.distance_to(this.position_prev); - 27 - 28: ronin.canvas.context().beginPath(); - 29 - 30: ronin.canvas.context().globalCompositeOperation="source-over"; - 31: ronin.canvas.context().moveTo(this.position_prev.x,this.position_prev.y); - 32: ronin.canvas.context().lineTo(position.x,position.y); - 33: ronin.canvas.context().lineCap="round"; - 34: ronin.canvas.context().lineWidth = this.thickness(); - 35: ronin.canvas.context().strokeStyle = ronin.brush.color.rgba(); - 36: ronin.canvas.context().stroke(); - 37: ronin.canvas.context().closePath(); - 38 - 39 this.position_prev = position; - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/eraser.js: - 19 this.distance += position.distance_to(this.position_prev); - 20 - 21: ronin.canvas.context().beginPath(); - 22: ronin.canvas.context().globalCompositeOperation="destination-out"; - 23: ronin.canvas.context().moveTo(this.position_prev.x,this.position_prev.y); - 24: ronin.canvas.context().lineTo(position.x,position.y); - 25: ronin.canvas.context().lineCap="round"; - 26: ronin.canvas.context().lineWidth = 10; - 27: ronin.canvas.context().strokeStyle = new Color("#ff0000").rgba(); - 28: ronin.canvas.context().stroke(); - 29: ronin.canvas.context().closePath(); - 30 - 31 this.position_prev = position; - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/eye.js: - 20 this.color_picker = function(position) - 21 { - 22: var imgData = ronin.canvas.context().getImageData(position.x, position.y, 1, 1).data; - 23 var c = new Color(); - 24 commander.show(); - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/file.load.js: - 30 height = isNaN(height) && width > 0 ? (width*base_image.naturalHeight)/base_image.naturalWidth : height; - 31 - 32: ronin.canvas.context().drawImage(base_image, position.x, position.y, width, height); - 33 } - 34 } - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/filter.balance.js: - 43 - 44 ronin.canvas.clear(); - 45: ronin.canvas.context().putImageData(pixels, 0, 0, 0, 0, pixels.width, pixels.height); - 46 } - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/filter.chromatic.js: - 35 } - 36 ronin.canvas.clear(); - 37: ronin.canvas.context().putImageData(output, 0, 0, 0, 0, pixels.width, pixels.height); - 38 } - 39 - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/filter.eval.js: - 23 - 24 ronin.canvas.clear(); - 25: ronin.canvas.context().putImageData(pixels, 0, 0, 0, 0, pixels.width, pixels.height); - 26 console.log("done."); - 27 } - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/filter.js: - 69 this.pixels = function() - 70 { - 71: return ronin.canvas.context().getImageData(0,0,ronin.canvas.element.width,ronin.canvas.element.height); - 72 } - 73 } - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/filter.offset.js: - 16 } - 17 ronin.canvas.clear(); - 18: ronin.canvas.context().putImageData(pixels, 0, 0, 0, 0, pixels.width, pixels.height); - 19 } - 20 - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/filter.saturation.js: - 12 } - 13 ronin.canvas.clear(); - 14: ronin.canvas.context().putImageData(pixels, 0, 0, 0, 0, pixels.width, pixels.height); - 15 } - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/stroke.js: - 49 this.draw = function(pos1,pos2) - 50 { - 51: ronin.canvas.context().beginPath(); - 52: ronin.canvas.context().moveTo(pos1.x,pos1.y); - 53: ronin.canvas.context().lineTo(pos2.x,pos2.y); - 54: ronin.canvas.context().lineCap="round"; - 55: ronin.canvas.context().lineWidth = 1; - 56: ronin.canvas.context().strokeStyle = new Color("#ff0000").rgba(); - 57: ronin.canvas.context().stroke(); - 58: ronin.canvas.context().closePath(); - 59 } - 60 - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/surface.layer.js: - 23 - 24 if(!position){ position = new Position("0,0");} - 25: ronin.canvas.context().drawImage(base_image, -position.x, -position.y, pixels_rect.width, pixels_rect.height); - 26: ronin.canvas.context().scale(2,2); - 27 } - 28 } - -/Users/VillaMoirai/Github/Hundred Rabbits/Ronin/scripts/modules/vector.js: - 19 { - 20 ronin.overlay.clear(); - 21: ronin.canvas.context().lineCap="round"; - 22: ronin.canvas.context().lineWidth = ronin.brush.size; - 23: ronin.canvas.context().strokeStyle = ronin.brush.color.rgba(); - 24: ronin.canvas.context().stroke(new Path2D(cmd.content.join(" "))); - 25 } - 26 - -40 matches across 13 files diff --git a/scripts/modules/overlay.js b/scripts/modules/overlay.js index e13555e..710e450 100644 --- a/scripts/modules/overlay.js +++ b/scripts/modules/overlay.js @@ -119,7 +119,7 @@ function Overlay(rune) this.clear = function() { - this.context().clearRect(0, 0, ronin.canvas.element.width, ronin.canvas.element.height); + this.context().clearRect(0, 0, ronin.surface.size.width, ronin.surface.size.height); } // Cursor diff --git a/scripts/modules/surface.js b/scripts/modules/surface.js index 22d2776..9ad122c 100644 --- a/scripts/modules/surface.js +++ b/scripts/modules/surface.js @@ -3,7 +3,8 @@ function Surface(rune) Module.call(this,rune); this.element = null; - this.parameters = [Rect,Color,Any]; + this.parameters = [Rect,Color]; + this.variables = {"layer" : "main"}; this.layers = {}; this.active_layer = null; @@ -39,8 +40,6 @@ function Surface(rune) this.active_layer.resize(this.size); } } - - } this.passive = function(cmd)