@@ -9,6 +9,7 @@ Stardew Valley.
99* [ Adding Notes] ( #adding-notes )
1010 * [ Content Patcher example] ( #content-patcher-example )
1111 * [ Image Notes] ( #image-notes )
12+ * [ Combined Notes] ( #combined-notes )
1213 * [ Custom Items] ( #custom-items )
1314* [ How Modded Notes Work] ( #how-modded-notes-work )
1415 * [ Spawning] ( #spawning )
@@ -31,18 +32,19 @@ a few advanced things, like:
3132
3233* specify complex eligibility conditions on a note-by-note basis with game
3334 state queries
34- * determine which location context(s ) your notes appear in, so you can (e.g.)
35- restrict your mod's notes to spawn only in your mod's area
35+ * declare which specific locations (or location contexts ) your notes appear
36+ in, so you can (e.g.) restrict your mod's notes to spawn only in your areas
3637* use different (custom) items to represent different sets of notes, as
3738 desired
3839* specify your own assets for note content and formatting, including image
3940 notes
41+ * create notes with an image as well as a small amount of text
4042* set any number of trigger actions to be run when a note is first read
4143
4244Let's begin!
4345
44- (** Please note** : I recommend using i18n for text content in your mods. The
45- examples in this guide omit its use, for clarity of purpose.)
46+ (** Please note** : although I recommend using i18n for text content in your
47+ mods, the examples in this guide omit its use, for clarity of purpose.)
4648
4749
4850## Adding Notes
@@ -80,6 +82,13 @@ codes](https://stardewvalleywiki.com/Modding:Mail_data#Custom_mail_formatting)
8082` [letterbg] ` and ` [textcolor] ` , but it is preferred to use the other fields for
8183that instead (the fields will supersede the in-band format codes).
8284
85+ Unlike vanilla notes, with Secret Note Framework you can include some text in
86+ image notes (see ` NoteImageTextureIndex ` , which is used to control whether a
87+ note displays an enclosed image). When ` NoteImageTextureIndex ` is >= 0, the
88+ ` Contents ` field will still be used, but is limited to two lines of text,
89+ displayed above and below the image. See [ Combined Notes] ( #combined-notes ) for
90+ more information.
91+
8392* Default:* ` "" `
8493
8594</td >
@@ -123,22 +132,46 @@ note has been seen by a player, which is useful for ordering your notes.
123132</td >
124133</tr >
125134
135+ <tr >
136+ <td ><code >Location</code ></td >
137+ <td >string</td >
138+ <td >
139+
140+ This string specifies one or more location names where the note is able to
141+ appear: except in the specified locations, the note will not spawn. This allows
142+ you to limit the areas where your note can be found even more narrowly than
143+ with ` LocationContext ` (but see that field for an alternative).
144+
145+ Specify any number of location names, separated by commas (e.g. `Town, Forest,
146+ {{ModId}}_ MyMap`), to allow a note to spawn in any of them.
147+
148+ If this field is specified, it will supersede ` LocationContext ` ; they cannot be
149+ combined.
150+
151+ * Default:* ` null `
152+
153+ </td >
154+ </tr >
155+
126156<tr >
127157<td ><code >LocationContext</code ></td >
128158<td >string</td >
129159<td >
130160
131161This string specifies one or more location contexts where the note is able to
132- appear. Vanilla journal scraps spawn only in the ` Island ` context (i.e. on
133- Ginger Island); secret notes spawn anywhere else. You can specify any value(s)
134- here, including modded contexts, so for example if a mod adds a mountain area
135- with a separate context, you can define notes which spawn only there.
162+ appear. In vanilla, journal scraps spawn only in the ` Island ` context (i.e. on
163+ Ginger Island), and secret notes spawn anywhere else. You can specify any
164+ value(s) here, including modded contexts, so for example if a mod adds a
165+ mountain area with a separate context, you can define notes which spawn only
166+ there.
136167
137168Specify any number of context names, separated by commas (e.g. `Default,
138169Desert`), to allow a note to spawn in any of them. Alternately, you can specify
139170one context name preceded by a ` ! ` to specify any location * except* that one:
140171the default value is ` !Island ` , mimicking vanilla's secret notes.
141172
173+ If ` Location ` is specified, this field will be ignored.
174+
142175* Default:* ` !Island `
143176
144177</td >
@@ -156,9 +189,9 @@ matching it will be read (see [Spawning](#spawning), under how notes work, for
156189more details). This item's sprite will also be displayed in the collections
157190page to represent this note, either grayed out (unread) or normal (read).
158191
159- If this field is ` null ` (the default), the mod will use its default secret note
160- object. For best results, you should leave it as default or specify a [ custom
161- item] ( #custom-items ) .
192+ If this field is ` null ` (the default), the framework will use its default
193+ secret note object. For best results, you should leave it as default or specify
194+ a [ custom item] ( #custom-items ) .
162195
163196* Default:* ` null `
164197
@@ -214,6 +247,9 @@ any of the 10 acceptable vanilla color names:
214247"NoteTextColor": "rgb(88, 34, 44)",
215248```
216249
250+ Note that the text in mail and secret notes is rendered at 75% opacity, so the
251+ color you indicate here will blend slightly with the background texture.
252+
217253* Default:* ` null `
218254
219255</td >
@@ -225,11 +261,12 @@ any of the 10 acceptable vanilla color names:
225261<td >
226262
227263A game asset path indicating the texture to use when loading an image for an
228- [ image note] ( #image-notes ) (see that section for more details).
229- Note images are 64x64 pixels and are read in order, left-to-right and
230- top-to-bottom, just like other spritesheets; but be aware that there is a
231- hardcoded offset for the image of the piece of tape holding the image inside
232- the note (193/65, 14x21), so you should not use the index containing that.
264+ [ image note] ( #image-notes ) or [ combined note] ( #combined-notes ) (see those
265+ sections for more details). Note images are 64x64 pixels and are read in
266+ order, left-to-right and top-to-bottom, just like other spritesheets; but be
267+ aware that there is a hardcoded offset for the image of the piece of tape
268+ holding the image inside the note (193/65, 14x21), so you should not use the
269+ index containing that.
233270
234271If ` null ` , the default secret notes image texture
235272(` TileSheets/SecretNotesImages.png ` ) will be used.
@@ -247,8 +284,12 @@ If `null`, the default secret notes image texture
247284An integer specifying the index in the ` NoteImageTexture ` to use for the note
248285image. Unlike ` NoteTextureIndex ` , the default value here is ` -1 ` , since the
249286LetterViewerMenu itself uses this value to control rendering; as a result,
250- ** this value controls whether your note is an image note (>= 0) or a text note
251- (-1)** .
287+ ** this value controls whether your note is an image or combined note (>= 0) or
288+ a text note (-1)** .
289+
290+ To display just an image in your note, set this to a value >= 0 and also omit
291+ the ` Contents ` field; for a combined note, also include ` Contents ` (but mind
292+ the limit on length in this case).
252293
253294* Default:* ` -1 `
254295
@@ -323,6 +364,9 @@ this offset in the texture will be displayed (this applies to both the hover
323364tooltip and the inside of the letter). This image behaves exactly like the
324365vanilla secret notes texture (` Data/SecretNotesImages ` ), as follows.
325366
367+ (Image notes can also include a small amount of text; see [ Combined
368+ Notes] ( #combined-notes ) )
369+
326370Each note image in the texture is 64x64 pixels, the same size as a character
327371portrait. They are read left-to-right and top-to-bottom, like this:
328372
@@ -366,6 +410,41 @@ Here's how you might set up an image note via Content Patcher:
366410}
367411```
368412
413+ ### Combined Notes
414+
415+ Combined notes are [ image notes] ( #image-notes ) which also include text. To
416+ define one, simply set ` NoteImageTextureIndex ` to a value 0 or greater, and
417+ also include a ` Contents ` field. When both fields are set, the letter will
418+ render with an enclosed image, as above, and the first two lines' worth of text
419+ from ` Contents ` will be drawn above and below the image.
420+
421+ ** Note** : the text portion of combined notes ** is not rendered in the note's
422+ hover tooltip** in the collections page. It is drawn only in the letter view
423+ itself.
424+
425+ You can draw only the leading line by keeping your ` Contents ` field short; if
426+ there isn't enough text for a second line, it won't be drawn. Likewise, if you
427+ want only the trailing line, you can write a short line and start it with a
428+ mail-formatted line break ` ^ ` , so that the first line is empty.
429+
430+ Here's how the previous image note example might look if it also included text:
431+
432+ ``` js
433+ {
434+ " Target" : " Mods/ichortower.SecretNoteFramework/Notes" ,
435+ " Action" : " EditData" ,
436+ " Entries" : {
437+ " {{ModId}}_SecretNote_TreasureMap" : {
438+ " Title" : " Blackgull's Map" ,
439+ " Contents" : " ^Good luck findin' this one, matey!" ,
440+ " NoteImageTexture" : " Mods/{{ModId}}/SecretNotesImages" ,
441+ " NoteImageTextureIndex" : 3
442+ }
443+ }
444+ }
445+ ```
446+
447+
369448### Custom Items
370449
371450Using custom items for your secret notes lets you add a little extra * je ne
0 commit comments