~hokiegeek/tw5-location-crafts

0101ce70b04d55f8103165becacbc51f5218ad19 — HokieGeek 7 months ago ee4641e main 0.4.0
Loads caption of an element tiddler if found
5 files changed, 83 insertions(+), 2 deletions(-)

M macros.tid
M plugin.info
M styles.tid
A template-element.tid
M template-region.tid
M macros.tid => macros.tid +46 -1
@@ 10,6 10,44 @@ how to mark uniques?
and how to mark them off?
-->

<!--
\define list-links-draggable-drop-actions()
<$action-listops $tiddler=<<targetTiddler>> $field=<<targetField>> $subfilter="+[insertbefore:currentTiddler<actionTiddler>]"/>
\end

\define list-links-draggable(tiddler,field:"list",type:"ul",subtype:"li",class:"",itemTemplate)
\whitespace trim
<span class="tc-links-draggable-list">
<$vars targetTiddler="""$tiddler$""" targetField="""$field$""">
<$type$ class="$class$">
<$list filter="[list[$tiddler$!!$field$]]">
<$droppable actions=<<list-links-draggable-drop-actions>> tag="""$subtype$""" enable=<<tv-enable-drag-and-drop>>>
<div class="tc-droppable-placeholder"/>
<div>
<$transclude tiddler="""$itemTemplate$""">
<$link to={{!!title}}>
<$transclude field="caption">
<$view field="title"/>
</$transclude>
</$link>
</$transclude>
</div>
</$droppable>
</$list>
<$tiddler tiddler="">
<$droppable actions=<<list-links-draggable-drop-actions>> tag="div" enable=<<tv-enable-drag-and-drop>>>
<div class="tc-droppable-placeholder">
{{$:/core/images/blank}}
</div>
<div style="height:0.5em;"/>
</$droppable>
</$tiddler>
</$type$>
</$vars>
</span>
\end
-->

\define category-list(type)
<div class="category-list">
    <$let special-elements-default="expected none custom random special"


@@ 25,7 63,7 @@ and how to mark them off?
    </div>
    <div style="display: grid; width: fit-content;">
        <div style="grid-column-start: 1; font-size: .8rem; margin-right: .5rem;">
            Progress points:
            Progress<span class="progress-points-label"> points</span>:
        </div>
        <div style="grid-column-start: 2">
            <$reveal type="gt" stateTitle=<<currentTiddler>> stateField="crafted-$type$-points" text="0">


@@ 61,7 99,14 @@ and how to mark them off?
            <<element>>
            </$list>
            <$list filter="[<special-elements-$type$>enlist-input:raw[]match<element>then[found]else[]remove[found]]">
            <!--
            <$link to=<<element>>><<element>></$link>
            -->
            <$link to=<<element>>>
            <$transclude tiddler=<<element>> field="caption">
            <<element>>
            </$transclude>
            </$link>
            </$list>
            <!--
            <$let prev={{{ [<counter>subtract[1]] }}}

M plugin.info => plugin.info +1 -1
@@ 2,7 2,7 @@
    "title": "$:/plugins/hokiegeek/location-crafts",
    "description": "Some templates and stuff for recording information created with the RPG tool The Location Crafter",
    "author": "hokiegeek",
    "version": "0.3.2",
    "version": "0.4.0",
    "core-version": ">=5.2.1",
    "source": "https://git.sr.ht/~hokiegeek/tw5-location-crafts",
    "plugin-type": "plugin",

M styles.tid => styles.tid +4 -0
@@ 51,3 51,7 @@ type: text/vnd.tiddlywiki
    vertical-align: middle;
    padding: 0px 1px 1px 0px;
}

.progress-points-label {
    display: none;
}

A template-element.tid => template-element.tid +30 -0
@@ 0,0 1,30 @@
modified: 20220217175144000
created: 20220217175144000
creator: hokiegeek
title: $:/plugins/hokiegeek/location-crafts/templates/element
type: text/vnd.tiddlywiki

<$list filter="[<special-elements-$type$>enlist-input:raw[]match<element>]">
<<element>>
</$list>
<$list filter="[<special-elements-$type$>enlist-input:raw[]match<element>then[found]else[]remove[found]]">
<!--
<$link to=<<element>>><<element>></$link>
-->
<$link to=<<element>>>
<$transclude tiddler=<<element>> field="caption">
<<element>>
</$transclude>
</$link>
</$list>
</$list>
<!--
<$let prev={{{ [<counter>subtract[1]] }}}
      last={{{ [<currentTiddler>get[crafted-$type$]enlist-input:raw[]rest<counter>join[ ]] }}}
      newlist={{{ [<currentTiddler>get[crafted-$type$]enlist-input:raw[]first<prev>append<last>join[ ]] }}}>
<$button setTitle=<<categoryState>> setField=$type$ setTo="hidden" tooltip="use unique" aria-label="use unique" class="tc-btn-invisible tc-btn-mini btn-close">
    <$action-setfield $tiddler=<<me>> $field="crafted-$type$" $value=<<newlist>> />
    {{$:/core/images/erase}}
</$button>
</$let>
-->

M template-region.tid => template-region.tid +2 -0
@@ 5,7 5,9 @@ tags: location-crafts
title: $:/plugins/hokiegeek/location-crafts/templates/region
type: text/vnd.tiddlywiki

<!--
,,(using TheLocationCrafter methodology to define this region),,
-->

<div style="display: grid">
    <div style="grid-column-start: 1">