Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
2562da1e
Commit
2562da1e
authored
Aug 27, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added (partial) support for making cards in French style
parent
fc512fd6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
37 deletions
+93
-37
data/magic.mse-game/card_fields
data/magic.mse-game/card_fields
+4
-4
data/magic.mse-game/icons/language-en.png
data/magic.mse-game/icons/language-en.png
+0
-0
data/magic.mse-game/icons/language-fr.png
data/magic.mse-game/icons/language-fr.png
+0
-0
data/magic.mse-game/language
data/magic.mse-game/language
+33
-0
data/magic.mse-game/script
data/magic.mse-game/script
+44
-33
data/magic.mse-game/set_fields
data/magic.mse-game/set_fields
+12
-0
No files found.
data/magic.mse-game/card_fields
View file @
2562da1e
...
...
@@ -169,7 +169,7 @@ card field:
# Either just supertype, or subtype - supertype
combined_editor(
field1: card.super_type,
separator:
" — "
,
separator:
language().type_separator
,
field2: card.sub_type,
soft_before_empty: true,
hide_when_empty: true
...
...
@@ -275,7 +275,7 @@ card field:
script:
combined_editor(
field1: card.power,
separator:
"/"
,
separator:
language().pt_separator
,
field2: card.toughness,
soft_before_empty: true,
hide_when_empty: true
...
...
@@ -424,7 +424,7 @@ card field:
script:
combined_editor(
field1: card.super_type_2,
separator:
" — "
,
separator:
language().type_separator
,
field2: card.sub_type_2,
soft_before_empty: true,
hide_when_empty: true
...
...
@@ -495,7 +495,7 @@ card field:
script:
combined_editor(
field1: card.power_2,
separator:
"/"
,
separator:
language().pt_separator
,
field2: card.toughness_2,
soft_before_empty: true,
hide_when_empty: true
...
...
data/magic.mse-game/icons/language-en.png
0 → 100644
View file @
2562da1e
631 Bytes
data/magic.mse-game/icons/language-fr.png
0 → 100644
View file @
2562da1e
545 Bytes
data/magic.mse-game/language
0 → 100644
View file @
2562da1e
# Language specific strings
languages := [
English: [
code : "en",
pt_separator : "/",
type_separator : " — ",
subtype_separator : " ",
is_creature : match@(match: "(?i)Creature")
is_tribal : match@(match: "(?i)Tribal")
is_artifact : match@(match: "(?i)Artifact")
is_land : match@(match: "(?i)Land")
is_enchantment : match@(match: "(?i)Enchantment")
is_spell : match@(match: "(?i)Instant|Sorcery")
],
Français: [
code : "fr",
pt_separator : "/",
type_separator : " : "
subtype_separator : "<atom-sep> et </atom-sep>",
is_creature : match@(match: "(?i)Creature|Créature")
is_tribal : match@(match: "(?i)Tribal")
is_artifact : match@(match: "(?i)Artifact")
is_land : match@(match: "(?i)Land")
is_enchantment : match@(match: "(?i)Enchantment")
is_spell : match@(match: "(?i)Instant|Sorcery")
]
]
# The selected language
language := { languages[set.card_language] or else language.English }
data/magic.mse-game/script
View file @
2562da1e
############################################################## Localization
include file: language
############################################################## Sorting mana symbols
# correctly sort a mana symbol (no guild mana)
...
...
@@ -413,39 +417,46 @@ flavor_text_filter :=
# Move the cursor past the separator in the p/t and type boxes
type_over_pt := replace@(match:"/$", replace:"")
type_over_type := replace@(match:" ?-$", replace:"")
super_type_filter :=
remove_tag@(tag: "<word-list-") +
type_over_type +
{ "<word-list-type>{input}</word-list-type>" }
space_to_wltags := replace@(match:"( +|<soft> </soft>)",
replace:{"</word-list-{list_type}>{_1}<word-list-{list_type}>"})
sub_type_filter :=
remove_tag@(tag: "<word-list-") +
replace@(match: " </soft>$", replace: "") + # remove trailing soft space
remove_tag@(tag: "<soft") +
{ list_type := if is_creature(type) then "class"
else if is_land(type) then "land"
else if is_artifact(type) then "artifact"
else if is_enchantment(type) then "enchantment"
else if is_spell(type) then "spell"
if is_creature(type) or is_tribal(type) then (
first := "<word-list-race>{ only_first(input) }</word-list-race>"
next := only_next(input)
if input == "" then list_type := "" # only edit the race
else if next == "" then first := first + "<soft> </soft>"
else first := first + " "
input := next
) else (
first := ""
)
if list_type != "" then (
if input != "" then input := input + "<soft> </soft>" # Add a new box at the end
first + "<word-list-{list_type}>{ space_to_wltags(input) }</word-list-{list_type}>"
) else first + input
}
type_over_type := replace@(match:" ?[-:]$", replace:"")
super_type_filter := {
input := remove_tag(tag: "<word-list-")
input := type_over_type()
tag := "word-list-type" # TODO: localize
"<{tag}>{input}</{tag}>"
}
break_subtypes := split_text@(match: " +|<atom-sep>[^<]*</atom-sep>", include_empty:false)
sub_type_filter := {
input := remove_tag(tag: "<word-list-")
input := remove_tag(tag: "<soft")
lang := language()
# What word list to use?
list_type_rest := if lang.is_creature(type) then "class"
else if lang.is_land(type) then "land"
else if lang.is_artifact(type) then "artifact"
else if lang.is_enchantment(type) then "enchantment"
else if lang.is_spell(type) then "spell"
if list_type_rest != "" then (
if lang.is_creature(type) or lang.is_tribal(type) then (
list_type_first := "race"
) else (
list_type_first := list_type_rest
);
# wrap wordlist tag around each part
parts := break_subtypes()
(for each i:part in parts do
if i == 0 then
"<word-list-{list_type_first}>{part}</word-list-{list_type_first}>"
else
lang.subtype_separator + "<word-list-{list_type_rest}>{part}</word-list-{list_type_rest}>"
) +
(if length(parts) > 0 then
# Add a new box at the end
"<soft>{lang.subtype_separator}</soft><word-list-{list_type_rest}></word-list-{list_type_rest}>"
)
) else input # do nothing
}
# all sub types, for word list
space_to_comma := replace@(match:" ", replace:",")
...
...
data/magic.mse-game/set_fields
View file @
2562da1e
...
...
@@ -70,6 +70,13 @@ set field:
choice: after other cards
choice: separate numbering
initial: after other cards
set field:
type: choice
name: card language
description: Language for the cards
choice: English
choice: Français
initial: English
set field:
type: boolean
name: mark errors
...
...
@@ -144,3 +151,8 @@ default set style:
choice images:
yes: script: built_in_image("bool_yes")
no: script: built_in_image("bool_no")
card language:
render style: both
choice images:
English: /magic.mse-game/icons/language-en.png
Français: /magic.mse-game/icons/language-fr.png
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment