giggsxbr 发表于 2025-11-8 16:30

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

本帖最后由 giggsxbr 于 2025-11-14 09:14 编辑

我的诉求是在FM24上面搞一个英超风格的开场画面,现在是这个效果

但有几个问题
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
<!-- THIS PANEL CONTROLS THE LINEUP PANEL IN GAME -->
<panel>
        <!-- BOTTOM EXTEND USED TO MAKE SPACE FOR COMMENTARY PANEL -->
        <attachment_group class="vertical_arrange" vertical_alignment="bottom,extend" />
        <boolean id="continue_when_done" value="true" />
        <boolean id="show_on_timer" value="true" />

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


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

                        <animation class="fade_animation" trigger_id="hidden" trigger_value="false" start_value="0.0" end_value="1.0" duration="0.2">
                                <record id="finished_event">
                                        <flags id="event_id" value="hoAn" />
                                        <flags id="event_target" value="hwIN" />
                                </record>
                        </animation>

                        <animation class="fade_animation" trigger_start="hoAn" trigger_value="false" start_value="1.0" end_value="1.0" duration="6">
                                <record id="finished_event">
                                        <flags id="event_id" value="hiAn" />
                                        <flags id="event_target" value="hwIN" />
                                </record>
                        </animation>

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


                        <!-- ANOTHER CONTAINER FOR IDs -->
                        <container id="htbx">
                                <layout class="horizontal_arrange" horizontal_layout="373,-1" horizontal_gap="0" />       
                                <!-- SUBS BENCH -->
                                <container class="bordered_box" appearance="tcs/matchday/epl/lineups/pitch-red">
                                        <layout class="stick_to_sides_attachment" alignment="all" inset="0" apply_to_children="true"/>
                                        <record id="object_property">
                                                <integer id="get_property" value="BGHT" />
                                                <integer id="set_property" value="red_replacement" />
                                        </record>
                                        <!-- THIS ANIMATION BRINGS THE SUBS BENCH IN
                                        <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" /> -->

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

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

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

                                                        <!-- TEAM LOGO -->
                                                        <widget class="object_portrait_picture" scale_picture="true" height="120">
                                                                <boolean id="keep_aspect_ratio" value="true" />
                                                                <flags id="image_alignment" value="centre,centre_y" />
                                                                <record id="object_property">
                                                                        <integer id="get_property" value="objt" />
                                                                        <integer id="set_property" value="objt" />
                                                                </record>
                                                        </widget>
                                                </container>

                                                <container height="30" class="bordered_box">
                                                        <layout class="stick_to_sides_attachment" alignment="all" inset="0,70,8,0" apply_to_children="true" />
                                                        <record id="default_properties" alignment="left,centre_y" disable_link="true" size="large" style="semi_bold"/>
                                                        <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" />
                                                        <widget class="text" text="主教练"/>
                                                        <!-- 我在这里尝试用 get_property txHT set_property colour 的语句,但是不生效 -->
                                                </container>

                                                <container height="30" class="bordered_box">
                                                        <layout class="stick_to_sides_attachment" alignment="all" inset="0,70,8,0" apply_to_children="true" />
                                                        <record id="default_properties" alignment="left,centre_y" disable_link="true" size="large" style="semi_bold"/>
                                                        <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" />
                                                        <record id="object_property" get_property="home" set_property="objt" />       
                                                        <!-- MANAGER NAME -->
                                                        <widget class="person_button" auto_size="vertical" >
                                                                <string id="format" value="[%person#1]" />
                                                                <record id="object_property">
                                                                        <list id="get_properties">
                                                                                <record id="object_property">
                                                                                        <integer id="get_property" value="ttbw" />
                                                                                        <integer id="set_property" value="white" />
                                                                                </record>
                                                                                <record id="object_property">
                                                                                        <integer id="get_property" value="TMnR" />
                                                                                        <integer id="set_property" value="value" />
                                                                                </record>
                                                                        </list>
                                                                </record>
                                                        </widget>
                                                </container>

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

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

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

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

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

                                                <!-- THIS ANIMATION STRETCHES THE PITCH FROM THE CENTRE POINT -->
                                                <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" />

                                                <container>
                                                        <layout class="stick_to_sides_attachment" apply_to_children="true"/>
                                                        <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" />

                                                        <!-- 阵型图引用的文件 -->
                                                        <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">
                                                                <boolean id="pitch_draw_lines" value="false" />
                                                                <boolean id="pitch_draw_grass" value="false" />
                                                                <integer id="pitch_vertical_padding" value="8" />
                                                                <flags id="pitch_alignment" value="can_scale" />
                                                        </widget>
                                                </container>
                                        </container>

                                </container>
                        </container>
                </container>
        </container>
</panel>

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

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

                <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" />
                        <layout class="stick_to_sides_attachment" alignment="vertical" inset="0"/>
                        <layout class="stick_to_sides_attachment" alignment="horizontal" inset="0"/>

                        <record id="object_property">
                                <integer id="get_property" value="objt"/>
                                <integer id="set_property" value="objt"/>
                        </record>
                </widget>
        </container>

        <!-- Name -->
        <container height="30" class="main_box">
                <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" />
                <attachment_group class="horizontal_arrange" horizontal_alignment="middle" horizontal_offset="0" vertical_offset="0" />

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

                <widget class="label" id="bsnm" font="bundesliga">
                        <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" />
                </widget>               
                       
                <widget class="label" id="name" alignment="centre,can_scale" multiline="false" >
                        <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" />
                </widget>

        </container>
</panel>

aaronjenny 发表于 2025-11-8 21:12

primary是背景色,secondary是前景色。但你这里提供的代码和信息不够多,不知道你具体想干什么

crushw 发表于 2025-11-8 21:20

                <!-- Foreground Colour -->
                <record>
                        <integer id="id" value="ksfg" />
                        <integer id="width" value="130" />
                        <translation id="name" translation_id="293520" type="use" value="Foreground" />

                        <record id="widget_edit_info">
                                <symbol id="class" value="popup_colour_button" />
                                <record id="colour_selected_event" event_id="CDBd" event_flags="2" />
                        </record>
                </record>

                <!-- Background Colour -->
                <record>
                        <integer id="id" value="ksbg" />
                        <integer id="width" value="130" />
                        <translation id="name" translation_id="293521" type="use" value="Background" />

                        <record id="widget_edit_info">
                                <symbol id="class" value="popup_colour_button" />
                                <record id="colour_selected_event" event_id="CDBd" event_flags="2" />
                        </record>
                </record>

kit properties.xml


                <record>
                        <integer id="id" value="ttcl" />
                        <integer id="width" value="90" />
                        <translation id="name" translation_id="292688" type="use" value="Foreground Colour" />
                        <translation id="hint" translation_id="345232" type="use" value="The primary text colour of the competition's title bar" />
                        <record id="widget_edit_info">
                                <symbol id="class" value="popup_colour_button" />
                                <record id="colour_selected_event" event_id="CDBd" event_flags="2" />
                        </record>
                </record>

                <record>
                        <integer id="id" value="tbcl" />
                        <integer id="width" value="90" />
                        <translation id="name" translation_id="292689" type="use" value="Background Colour" />
                        <translation id="hint" translation_id="345231" type="use" value="The primary background colour of the competition's title bar" />
                        <record id="widget_edit_info">
                                <symbol id="class" value="popup_colour_button" />
                                <record id="colour_selected_event" event_id="CDBd" event_flags="2" />
                        </record>
                </record>

club properties.xml

ksfg或者ttcl感觉不能直接用 应该是球队→主场球衣→颜色 要引用的

giggsxbr 发表于 2025-11-13 19:12

crushw 发表于 2025-11-8 21:20
kit properties.xml




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

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

<widget class="text" text="xxxx">
    <record id="object_property">
      <integer id="get_property" value="txHT" />
      <integer id="set_property" value="colour" />
    </record>
</widget>

giggsxbr 发表于 2025-11-13 22:32

aaronjenny 发表于 2025-11-8 21:12
primary是背景色,secondary是前景色。但你这里提供的代码和信息不够多,不知道你具体想干什么

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

giggsxbr 发表于 2025-11-13 22:33

crushw 发表于 2025-11-8 21:20
kit properties.xml




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

giggsxbr 发表于 2025-11-16 19:10

crushw 发表于 2025-11-8 21:20
kit properties.xml




兄弟你知道get_property的原理吗?为什么我感觉在有的代码作用域里面能生效,有的却不管用?
页: [1]
查看完整版本: 咨询一下皮肤大佬,怎么让一张图片显示球队球衣的背景/前景颜色?