Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ~~~~ On the Story Page ~~~~
- //Sjoerd's Macro
- <<flash "You found Maxine!">> <</flash>>
- // Plain Text
- <div class="notification">This would be a notification.</div>
- // Conditional Display
- <<if $var is true>>[code of the notification of choice]<</if>
- can also work with : <<if $var>>, <<if def $var>>, <<if $var is (whatever you defined it as)>>
- <<if visited("Name of the current passage") is 1>>[Code of the notification of choice]<</if>>
- ~~~~ Next to a Link ~~~~
- //Principle
- [[link|to Passage]]<<if condition>>NEW~<</if>>
- //Variable
- :: Story
- <<set $var to true>>
- :: Codex
- [[link|Page]]<<if $var>>NEW~<</if>>
- :: Page
- <<unset $var>>
- * To avoid the variable resetting:
- <<if visited("Story") is 1>><<set $var to true>><</if>>
- or
- [[link|Page]]<<if $var && (not hasVisited("Page"))>>NEW~<</if>>
- * Alternative
- :: Story
- <<if visited("Story") is 1>><<set $var to "unread">><</if>>
- :: Codex
- [[link|Page]]<<if $var is "unread">>NEW~<</if>>
- :: Page
- <<set $var to "read">> OR <<unset $var>>
- //Previously hidden link
- <<if condition for showing the link>>
- [[link|Page]]<<if not hasVisited("Page")>>NEW~<</if>>
- <<else>>Not available<</if>>
- //Show updates
- :: Story 1
- <<if visited("Story 1") is 1>><<set $var to "new">><</if>>
- :: Codex
- [[link|Page]]\
- <<if $var is "new">>NEW~\
- <<elseif $var is "update">>UPDATED~\
- <<elseif $var is "complete">>COMPLETED~\
- <</if>>
- :: Page
- <<set $var to "read">> OR <<unset $var>>
- :: Story 2
- <<if visited("Story 2") is 1>><<set $var to "update">><</if>>
- :: Story 3
- <<if visited("Story 3") is 1>><<set $var to "complete">><</if>>
- *Alternative with objects
- :: StoryInit
- <<set $link to {}>>
- :: Story 1
- <<if visited("Story 1") is 1>><<set $link.fish to "new">><</if>>
- :: Codex
- [[link|Page]]<<if $link.fish is "new">>NEW~<</if>>
- //Widgets
- <<widget "notiflink">> <- for just one link
- <<if $var is "unread">>NEW~<</if>> or <<if $var is true>>NEW~<</if>> or <<if $var && (not hasVisited("Page"))>>NEW~<</if>>
- <</widget>>
- <<widget "notiflink">> <- if you have multiple links
- <<if _args[0] is "unread">>NEW~<</if>>
- <</widget>>
- <<widget "notiflink">> <- more than one state
- <<if _args[0] is "new">>NEW~
- <<elseif _args[0] is "update">>UPDATED~
- <<elseif _args[0] is "complete">>COMPLETED~
- <</if>>
- <</widget>>
- * And to display it:
- [[link|Page]] <<notiflink>> <- one link
- [[link|Page]] <<notiflink $var>> <- multiple
Advertisement
Add Comment
Please, Sign In to add comment