kylepaulsen / ValheimWebMap

A Valheim dedicated server mod to host a web accessible map.
29 stars 13 forks source link

Add default zoom level (default 100%). #6

Closed rysson closed 3 years ago

rysson commented 3 years ago

Add config option default_zoom (default: 100) to adjust zoom factor on early part of game.

I don't know how to build DLL in my Linux, than I just change Config.cs, please check it. I've tested it by changing default value in fetchConfig.

BTW. When I added

const defaultZoom = constants.DEFAULT_ZOOM;

on top of map.js then setting was ignored in map init(). I've to use constants.DEFAULT_ZOOM directly.

Are you sure exploreRadius or pixelSize are taken from fetched config? I've change "explore_radius": 200 in my server config and add console message in map.explore(), it prints 100.

kylepaulsen commented 3 years ago

These changes look promising, I'll try and work them in next release.

rysson commented 3 years ago

I make fixes, thank for review. I rebase it to current master,

kylepaulsen commented 3 years ago

Hey I wanted to fix my zoom code a bit, so I just merged in your changes with that. Also made the default zoom 200 as most of the time, people are probably going to be somewhere in the center. Anyway I just released which means this and #5 should be out now.