Skip to content

Commit 8761bf0

Browse files
committed
(w/AI) Add favorite food section, split game/guide info tabs
1 parent e5cb971 commit 8761bf0

File tree

3 files changed

+225
-94
lines changed

3 files changed

+225
-94
lines changed

html/foodguide.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,10 @@ import {
784784
if (storage.activeTab && tabs[storage.activeTab]) {
785785
activeTab = tabs[storage.activeTab];
786786
activePage = elements[storage.activeTab];
787+
} else if (storage.activeTab === 'help') {
788+
// Migrate: 'help' tab was split into 'about' and 'gameinfo'
789+
activeTab = tabs['about'];
790+
activePage = elements['about'];
787791
}
788792

789793
// New format: version + dlc + character

html/index.htm

Lines changed: 191 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ <h1>Sorry, this Food Guide requires JavaScript and a modern web browser.</h1>
4040
<li data-tab="statistics" title="Find all recipes (unstable)">
4141
Statistics Analyzer
4242
</li>
43-
<li data-tab="help" title="Help and information">Help</li>
43+
<li data-tab="about" title="About this tool and how to use it">About</li>
44+
<li data-tab="gameinfo" title="Don't Starve game mechanics reference">
45+
Game Info
46+
</li>
4447
<li>
4548
<a
4649
title="Give Klei your money"
@@ -108,7 +111,7 @@ <h2>Find what recipes are most efficient:</h2>
108111

109112
<div id="statistics"></div>
110113

111-
<div id="help">
114+
<div id="about">
112115
<h2>About This Food Guide</h2>
113116

114117
<p>
@@ -132,9 +135,96 @@ <h2>About This Food Guide</h2>
132135

133136
<p>Last content addition: <strong>August 6, 2023</strong></p>
134137

135-
<h2>About Don't Starve</h2>
138+
<h2>Sections</h2>
139+
140+
<h3>Simulator</h3>
141+
142+
<p>
143+
The Simulator works like a Crock Pot: add items, and it will tell you what
144+
food will be prepared. Note that only the highest-priority recipes will be
145+
candidates when actually cooking in-game. The combined totals at the top
146+
reflect the ingredients added, where perish time is the shortest. The
147+
suggestions below the real results show what recipes could be made by adding
148+
different items to those already in the Crock Pot.
149+
</p>
150+
151+
<h3>Discovery</h3>
152+
153+
<p>
154+
The Discovery tab finds what recipes can be prepared using a collection of
155+
ingredients. It doesn't take item quantity into account, instead assuming
156+
you have four of each. You are also able to calculate efficient recipes
157+
using your ingredients to get the most health or hunger benefit from cooking
158+
them in the crock pot. This works identically to the Statistics Analyzer
159+
tab, but limited to your inventory.
160+
</p>
161+
162+
<h3>Food List &amp; Recipe List</h3>
163+
164+
<p>
165+
Browse all foods and Crock Pot recipes available in the selected game
166+
version. Use the version selector in the upper-left to switch between Don't
167+
Starve Together, Don't Starve, and Hamlet.
168+
</p>
169+
170+
<h3>Statistics Analyzer</h3>
171+
172+
<p>
173+
The Statistics Analyzer tab is for those who just want to explore ingredient
174+
combinations. It will calculate every valid ingredient combination possible
175+
(using an "ideal" ingredient selection, generally excluding uncooked food)
176+
and allows filtration by recipe and ingredient contents. Computation may
177+
take some time on slower computers.
178+
</p>
179+
180+
<h2>Advanced Use (JavaScript Globals)</h2>
181+
182+
<p>
183+
The Food Guide populates <code>window</code> with a few properties:
184+
<code>food</code>, <code>recipes</code>, and <code>matchingNames</code>. The
185+
Statistics Analyzer writes its results to <code>analysis</code> and
186+
<code>recipeCrunchData</code>. The local state is stored under
187+
<code>localStorage.foodGuideState</code>.
188+
</p>
189+
190+
<p>
191+
For advanced use, open your browser's JavaScript console.
192+
<code>analysis.made</code> contains the list of the working combinations
193+
from the last analysis, including beyond those visible in the interface.
194+
</p>
195+
196+
<h2>Links</h2>
197+
198+
<ul>
199+
<li>
200+
<a
201+
href="https://github.com/bluehexagons/foodguide/commits/main"
202+
target="_blank"
203+
>Food Guide Changelog</a
204+
>
205+
</li>
206+
<li>
207+
<a
208+
href="https://github.com/bluehexagons/foodguide/issues"
209+
target="_blank"
210+
>Report Food Guide Bugs / Issues</a
211+
>
212+
</li>
213+
<li>
214+
<a href="https://www.klei.com/games/dont-starve" target="_blank"
215+
>Don't Starve Official Website</a
216+
>
217+
</li>
218+
<li>
219+
<a href="https://dontstarve.wiki.gg/" target="_blank"
220+
>Don't Starve Wiki</a
221+
>
222+
</li>
223+
</ul>
224+
</div>
136225

137-
<h3>Food Mechanics</h3>
226+
<div id="gameinfo">
227+
<h2>Food Mechanics</h2>
138228

139229
<p>
140230
<strong>Perish time</strong> is the time before a food item becomes
@@ -171,7 +261,7 @@ <h3>Food Mechanics</h3>
171261
If it does, then only the valid form will be listed.
172262
</p>
173263

174-
<h3>About DLC and Don't Starve Together</h3>
264+
<h2>Game Versions and DLC</h2>
175265

176266
<p>
177267
The game version selector in the upper-left lets you switch between Don't
@@ -182,7 +272,7 @@ <h3>About DLC and Don't Starve Together</h3>
182272
mechanics.
183273
</p>
184274

185-
<h3>Character Food Mechanics</h3>
275+
<h2>Character Food Mechanics</h2>
186276

187277
<p>
188278
<strong>Warly</strong> is a chef character who can only be played in
@@ -207,7 +297,101 @@ <h3>Character Food Mechanics</h3>
207297
Volt Goat Chaud-Froid.
208298
</p>
209299

210-
<h3>Useful wiki pages:</h3>
300+
<h2>Favorite Foods (DST)</h2>
301+
302+
<p>
303+
In Don't Starve Together, each character gains an extra 15 Hunger when
304+
eating their favorite food. This bonus is affected by freshness.
305+
</p>
306+
307+
<table id="help-favorite-foods">
308+
<thead>
309+
<tr>
310+
<th>Character</th>
311+
<th>Favorite Food</th>
312+
</tr>
313+
</thead>
314+
<tbody>
315+
<tr>
316+
<td>Wilson</td>
317+
<td>Bacon and Eggs</td>
318+
</tr>
319+
<tr>
320+
<td>Willow</td>
321+
<td>Spicy Chili</td>
322+
</tr>
323+
<tr>
324+
<td>Wendy</td>
325+
<td>Banana Pop</td>
326+
</tr>
327+
<tr>
328+
<td>Wolfgang</td>
329+
<td>Roasted Potato</td>
330+
</tr>
331+
<tr>
332+
<td>Woodie</td>
333+
<td>Honey Nuggets</td>
334+
</tr>
335+
<tr>
336+
<td>Wickerbottom</td>
337+
<td>Surf 'n' Turf</td>
338+
</tr>
339+
<tr>
340+
<td>WX-78</td>
341+
<td>Butter Muffin</td>
342+
</tr>
343+
<tr>
344+
<td>Wes</td>
345+
<td>Fresh Fruit Crepes</td>
346+
</tr>
347+
<tr>
348+
<td>Maxwell</td>
349+
<td>Wobster Dinner</td>
350+
</tr>
351+
<tr>
352+
<td>Wigfrid</td>
353+
<td>Turkey Dinner</td>
354+
</tr>
355+
<tr>
356+
<td>Webber</td>
357+
<td>Ice Cream</td>
358+
</tr>
359+
<tr>
360+
<td>Winona</td>
361+
<td>Vegetable Stinger</td>
362+
</tr>
363+
<tr>
364+
<td>Wortox</td>
365+
<td>Pomegranates</td>
366+
</tr>
367+
<tr>
368+
<td>Wormwood</td>
369+
<td>Cooked Cave Banana</td>
370+
</tr>
371+
<tr>
372+
<td>Warly</td>
373+
<td>None</td>
374+
</tr>
375+
<tr>
376+
<td>Wurt</td>
377+
<td>Extra Smelly Durian</td>
378+
</tr>
379+
<tr>
380+
<td>Walter</td>
381+
<td>Trail Mix</td>
382+
</tr>
383+
<tr>
384+
<td>Wanda</td>
385+
<td>Taffy</td>
386+
</tr>
387+
<tr>
388+
<td>Wonkey</td>
389+
<td>Cave Banana</td>
390+
</tr>
391+
</tbody>
392+
</table>
393+
394+
<h2>Useful Wiki Pages</h2>
211395

212396
<ul>
213397
<li>
@@ -229,86 +413,6 @@ <h3>Useful wiki pages:</h3>
229413
>
230414
</li>
231415
</ul>
232-
233-
<h2>Sections</h2>
234-
235-
<h3>Simulator</h3>
236-
237-
<p>
238-
The Simulator works like a Crock Pot: add items, and it will tell you what
239-
food will be prepared. Note that only the highest-priority recipes will be
240-
candidates when actually cooking in-game. The combined totals at the top
241-
reflect the ingredients added, where perish time is the shortest. The
242-
suggestions below the real results show what recipes could be made by adding
243-
different items to those already in the Crock Pot.
244-
</p>
245-
246-
<h3>Discovery</h3>
247-
248-
<p>
249-
The Discovery tab is finds what recipes can be prepared using a collection
250-
of ingredients. It doesn't take item quantity into account, instead assuming
251-
you have four of each. You are also able to calculate efficient recipes
252-
using your ingredients to get the most health or hunger benefit from cooking
253-
them in the crock pot. This works identically to the Statistics Analyzer
254-
tab, but limited to your inventory.
255-
</p>
256-
257-
<h3>Statistics Analyzer</h3>
258-
259-
<p>
260-
The Statistics Analyzer tab is for those who just want to explore ingredient
261-
combinations. It will calculate every valid ingredient combination possible
262-
(using an "ideal" ingredient selection, generally excluding uncooked food)
263-
and allows filtration by recipe and ingredient contents. Computation may
264-
take some time on slower computers.
265-
</p>
266-
267-
<p>
268-
For advanced use, open your browser's JavaScript console.
269-
<code>analysis.made</code> contains the list of the working combinations
270-
from the last analysis, including beyond those visible in the interface.
271-
</p>
272-
273-
<h2>Advanced Use (JavaScript Globals)</h2>
274-
275-
<p>
276-
The Food Guide populates <code>window</code> with a few properties:
277-
<code>food</code>, <code>recipes</code>, and <code>matchingNames</code>. The
278-
Statistics Analyzer writes its results to <code>analysis</code> and
279-
<code>recipeCrunchData</code>.
280-
</p>
281-
282-
<p>The local state is stored under <code>localStorage.foodGuideState</code>.</p>
283-
284-
<h2>Links</h2>
285-
286-
<ul>
287-
<li>
288-
<a
289-
href="https://github.com/bluehexagons/foodguide/commits/main"
290-
target="_blank"
291-
>Food Guide Changelog</a
292-
>
293-
</li>
294-
<li>
295-
<a
296-
href="https://github.com/bluehexagons/foodguide/issues"
297-
target="_blank"
298-
>Report Food Guide Bugs / Issues</a
299-
>
300-
</li>
301-
<li>
302-
<a href="https://www.klei.com/games/dont-starve" target="_blank"
303-
>Don't Starve Official Website</a
304-
>
305-
</li>
306-
<li>
307-
<a href="https://dontstarve.wiki.gg/" target="_blank"
308-
>Don't Starve Wiki</a
309-
>
310-
</li>
311-
</ul>
312416
</div>
313417
</div>
314418

0 commit comments

Comments
 (0)