OwenGHB / angband-webclient

Browser client and webserver for playing Angband and variants
http://angband.live
GNU General Public License v2.0
18 stars 7 forks source link

Incorrect font/size setting detection when spectating #41

Open kaytrance opened 5 years ago

kaytrance commented 5 years ago

When no settings about selected game font and game font size are saved into local storage, font size is not correctly calculated in order to make spectating window correct size.

How to reproduce

  1. Open angband.live;
  2. Open developer's console in browser;
  3. In Local Storage section expand to "angband.live" domain;
  4. Delete all keys starting with "aw_";
  5. Click on any game to spectate other player's game. Notice that chat pane is, probably, gone.

How to fix Detect if font related keys are in local storage before doing any calculations. If not set them first, apply settings to web terminal pane, only then perform calculations. Some additional checks can be even performed just after spectating has started to verify that spectating pane is not something bigger than expected.