mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
6afbbe986c
in documentation: @<tag>@ now highlights as a tag git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1279 0fc631ac-6414-0410-93d0-97cfa31319b6
47 lines
2.1 KiB
Plaintext
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, ..., separator1: 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 separators in @<sep>@ 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 separator between the start and the first field.
|
|
| @suffix@ [[type:string]] ''optional'' Suffix after the combined editor; like a separator 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 following 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)
|