查看: 147|回复: 6

[求助] 咨询一下皮肤大佬,怎么让一张图片显示球队球衣的背景/前景颜色?

[复制链接]
发表于 2025-11-8 16:30 | 显示全部楼层 |阅读模式
500PGB
本帖最后由 giggsxbr 于 2025-11-13 22:29 编辑

我的诉求是在FM24上面搞一个英超风格的开场画面,现在是这个效果
开场画面 (1).png
但有几个问题
1、左边的教练、替补的问题颜色我希望改成主队、客队的文字颜色,否则有些球队会看不清楚
主教练文字的对应代码在match preview lineups panel.xml里面,替补名单的对应代码在subs bench panel match preview lineups.xml里面,我的想法是从txHT/txAT获取出来,再设置上去,但是怎么都不生效,我感觉可能跟代码所处container的位置相关

2、阵容界面我希望是一个带着球队背景色的小卡片,应该是BGHT/BGAT这种,但是也不生效,怎么弄都是一个黑框,对应代码位于tactics icon preview info panel.xml

下面贴一下代码,希望大佬帮我一下,方便的话可以加我q,19837732,解决了会发个小红包哈

match preview lineups panel.xml
  1. <!-- THIS PANEL CONTROLS THE LINEUP PANEL IN GAME -->
  2. <panel>
  3.         <!-- BOTTOM EXTEND USED TO MAKE SPACE FOR COMMENTARY PANEL -->
  4.         <attachment_group class="vertical_arrange" vertical_alignment="bottom,extend" />
  5.         <boolean id="continue_when_done" value="true" />
  6.         <boolean id="show_on_timer" value="true" />

  7.         <!-- CENTRES PANEL -->
  8.         <container>
  9.                 <layout class="centre_in_parent_attachment" alignment="all" apply_to_children="true" />


  10.                 <!-- HOME TEAM -->
  11.                 <container width="1260" id="hwIN" height="600" class="main_box" appearance="tcs/matchday/epl/lineups/pitch">
  12.                         <layout class="stick_to_sides_attachment" apply_to_children="true"/>

  13.                         <animation class="fade_animation" trigger_id="hidden" trigger_value="false" start_value="0.0" end_value="1.0" duration="0.2">
  14.                                 <record id="finished_event">
  15.                                         <flags id="event_id" value="hoAn" />
  16.                                         <flags id="event_target" value="hwIN" />
  17.                                 </record>
  18.                         </animation>

  19.                         <animation class="fade_animation" trigger_start="hoAn" trigger_value="false" start_value="1.0" end_value="1.0" duration="6">
  20.                                 <record id="finished_event">
  21.                                         <flags id="event_id" value="hiAn" />
  22.                                         <flags id="event_target" value="hwIN" />
  23.                                 </record>
  24.                         </animation>

  25.                         <animation class="fade_animation" trigger_start="hiAn" trigger_value="false" start_value="1.0" end_value="0.0" duration="1.5">
  26.                                 <record id="finished_event">
  27.                                         <flags id="event_id" value="HtAf" />
  28.                                 </record>
  29.                         </animation>


  30.                         <!-- ANOTHER CONTAINER FOR IDs -->
  31.                         <container id="htbx">
  32.                                 <layout class="horizontal_arrange" horizontal_layout="373,-1" horizontal_gap="0" />       
  33.                                 <!-- SUBS BENCH -->
  34.                                 <container class="bordered_box" appearance="tcs/matchday/epl/lineups/pitch-red">
  35.                                         <layout class="stick_to_sides_attachment" alignment="all" inset="0" apply_to_children="true"/>
  36.                                         <record id="object_property">
  37.                                                 <integer id="get_property" value="BGHT" />
  38.                                                 <integer id="set_property" value="red_replacement" />
  39.                                         </record>
  40.                                         <!-- THIS ANIMATION BRINGS THE SUBS BENCH IN
  41.                                         <animation class="scale_animation" start_value="0, 1" end_value="1, 1" duration="0.2" delay="2.4" end_mode="hold_auto_reverse" tween="ease_out_4" coord_mode="relative_to_target" trigger_id="hidden" trigger_start="false" trigger_end="true" centre_point="top" no_clipping="true" /> -->

  42.                                         <!-- CLIENT OBJECT VIEWER USED TO CALL IN WIDGETS -->
  43.                                         <container class="client_object_viewer_xml_panel">
  44.                                                 <attachment_group class="vertical_arrange" vertical_alignment="top,extend" vertical_gap="0"/>

  45.                                                 <!-- SETS WHICH TEAM SHOULD BE LOADED -->
  46.                                                 <record id="object_property" get_property="home" set_property="objt" />                                               

  47.                                                 <container height="180" class="main_box">
  48.                                                         <layout class="stick_to_sides_attachment" apply_to_children="true"/>

  49.                                                         <!-- TEAM LOGO -->
  50.                                                         <widget class="object_portrait_picture" scale_picture="true" height="120">
  51.                                                                 <boolean id="keep_aspect_ratio" value="true" />
  52.                                                                 <flags id="image_alignment" value="centre,centre_y" />
  53.                                                                 <record id="object_property">
  54.                                                                         <integer id="get_property" value="objt" />
  55.                                                                         <integer id="set_property" value="objt" />
  56.                                                                 </record>
  57.                                                         </widget>
  58.                                                 </container>

  59.                                                 <container height="30" class="bordered_box">
  60.                                                         <layout class="stick_to_sides_attachment" alignment="all" inset="0,70,8,0" apply_to_children="true" />
  61.                                                         <record id="default_properties" alignment="left,centre_y" disable_link="true" size="large" style="semi_bold"/>
  62.                                                         <animation class="translate_animation" trigger_id="hidden" trigger_value="false" start_value="-1,0" end_value="0,0" duration="0.7" delay="1" end_mode="hold_end" tween="ease_out" coord_mode="relative_to_screen" apply_to_mouse="false" />
  63.                                                         <widget class="text" text="主教练"/>
  64.                                                         <!-- 我在这里尝试用 get_property txHT set_property colour 的语句,但是不生效 -->
  65.                                                 </container>

  66.                                                 <container height="30" class="bordered_box">
  67.                                                         <layout class="stick_to_sides_attachment" alignment="all" inset="0,70,8,0" apply_to_children="true" />
  68.                                                         <record id="default_properties" alignment="left,centre_y" disable_link="true" size="large" style="semi_bold"/>
  69.                                                         <animation class="translate_animation" trigger_id="hidden" trigger_value="false" start_value="-1,0" end_value="0,0" duration="0.7" delay="1" end_mode="hold_end" tween="ease_out" coord_mode="relative_to_screen" apply_to_mouse="false" />
  70.                                                         <record id="object_property" get_property="home" set_property="objt" />       
  71.                                                         <!-- MANAGER NAME -->
  72.                                                         <widget class="person_button" auto_size="vertical" >
  73.                                                                 <string id="format" value="[%person#1]" />
  74.                                                                 <record id="object_property">
  75.                                                                         <list id="get_properties">
  76.                                                                                 <record id="object_property">
  77.                                                                                         <integer id="get_property" value="ttbw" />
  78.                                                                                         <integer id="set_property" value="white" />
  79.                                                                                 </record>
  80.                                                                                 <record id="object_property">
  81.                                                                                         <integer id="get_property" value="TMnR" />
  82.                                                                                         <integer id="set_property" value="value" />
  83.                                                                                 </record>
  84.                                                                         </list>
  85.                                                                 </record>
  86.                                                         </widget>
  87.                                                 </container>

  88.                                                 <widget class="spacer" height="20" />

  89.                                                 <!-- SUBS BENCH -->
  90.                                                 <container>
  91.                                                         <layout class="stick_to_sides_attachment" alignment="all" inset="0,70,8,0" apply_to_children="true" />

  92.                                                         <container>
  93.                                                                 <!-- 替补席引用的文件 -->
  94.                                                                 <layout class="stick_to_sides_attachment" alignment="all" inset="0" apply_to_children="true" />
  95.                                                                 <widget class="subs_bench_panel" id="hsub" file="tactics/subs bench panel match preview lineups" />
  96.                                                         </container>
  97.                                                 </container>
  98.                                         </container>
  99.                                 </container>               

  100.                                 <!-- PITCH -->
  101.                                 <container id="hpco" class="main_box" >
  102.                                         <attachment_group class="vertical_arrange" vertical_alignment="top,extend" vertical_gap="0"/>

  103.                                         <container>
  104.                                                 <layout class="stick_to_sides_attachment" alignment="all" inset="0,0,0,0" apply_to_children="true" />

  105.                                                 <!-- THIS ANIMATION STRETCHES THE PITCH FROM THE CENTRE POINT -->
  106.                                                 <animation class="fade_animation" start_value="0" end_value="1" duration="1.5" delay="1" end_mode="hold_auto_reverse" trigger_id="hidden" trigger_start="false" trigger_end="true" />

  107.                                                 <container>
  108.                                                         <layout class="stick_to_sides_attachment" apply_to_children="true"/>
  109.                                                         <animation class="fade_animation" start_value="0" end_value="1" duration="0.4" delay="1,7" end_mode="hold_auto_reverse" trigger_id="hidden" trigger_start="false" trigger_end="true" />

  110.                                                         <!-- 阵型图引用的文件 -->
  111.                                                         <widget class="pitch_with_tactics" id="hpwt" vertical="true" icon_flags="disable_name_colour,dont_colour_number, show_name,show_number,colour_names_for_team,show_captain,dont_fade_icons,dont_show_team_names,show_preview_info_popup,drop_initial_if_possible,disable_name_links,dont_allow_player_links" player_icon_file="tactics/tactics icon preview info panel" pitch_perspective="0.5" pitch_line_colour="white">
  112.                                                                 <boolean id="pitch_draw_lines" value="false" />
  113.                                                                 <boolean id="pitch_draw_grass" value="false" />
  114.                                                                 <integer id="pitch_vertical_padding" value="8" />
  115.                                                                 <flags id="pitch_alignment" value="can_scale" />
  116.                                                         </widget>
  117.                                                 </container>
  118.                                         </container>

  119.                                 </container>
  120.                         </container>
  121.                 </container>
  122.         </container>
  123. </panel>
复制代码


tactics icon preview info panel.xml
  1. <panel>
  2.         <layout class="arrange_vertical_attachment" layout="-1,25" offset="0" gap="0"/>
  3.         <layout class="stick_to_sides_attachment" alignment="horizontal" inset="0" apply_to_children="true"/>

  4.         <!-- Player picture -->
  5.         <!-- 这个框是我后来加的,我希望是卡片效果,带上球队球衣颜色的背景色 -->
  6.         <container height="30" class="main_box" appearance="tcs/boxes/nomargin">
  7.                 <widget class="object_portrait_picture" id="pict" scale_picture="true" image_alignment="centre_x,bottom">

  8.                 <animation class="translate_animation" trigger_id="hidden" trigger_value="false" start_value="0,1" end_value="0,0" duration="0.5" delay="1.7" end_mode="hold_end" tween="ease_out" coord_mode="relative_to_screen" apply_to_mouse="false" />
  9.                         <layout class="stick_to_sides_attachment" alignment="vertical" inset="0"/>
  10.                         <layout class="stick_to_sides_attachment" alignment="horizontal" inset="0"/>

  11.                         <record id="object_property">
  12.                                 <integer id="get_property" value="objt"/>
  13.                                 <integer id="set_property" value="objt"/>
  14.                         </record>
  15.                 </widget>
  16.         </container>

  17.         <!-- Name -->
  18.         <container height="30" class="main_box">
  19.                 <animation class="translate_animation" trigger_id="hidden" trigger_value="false" start_value="0,-1" end_value="0,0" duration="0.7" delay="1.2" end_mode="hold_end" tween="ease_out" coord_mode="relative_to_screen" apply_to_mouse="false" />
  20.                 <attachment_group class="horizontal_arrange" horizontal_alignment="middle" horizontal_offset="0" vertical_offset="0" />

  21.                 <record id="default_properties" auto_size="horizontal" font="matchb" alignment="centre" colour="epl purple"/>

  22.                 <widget class="label" id="bsnm" font="bundesliga">
  23.                         <animation class="scale_animation" start_value="0, 1" end_value="1, 1" duration="0.2" delay="1,2" end_mode="hold_auto_reverse" tween="ease_out_4" coord_mode="relative_to_target" trigger_id="hidden" trigger_start="false" trigger_end="true" centre_point="0.5,0.5" no_clipping="true" />
  24.                 </widget>               
  25.                        
  26.                 <widget class="label" id="name" alignment="centre,can_scale" multiline="false" >
  27.                         <animation class="scale_animation" start_value="0, 1" end_value="1, 1" duration="0.2" delay="1,2" end_mode="hold_auto_reverse" tween="ease_out_4" coord_mode="relative_to_target" trigger_id="hidden" trigger_start="false" trigger_end="true" centre_point="0.5,0.5" no_clipping="true" />
  28.                 </widget>

  29.         </container>
  30. </panel>
复制代码

发表于 2025-11-8 21:12 | 显示全部楼层
primary是背景色,secondary是前景色。但你这里提供的代码和信息不够多,不知道你具体想干什么
发表于 2025-11-8 21:20 | 显示全部楼层
  1.                 <!-- Foreground Colour -->
  2.                 <record>
  3.                         <integer id="id" value="ksfg" />
  4.                         <integer id="width" value="130" />
  5.                         <translation id="name" translation_id="293520" type="use" value="Foreground" />

  6.                         <record id="widget_edit_info">
  7.                                 <symbol id="class" value="popup_colour_button" />
  8.                                 <record id="colour_selected_event" event_id="CDBd" event_flags="2" />
  9.                         </record>
  10.                 </record>

  11.                 <!-- Background Colour -->
  12.                 <record>
  13.                         <integer id="id" value="ksbg" />
  14.                         <integer id="width" value="130" />
  15.                         <translation id="name" translation_id="293521" type="use" value="Background" />

  16.                         <record id="widget_edit_info">
  17.                                 <symbol id="class" value="popup_colour_button" />
  18.                                 <record id="colour_selected_event" event_id="CDBd" event_flags="2" />
  19.                         </record>
  20.                 </record>
复制代码


kit properties.xml


  1.                 <record>
  2.                         <integer id="id" value="ttcl" />
  3.                         <integer id="width" value="90" />
  4.                         <translation id="name" translation_id="292688" type="use" value="Foreground Colour" />
  5.                         <translation id="hint" translation_id="345232" type="use" value="The primary text colour of the competition's title bar[COMMENT: editor hint text]" />
  6.                         <record id="widget_edit_info">
  7.                                 <symbol id="class" value="popup_colour_button" />
  8.                                 <record id="colour_selected_event" event_id="CDBd" event_flags="2" />
  9.                         </record>
  10.                 </record>

  11.                 <record>
  12.                         <integer id="id" value="tbcl" />
  13.                         <integer id="width" value="90" />
  14.                         <translation id="name" translation_id="292689" type="use" value="Background Colour" />
  15.                         <translation id="hint" translation_id="345231" type="use" value="The primary background colour of the competition's title bar[COMMENT: editor hint text]" />
  16.                         <record id="widget_edit_info">
  17.                                 <symbol id="class" value="popup_colour_button" />
  18.                                 <record id="colour_selected_event" event_id="CDBd" event_flags="2" />
  19.                         </record>
  20.                 </record>
复制代码


club properties.xml

ksfg或者ttcl  感觉不能直接用 应该是球队→主场球衣→颜色 要引用的
 楼主| 发表于 2025-11-13 19:12 | 显示全部楼层

兄弟你说的引用是啥意思?

我现在遇到另一个问题,大概就是想用这段代码给一段文字设置颜色,但是发现把这段代码放在不同的container里会有不同的效果,有时候可以生效有时候不行。

<widget class="text" text="xxxx">
    <record id="object_property">
        <integer id="get_property" value="txHT" />
        <integer id="set_property" value="colour" />
    </record>
</widget>
 楼主| 发表于 2025-11-13 22:32 | 显示全部楼层
aaronjenny 发表于 2025-11-8 21:12
primary是背景色,secondary是前景色。但你这里提供的代码和信息不够多,不知道你具体想干什么

兄弟我主贴的问题更新了一下,能再帮看下不
 楼主| 发表于 2025-11-13 22:33 | 显示全部楼层

兄弟我主贴的问题更新了一下,能再帮看下不

点评

看到喽 明天我来看下  发表于 2025-11-14 00:03
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|Archiver|爆棚小组 PlayGM论坛

GMT+8, 2025-11-14 08:09 , Processed in 0.026835 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表