Files
MagicSetEditor2/doc/function/combined_editor.txt
T
twanvl bdc1e12e95 Added <prefix> and <suffix> tags;
Added prefix and suffix support to combined_editor;
'always symbol' now checks if the symbols are available in the symbol font;
Fixed parser bug in spec_sort;
A first information field is no longer used as set identification

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@653 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-09-01 19:56:43 +00:00

47 lines
2.1 KiB
Plaintext

Function: combined_editor
--Usage--
> forward_editor(field: some_text_value)
> combined_editor(field1: some_text_value, field2: some_text_value, ..., separtor1: some_string, ...)
Use one text field to edit one or more others.
This function must be used in the @script@ of a [[type:field#text|text field]].
This field will then contain the combined values of the given fields, separated by the separtors in <tt>&lt;sep></tt> tags.
When the field changes the underlying values are updated and vice versa.
Note: @forward_editor@ and @combined_editor@ are the same function.
--Parameters--
! Parameter Type Default Description
| @field@ [[type:value#text|text value]] Text value to edit
| @field1@ [[type:value#text|text value]] Another text value to edit
| @field2@ [[type:value#text|text value]] ''etc.''
| @separator@ [[type:string]] Separator between field 1 and 2
| @separator1@ [[type:string]] Multiple separators
| @separator2@ [[type:string]] Next separator, ''etc.''
| @prefix@ [[type:string]] ''optional'' Prefix before the combined editor; like a separtor between the start and the first field.
| @suffix@ [[type:string]] ''optional'' Suffix after the combined editor; like a separtor between the last field and the end.
| @hide when empty@ [[type:boolean]] @false@ Don't include separators if the entire value is empty.
| @soft before empty@ [[type:boolean]] @false@ Make separators 'soft' when the value folowing it is empty.
Soft separators are hidden by default and shown grayed when the field is selected.
--Examples--
>card field:
> ...
> script:
>> combined_editor(
>> field1: card.first_part
>> separator: " - "
>> field2: card.second_part
>> )
Forwarding just one field should be used in cases when two fields share a value, or when sometimes multiple fields are combined.
For example the Magic uses:
>> if set.include_automatic_card_numbers then
>> combined_editor(field1: card.copyright,
>> separator: "/",
>> field2: card.card_number)
>> else
>> forward_editor(field: card.copyright)