Skip to content

Commit

Permalink
#36 save altered config on start
Browse files Browse the repository at this point in the history
  • Loading branch information
L3P3 committed Jan 3, 2024
1 parent 8e7fb27 commit d23d6fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minicraft",
"version": "0.9.0",
"version": "0.9.1",
"description": "voxel-based 3d game, written in javascript",
"homepage": "https://l3p3.de/minicraft",
"repository": {
Expand Down
8 changes: 8 additions & 0 deletions src/etc/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {

export const reducers = {
init: () => {
let needs_save = false;
const config = {
flag_textures: true,
mouse_sensitivity: 3,
Expand Down Expand Up @@ -52,8 +53,15 @@ export const reducers = {
mod_l: Date.now(),
mod_r: 0,
};
needs_save = true;
}
}
if (needs_save) {
return reducers.config_save({
config,
config_saved: null,
});
}
return {
config,
config_saved: config,
Expand Down
1 change: 0 additions & 1 deletion src/game/c_menu_start.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ function WorldItem({
}),
node_dom('span', {
innerText: datify(Math.max(I.local, I.remote)),
title: `Lokal: ${datify(I.local)}\nServer: ${datify(I.remote)}`,
}),
];
}
Expand Down

0 comments on commit d23d6fa

Please sign in to comment.