Improved input
This commit is contained in:
parent
407acccfe2
commit
1273898220
@ -15,7 +15,7 @@ canvas:hover { cursor: crosshair;}
|
||||
#commander { display:none; z-index: 2000; position:fixed; }
|
||||
#commander.visible { display:block; }
|
||||
#commander.hidden { display:none; }
|
||||
#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 { background:none; padding:10px; position:fixed; bottom:0; color:white; font-size:11px; left:0; border:0; width:calc(100vw); cursor:pointer; display:block; height:35px;}
|
||||
#commander input:before { content:"input"; color:e7fff8;}
|
||||
|
||||
#commander_hint { background: #000;position: fixed;bottom: 0px;left:0px;padding: 10px;font-size: 11px;width: calc(100vw - 20px);color: #999; height:15px;}
|
||||
|
@ -22,9 +22,9 @@ function Hint(element)
|
||||
|
||||
this.message = function(module,cmd)
|
||||
{
|
||||
var s = "<span class='rune'>"+module.rune+"</span><span class='module'>"+module.constructor.name+"</span>";
|
||||
|
||||
s += cmd.content.join("") != "" ? "<span class='command'>"+cmd.content.join(" ")+"</span>" : "";
|
||||
var s = this.pad(cmd.content.join(" "));
|
||||
|
||||
s += cmd.content.join(" ").length == 0 ? "<span class='module'>"+module.constructor.name+"</span>" : "";
|
||||
|
||||
// Params
|
||||
|
||||
@ -46,6 +46,16 @@ function Hint(element)
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
this.pad = function(input)
|
||||
{
|
||||
var s = "";
|
||||
for (i = 0; i < input.length+2; i++){
|
||||
s += "_";
|
||||
}
|
||||
|
||||
return "<span style='color:#000'>"+s+"</span>";
|
||||
}
|
||||
|
||||
this.default = function()
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ commander.hint.element = document.getElementById('commander_hint');
|
||||
document.addEventListener('mousedown', function(e){ ronin.cursor.mouse_down(ronin.position_in_canvas(e));}, false);
|
||||
document.addEventListener('mousemove', function(e){ ronin.cursor.mouse_move(ronin.position_in_canvas(e));}, false);
|
||||
document.addEventListener('mouseup', function(e){ ronin.cursor.mouse_up(ronin.position_in_canvas(e));}, false);
|
||||
document.addEventListener('contextmenu', function(ev){ ev.preventDefault(); return false;}, false);
|
||||
// document.addEventListener('contextmenu', function(ev){ ev.preventDefault(); return false;}, false);
|
||||
|
||||
// Keyboard
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user