New graphics, new reversed icons
This commit is contained in:
49
src/deck.rb
49
src/deck.rb
@@ -6,8 +6,32 @@ def icon_to_svg(icon)
|
||||
icon.nil? ? nil : "icone_#{icon}.svg"
|
||||
end
|
||||
|
||||
def ret_icon_to_svg(icon)
|
||||
icon.nil? ? nil : "retourner_#{icon}.svg"
|
||||
end
|
||||
|
||||
def banner_text_layout(rank)
|
||||
if rank.nil?
|
||||
nil
|
||||
elsif rank.start_with?('+')
|
||||
"banniere_bonus.svg"
|
||||
elsif rank.start_with?('-')
|
||||
"banniere_malus.svg"
|
||||
else
|
||||
"banniere_rang.svg"
|
||||
end
|
||||
end
|
||||
|
||||
def rank_to_banner_svg(rank)
|
||||
rank.nil? ? nil : (rank.start_with?('+') || rank.start_with?('-')) ? "banniere_mod.svg" : "banniere_rang.svg"
|
||||
if rank.nil?
|
||||
nil
|
||||
elsif rank.start_with?('+')
|
||||
"banniere_bonus.svg"
|
||||
elsif rank.start_with?('-')
|
||||
"banniere_malus.svg"
|
||||
else
|
||||
"banniere_rang.svg"
|
||||
end
|
||||
end
|
||||
|
||||
def embed_custom(embed, id)
|
||||
@@ -50,23 +74,30 @@ Squib::Deck.new(
|
||||
alt_icon_file = data['icone_alt'].map { |icon| icon_to_svg(icon) }
|
||||
svg file: alt_icon_file, layout: 'alt_icon'
|
||||
|
||||
ret_icon_file = data['icone_alt'].map { |icon| ret_icon_to_svg(icon) }
|
||||
svg file: ret_icon_file, layout: 'ret_icon'
|
||||
|
||||
alt_ret_icon_file = data['icone'].zip(data['icone_alt']).map { |icon, alt_icon| alt_icon.nil? ? nil : ret_icon_to_svg(icon) }
|
||||
svg file: alt_ret_icon_file, layout: 'alt_ret_icon'
|
||||
|
||||
|
||||
alt_banner_file = data['rang_alt'].map { |rank| rank_to_banner_svg(rank) }
|
||||
svg file: alt_banner_file, layout: 'alt_banner'
|
||||
text str: data['rang_alt'], layout: 'alt_banner_text'
|
||||
|
||||
fill_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#f5f5f5ff' }
|
||||
stroke_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#bb98' }
|
||||
fill_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#f7f7f7ff' }
|
||||
stroke_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#cca9' }
|
||||
rect layout: 'effect_frame', fill_color: fill_color, stroke_color: stroke_color
|
||||
text(str: data['effet'], layout: 'effect_text') do |embed|
|
||||
embed_custom(embed, 'effet')
|
||||
embed_custom(embed, 'magouille')
|
||||
embed_custom(embed, 'pv')
|
||||
embed_custom(embed, 'icone_ind')
|
||||
embed_custom(embed, 'icone_gau')
|
||||
embed_custom(embed, 'icone_roy')
|
||||
embed_custom(embed, 'icone_ana')
|
||||
embed_custom(embed, 'icone_dro')
|
||||
embed_custom(embed, 'icone_eco')
|
||||
embed_custom(embed, 'symbole_ind')
|
||||
embed_custom(embed, 'symbole_gau')
|
||||
embed_custom(embed, 'symbole_roy')
|
||||
embed_custom(embed, 'symbole_ana')
|
||||
embed_custom(embed, 'symbole_dro')
|
||||
embed_custom(embed, 'symbole_eco')
|
||||
end
|
||||
|
||||
build :debug do
|
||||
|
||||
Reference in New Issue
Block a user