Change console behavior?



  • Just discovered the html details tag and found that it would be rather useful for logging. You can show and hide an expandable list of items.

    It works in the game console, allowing you to expand and collapse the list, but the next time something is logged to the console it automatically collapses the details tag, hiding the list.

    I am not completely sure why this is happening, maybe the game console completely redraws every entry from scratch when something new is logged?

    If it is possible to change the behavior of the game console so that the state of the details tag (and possibly other tags like it) is preserved when something new is logged, it would improve the quality of logging quite a bit in my opinion.


  • Culture

    Believe this is more of a browser issue. You have to assign your details tag with an unique id if you want it to keep its state.

    Example if you print just one list each tick this should work:

    "<details id='" + Game.time + "'>"


  • Indeed that does work. Thank you very much!



  • In fact, they don't even seem to require unique id's. I can assign the same id to multiple lists outputted in the same tick and they each work and keep their states separately.



  • Okay so apparently it will still automatically close them if the console "buffer" is full (if there are enough messages in the console that the oldest one gets deleted when a new one enters).