Skip to content

bluehexagons/foodguide

Repository files navigation

Provides some tools for avoiding starvation in a game named after the task.

Use

Live version - foodguide.bluehexagons.com

github.io - bluehexagons.github.io/foodguide/

Running Offline

This Food Guide must be run on a web server for most browsers to properly open it. With NodeJS installed, an easy way to run this offline is by hosting it with the http-server package:

npx http-server

Using the defaults, it should become accessible locally in a browser on 127.0.0.1:8080.

Desktop version (foodguide-app)

The foodguide-app repository has source code and release builds for a thin Electron wrapper around this project.

Development

Pull requests and bug reports are greatly appreciated if anything is out of sync with Don't Starve's current versions.

The Unofficial Don't Starve Food Guide requires no setup and uses no imported code, and is a simple collection of JavaScript/HTML/CSS files. It must be served on a web server so that the JavaScript modules can be loaded by a web browser.

To format code automatically using eslint rules, run npx eslint --fix or your preferred formatting method. This is not required before submitting a PR, as it will be run regardless.

Reusing the data and helpers in other projects

The food, recipe, and mode-handling modules are pure ES modules with no runtime dependencies and can be imported from Node, Deno, Bun, or any bundler-using web project. After installing this package (e.g. as a git dependency), the public entry points are:

// Everything except DOM helpers
import { food, recipes, modes, AND, NAME, matchesMode } from 'foodguide';

// Or import individual modules
import { food } from 'foodguide/food';
import { recipes, updateFoodRecipes } from 'foodguide/recipes';
import * as constants from 'foodguide/constants';
import { matchesMode, calculateModeMask } from 'foodguide/mode-utils';
import { AND, OR, NAME, TAG } from 'foodguide/functions';

// Browser-only DOM helpers
import { makeImage, makeLinkable } from 'foodguide/utils';

The data tables in food and recipes are the same objects the live tool uses — see html/food.js and html/recipes.js for shape documentation.

Translations

UI strings emitted from JavaScript are centralised in html/strings.js, and static HTML strings are translated via data-i18n="key", data-i18n-html="key", and data-i18n-attr-NAME="key" attributes. Built-in locales live in html/locales/ (currently en, es, and zh); the es and zh translations were generated by Anthropic Claude Opus and have not yet been reviewed by native-speaking Don't Starve players — corrections via PR are welcome.

Adding a locale:

import { registerLocale, setLocale } from 'foodguide/strings';

registerLocale('fr', 'Français', {
	pause: 'Pause',
	resume: 'Reprendre',
	// ...partial overrides; missing keys fall back to English.
});

setLocale('fr');

Names of foods, recipes, characters, and DLCs are intentionally left untranslated for now — those should be sourced from the game itself rather than re-translated by hand.

Contributors

bluehexagons rezecib levy9527 brewingcode agathasilva28 6lancmange lakhnishMonster lormico VaingloriousReptile

About

The Unofficial Don't Starve Food Guide and Crock Pot Simulator

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors