Skip to content
Snippets Groups Projects
Commit 78580dcf authored by Nils G.'s avatar Nils G.
Browse files

Always load idle css definition independent of actual role

parent 8b079f04
No related branches found
No related tags found
No related merge requests found
function render(_name, _role, _roles){
if(_role in _roles) {
renderRole(_roles[_role]);
renderRole(_roles[_role], _roles["idle"]);
return;
}
......@@ -15,7 +15,21 @@ function render(_name, _role, _roles){
set_error("The role of this player has no render target.");
}
function renderRole(_definition) {
function renderRole(_definition, _roleIdle) {
if(_roleIdle && (_definition !== _roleIdle)){
var old_css_idle = $("#game_css_idle");
if(old_css_idle) {
old_css_idle.remove();
}
if("css" in _roleIdle) {
//Add idle css
var css = $("<style id='game_css_idle' type='text/css'>" + sanitizeCSS(_roleIdle["css"]) + "</style>");
$("#current_content").append(css);
}
}
var old_css = $("#game_css");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment