Implemented rect_offset, rect and pos.
This commit is contained in:
parent
527da673c8
commit
db6c2f1656
@ -5,6 +5,7 @@ yu { display:block; }
|
|||||||
|
|
||||||
#ronin { background:#eee; height: 100vh; width:100vw; }
|
#ronin { background:#eee; height: 100vh; width:100vw; }
|
||||||
#grid { z-index:1;position: fixed; }
|
#grid { z-index:1;position: fixed; }
|
||||||
|
#guide { z-index:700;position: fixed; }
|
||||||
#render { z-index:800; position: fixed; }
|
#render { z-index:800; position: fixed; }
|
||||||
#commander { position: fixed; bottom:15px; left:5px; width:100vw; height:20px; line-height: 20px; -webkit-user-select: none;-webkit-app-region: drag; z-index:900;}
|
#commander { position: fixed; bottom:15px; left:5px; width:100vw; height:20px; line-height: 20px; -webkit-user-select: none;-webkit-app-region: drag; z-index:900;}
|
||||||
#commander input { background: transparent;width: calc(100vw - 30px);display: block;line-height: 20px;font-size: 11px;color: black; margin-left:20px; }
|
#commander input { background: transparent;width: calc(100vw - 30px);display: block;line-height: 20px;font-size: 11px;color: black; margin-left:20px; }
|
||||||
|
@ -15,6 +15,7 @@ function Commander()
|
|||||||
this.validate = function(q = ronin.commander.query())
|
this.validate = function(q = ronin.commander.query())
|
||||||
{
|
{
|
||||||
if(!ronin.modules[q.module]){ console.log("Unknown module",q.module); return; }
|
if(!ronin.modules[q.module]){ console.log("Unknown module",q.module); return; }
|
||||||
|
if(q.raw.indexOf("$") > -1){ console.log("Variables present"); return; }
|
||||||
|
|
||||||
// Update settings
|
// Update settings
|
||||||
for(setting_id in q.settings){
|
for(setting_id in q.settings){
|
||||||
|
@ -9,6 +9,21 @@ function Guide()
|
|||||||
|
|
||||||
this.update = function()
|
this.update = function()
|
||||||
{
|
{
|
||||||
console.log(ronin.commander.query());
|
var u = ronin.guide.find_unit();
|
||||||
|
|
||||||
|
console.log(u);
|
||||||
|
// if(u.x){ this.draw_pos(u); }
|
||||||
|
// if(u.width){ this.draw_rect(u); }
|
||||||
|
}
|
||||||
|
|
||||||
|
this.find_unit = function(q = ronin.commander.query())
|
||||||
|
{
|
||||||
|
for(method_id in q.methods){
|
||||||
|
var params = q.methods[method_id];
|
||||||
|
if(params.from){ return params.from[0]; }
|
||||||
|
if(params[0]){ return params[0]; }
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -78,6 +78,9 @@ function Query(query_str)
|
|||||||
|
|
||||||
function parse_unit(unit_str)
|
function parse_unit(unit_str)
|
||||||
{
|
{
|
||||||
|
if(unit_str.indexOf("%") > -1 && unit_str.indexOf(",") > -1 && unit_str.indexOf("x") > -1){
|
||||||
|
return Object.assign(parse_unit(unit_str.split("%")[0]), parse_unit(unit_str.split("%")[1]));
|
||||||
|
}
|
||||||
if(unit_str.indexOf(",") > -1){
|
if(unit_str.indexOf(",") > -1){
|
||||||
return {x:parseInt(unit_str.split(",")[0]),y:parseInt(unit_str.split(",")[1])};
|
return {x:parseInt(unit_str.split(",")[0]),y:parseInt(unit_str.split(",")[1])};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user