diff --git a/parse-items.rkt b/parse-items.rkt index 7f224de..0263297 100644 --- a/parse-items.rkt +++ b/parse-items.rkt @@ -246,12 +246,6 @@ ; me think that the U3REALITY and TRADINGCOST files are for backwards compatibility only. ; Much investigation needed to figure out the right set. -; Strangely, loading build recipes from the items files did not cause conflicts with any of the build recipes I had hand-entered -; in recipes.rkt, which mostly came from the Wiki. Makes me wonder - need to test in-game. Are one of these two sources wrong? Am I missing a source? - -; File METADATA\REALITY\DEFAULTREALITY.EXML looks to have refiner recipes in it! Ooh, this actually looks like the right starting point -; for a lot of stuff! - ; Read items first, put placeholder for name text. Then translate placeholders.(define build-recipes null) (define (read-default-reality root) @@ -266,35 +260,65 @@ (raise-argument-error 'read-default-reality "Expected name id) - (define item (hash-ref id-map id #f)) - (and item (item$-name item))) + + ; Make up fake names for the items for which we found no translation. Let's + ; hope they don't show up in the UI, but if they do we might have to figure out + ; why we didn't find user-friendly names for them. (for ([lst (hash-values name-id-map)]) (for ([i lst]) (define item-fake-name (string->symbol (first i))) (define id (first i)) (hash-set! id-map id (item$ item-fake-name id (second i) (third i) id)))) + + ; The basic and refiner recipes are currently expressed in terms of save-ids. Translate + ; these to item names. + (define (id->name id) + (define item (hash-ref id-map id #f)) + (and item (item$-name item))) (define build-recipes (for/list ([item all-item-data] #:when (> (length item) 3)) @@ -316,16 +340,11 @@ result]))) (values (hash-values id-map) build-recipes refiner-recipes)) -(define-values - (items build-recipes refiner-recipes) +(define-values (items build-recipes refiner-recipes) (read-default-reality root)) -(pretty-print (list 'Flags (sort (remove-duplicates (append-map (λ (v) (item$-flags v)) items)) symbol