Jump to content

The game uses hashes to sort the foods in Cookbook?


Recommended Posts

Spoiler
function CookbookPageCrockPot:_sortfn_default(a, b)
	return a.recipe_def.priority > b.recipe_def.priority or (a.recipe_def.priority == b.recipe_def.priority and a.defaultsortkey > b.defaultsortkey)
end
Spoiler
		local data = {
			prefab = prefab,
			name = STRINGS.NAMES[string.upper(prefab)] or subfmt(STRINGS.UI.COOKBOOK.UNKNOWN_FOOD_NAME, {food = prefab or "SDF"}),
			recipe_def = recipe_def,
			defaultsortkey = hash(prefab),
			food_atlas = "images/quagmire_recipebook.xml",
			food_tex = "cookbook_unknown.tex",
		}

It sorts them by priority first but anyway.

I hope it could be more reasonable.

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...