=======================================================================
  MatchCard v1.3
  A broadcast match-information card, shown just before kick-off
  Sider module for PES 2021 / SP Football Life
=======================================================================

WHAT IT DOES

  A television-style panel appears over the pitch just before kick-off,
  stays ten seconds and fades out. It shows:

    - HOME and AWAY over the two team names
    - The stadium, its city and its country
    - Capacity, kick-off time, weather and temperature
    - Both clubs' badges, which stay on the card and fade with it

  NEW IN 1.3 - THE COMPETITION'S OWN CARD. A league match now wears
  that league's TV broadcast look: each half of the card in the colour
  of the kit that club is wearing, the competition's emblem in the middle where VS used to
  be, and the strips underneath in the league's own colours:

    Premier League, LaLiga, Serie A, Bundesliga, Ligue 1, J1 League
    and the Saudi Pro League - plus their cups, super cups and second
    divisions, which wear their league's card.

  It works in quick matches too: when two clubs from the same league
  meet, the card wears that league. Any other match gets the plain card.

  It sits in the box the game keeps clear for the radar, so it covers
  no football, and it reads your own stadium map: whatever ground your
  pack puts you in is the ground it names.


-----------------------------------------------------------------------
WHERE THE INFORMATION COMES FROM
-----------------------------------------------------------------------

  The mod does not guess anything. It comes with four plain data
  files, in modules\MatchCard\data, that you can open in Excel or in
  Notepad:

    stadiums.txt      every stadium, with its city, country and
                      capacity
    teams.csv         which team belongs to which home ground
    temperatures.txt  the usual match-day temperature per country
    competitions.txt  which competition wears which card

  The club badges, the competition emblems and which clubs play in
  which league need no file of their own: the mod reads the game's
  archives on your machine at startup and finds them there. So they are
  right on any patch, any folder, any drive.

  If something is missing or wrong - a stadium your pack added, a new
  capacity, a club that moved - open the file, fix that one line, save
  it, and press Shift+R in the game. No tools, no rebuilding.


-----------------------------------------------------------------------
INSTALLATION
-----------------------------------------------------------------------

1.  Close the game.

2.  Open this archive. Inside it there is a folder called "modules".

3.  Drag that "modules" folder into your SiderAddons folder. If
    Windows asks, choose Merge. Nothing of yours is replaced - the mod
    only adds its own files. You end up with:

      SiderAddons\modules\MatchCard.lua
      SiderAddons\modules\MatchCard\   (dll, ini, data, fonts)

4.  Open sider.ini with Notepad. Find the lines that start with
    lua.module and add this one at the top of them:

      lua.module = "MatchCard.lua"

    If you use a stadium server, the MatchCard line must sit directly
    above it, like this:

      lua.module = "MatchCard.lua"
      lua.module = "StadiumServer.lua"

    The order matters: the module has to be asked about the stadium
    before the server answers. It never changes the answer - it only
    listens.

5.  Still in sider.ini, check that these three lines are there and set
    to 1. Usually they already are:

      lua.enabled = 1
      luajit.ext.enabled = 1
      match-stats.enabled = 1

    luajit.ext is what lets the module load its drawing layer - without
    it nothing is drawn at all. match-stats is how the module knows the
    match has started - without it the card never appears.

6.  Save the file, start the game and play a match. The card comes up
    just before the kick-off.


UPGRADING FROM 1.2

  Copy the new files over the old ones. Your MatchCard.ini is replaced
  by the new one, so if you changed settings, note them first - or keep
  your old ini and add these two lines to the end of it:

      themes = 1
      log_competition = 0


DID IT LOAD?

  Open SiderAddons\sider.log and look for:

      [MatchCard] v1.3.0 | 7987 grounds | 212 countries | 749 clubs
      [MatchCard] drawing layer: attached

  And in SiderAddons\modules\MatchCard\MatchCard.log:

      competitions: 91 read from the game's own table
      club entries: 1329 read, so a friendly can still find its league

  (Your numbers depend on your patch.) If something is missing the
  module says so by name, rather than failing silently.


-----------------------------------------------------------------------
SETTINGS
-----------------------------------------------------------------------

  Everything is in MatchCard.ini and every line in it is commented.
  The ones people usually change:

      seconds           how long it stays on screen
      fade_in/fade_out  the fades either side
      second_half       1 to show it again after the break, 0 for once
      scale             a multiplier if you want it smaller
      off_x / off_y     nudge it, as a fraction of the screen
      clock_12h         0 for 20:30, 1 for 8:30 PM
      fahrenheit        0 for Celsius, 1 for Fahrenheit
      day_kickoff       the time printed for a day match
      night_kickoff     the time printed for a night match
      crest             1 shows the two club badges, 0 leaves them off
      crest_size        how big a badge is on the card
      themes            1 gives each competition its own card,
                        0 the plain card for every match
      log_competition   1 writes the competition number of every match
                        to sider.log - turn it on when a competition
                        shows the plain card and you want to add it to
                        data\competitions.txt
      debug             1 writes one line per match to sider.log naming
                        every field the card resolved and every one it
                        could not

  Press Shift+R in game to reload after editing.


-----------------------------------------------------------------------
COMPATIBILITY
-----------------------------------------------------------------------

  PES 2021
  SP Football Life 2025
  SP Football Life 2026
  SP Football Life 2027

  The drawing layer attaches to Sider itself rather than to the game
  executable, so the name and version of the exe do not matter.

  MatchCard hooks nothing and patches nothing. It draws from inside
  Sider's own frame, borrows the screen for that one draw and hands it
  straight back, and restores every drawing setting it touched. The
  card itself is painted once per match on a small private off-screen
  device. No file in your installation is modified - no stadium is
  renamed and no database is touched. Remove the two MatchCard entries
  and your install is exactly as it was.

  OTHER MODS THAT DRAW ON SCREEN (Broadcast Lineup and the like): 1.3
  was changed specifically to live beside them - see the changelog.

  The competition cards are drawn in the spirit of each league's
  broadcast graphics, the club colours come from the kits worn in your
  own game, and the emblems are the game's own artwork, read from your
  own install. Nothing of the leagues' is shipped with this
  mod, and it is not affiliated with or endorsed by any league.


-----------------------------------------------------------------------
UNINSTALLING
-----------------------------------------------------------------------

  1. Delete the lua.module = "MatchCard.lua" line from sider.ini.
  2. Delete modules\MatchCard.lua and the modules\MatchCard folder.

  That is all. Nothing else was changed.


-----------------------------------------------------------------------
CHANGELOG
-----------------------------------------------------------------------

  1.3   THE COMPETITION'S OWN CARD.

        Premier League, LaLiga, Serie A, Bundesliga, Ligue 1, J1
        League and the Saudi Pro League each get a card modelled on
        that league's TV broadcast graphics, with the competition's
        emblem in the middle. Their cups, super cups and second
        divisions wear the league's card. Turn it off with themes = 0.

        Each club in its own colours: the two halves of a league card
        are painted in the colours of the kits the two sides actually
        wear in that match - a club in its third strip wears its third
        strip's colour, just as the scoreboard does. If Sider cannot say
        which kit is worn, the club's first strip from your game files
        is used.

        Each league joins the two clubs its own way: the Premier
        League's shards, Serie A's flowing curve, the Bundesliga's red
        square, LaLiga's coral tile, Ligue 1's blue tab between black
        gutters, J1's colours fading into black under sweeping arcs,
        and the Saudi league's neon light trails.

        The plain card (friendlies and any other match) is back to the
        original slate and silver, so it never looks like a league card.

        The badges no longer fly away: they stay on the card and fade
        out with it. They sit on a soft shade with no shape, so a
        national team's rectangular flag fits as well as a club crest.

        FIXED - the team names were never drawn in the mod's own
        condensed font: Windows' default font was quietly used instead,
        ever since 1.0. They are now in the right font.

        FIXED - a few matches between clubs of the same country showed
        no card at all (Leeds v Hull City, for one), because the patch
        files the two clubs under different divisions. They now get
        their country's league card.

        Quick matches too: the game names no competition for a quick
        match, so the mod asks the game's own entry list which league
        the two clubs share - the same way scoreboard and ball servers
        work it out.

        Nothing here is tied to one install: emblem numbers and league
        entries are read from your own game files at startup.

        FIXED - conflicts with other mods that draw on screen, such as
        Broadcast Lineup. Three things MatchCard did were bad manners
        in a shared game:
          - it held on to the screen between frames, which stops the
            game and other mods from resizing it (alt-tab, resolution
            changes);
          - it put back only part of the drawing state it changed, so
            the next mod to draw inherited the rest;
          - it looked for the screen in a way that could touch memory
            belonging to something else.
        All three are fixed.

        FIXED - ".mp3" at the end of team names. Without a kit server
        the mod falls back to the goal-song server's team list, whose
        lines carry a third field; the whole rest of the line was taken
        as the name. Now only the name is taken, and only a real file
        extension is dropped, so names like "1. FC Koln" stay whole.

  1.2   The badges now work on every install.

        1.1 shipped a list of where each badge sits inside the
        archives - and that list was built against one machine. On any
        other game, patch or install the archives are different, so the
        mod refused to read them and you got the card with no badges.

        It no longer ships a list. It reads the archives that are
        actually on your machine, at startup, and finds the badges in
        them. PES 2021 and SP Football Life 2025 / 2026 / 2027, any
        patch, any folder, any drive.

        Upgrading from 1.1: modules\MatchCard\data\flags.idx is no
        longer used and can be deleted.

  1.1   THE TEAM BADGES, AND THEY MOVE.

        Both clubs' crests now sit on the card. When the card fades
        they do not fade with it: they leave it, travel across the
        screen to the small badge beside each team's name and dissolve
        into it.

        The badges come out of the game itself. Nothing is shipped
        with the mod and nothing has to be installed. If you run a
        logo mod its crests are the ones you see, because sider's own
        folders are searched before the game's archives, in the order
        sider reads them.

        Turn them off, resize them, or move where they land, with the
        crest lines in MatchCard.ini.

        Also: the card no longer comes back at the start of the second
        half. It is shown once, before kick-off. Set second_half = 1 in
        MatchCard.ini if you want the old behaviour.

  1.0   First release.
