-----------------------------------------------------------------------------------------------
[Name]            TPDP SoD PvPHubExtension
[Purpose]         PvP menu feature extension for TPDP SoD (+Extended)
[Version]         2.2
[Website]         https://https://xy1.ebb.jp/025
[Author]          くしち (Kushichi) (https://x.com/xyichi)
[Release date]    2026.07.19
[Requirements]    TPDP SoD v1.103 / Extended v3.41 / v4.0 / Battle Overlay
-----------------------------------------------------------------------------------------------


** About This Extension **
This is an unofficial extension MOD that adds features to the PvP menu of
"幻想人形演舞-ユメノカケラ-(Gensou Ningyou Enbu: Yumeno Kakera)
  /Touhou Puppet Dance Performance: Shard of Dreams (TPDP SoD)"
  (http://www.fo-lens.net/enbu_ap/)
and its unofficial extension patch
"TPDP SoD Extended" (http://gensoushinki.com/),
"Battle Overlay" (https://tpdp.miraheze.org/wiki/Mod:Shard_of_Dreams_-_Battle_Overlay).

This functionality, the DLL file, and the changes it makes to other files are
referred to below as "this extension".

This extension is a personal, unofficial work.
Please do not contact the official TPDP SoD developers about issues
related to this extension; doing so only causes them inconvenience.
Please use this extension responsibly, with awareness of its design and consideration
for the wider community.


** Disclaimer **
This extension assumes users with basic familiarity with Windows file operations
and the game's installation path. These topics are not covered in this document.

Performance may degrade depending on PC specifications.
The extension may fail to operate due to PC configuration, specifications,
or bugs within the extension itself.
Even if it works today, future changes to "TPDP SoD", "TPDP SoD Extended",
the operating system, or DirectX may break
compatibility in the future.
The author cannot guarantee operation or provide support for these factors.
Please understand and acknowledge this before use.


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!! BACK UP YOUR ENTIRE TPDP FOLDER BEFORE INSTALLING THIS EXTENSION !!!!!

This extension forcibly intervenes in the game's runtime behavior.
The author has tested it in their own environment, but cannot anticipate every
user environment.
Unexpected issues are entirely possible.
Damage to game executables, files, save data, or replay data cannot be
absolutely guaranteed never to occur.

Please use this extension only after fully understanding and accepting the risks
of forced runtime intervention.
The author bears no responsibility for any damage caused by use of this DLL.

To prepare for the worst case, we strongly recommend backing up the entire
pre-installation environment so that you can revert if necessary.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


** Installation **
If you install Extended or BattleOverlay on a system where PvPHubExtension is already installed,
 PvPHubExtension will be overwritten and its functionality will be lost.
Please install PvPHubExtension after installing Extended or BattleOverlay.

This extension is distributed in installer form.
Run "PvPHubExtension-vX.X-setup.exe" and follow the on-screen instructions.

Main choices:
- Installer display language (jp / en)
- Game environment (SoD / Extended)
- The TPDP installation folder
- Operation (Fresh install / Update / Reinstall / Remove)
- In-game language (jp / en)
- Features to enable
- Random BGM pool (only if you tick "Choose the random BGM pool myself")

The installer automatically performs the following:
- Place "dxgi.dll" in the folder for TPDP SoD if it is not already present.
- Places "PvPHubExtension.dll" into the plugins\ subfolder of TPDP SoD (+Extended)
- Adds a [pvp_hub] section to "TPDPHook.ini" to enable the extension

------------------------------------------------------------------
幻想人形演舞-ユメノカケラ-\ # The folder where TPDP SoD (+Extended) is installed
├gn_enbu.exe
├SoD-Extended-JP.exe    # Existing files/folders may vary by environment
├SoD-Extended-EN.exe
├dxgi.dll               # <--If no existing file exists, it will be placed there
├TPDPHook.ini           # <-- [pvp_hub] section is added here
├...
├dat\
├save\
├...
└plugins\               # <-- installer places the DLL here
 └PvPHubExtension.dll   # placed here
------------------------------------------------------------------

Note: this installer does not register an entry in Windows "Programs and Features"
and does not modify the registry.
To upgrade or remove the extension, run the same installer (".exe") again
and select the desired action on the operation page.
If a previous version of "PvPHubExtension.dll" is detected, the installer
automatically determines whether to offer "Update" or "Reinstall".


** Uninstallation **
Run "PvPHubExtension-vX.X-setup.exe" again and select "Remove PvPHubExtension"
on the operation page.
"PvPHubExtension.dll" and the [pvp_hub] section in "TPDPHook.ini" are deleted
automatically.
If the dxgi.dll file installed by this installer is present, it will also be deleted.

After that, manually delete the following:
"PvPHubExtension-vX.X-setup.exe", "ReadMe_JP.txt", "ReadMe_EN.txt", "LICENSE"


** Verified Environments **
- TPDP SoD ver1.103
- MOD: TPDP SoD Extended ver3.41
- MOD: TPDP SoD Extended ver4.0
- MOD: StyleIconExtension (for Extended)
- MOD: BattleOverlay (for SoD)
- MOD: BattleOverlay (for Extended)

Older versions and the original Touhou Puppet Dance Performance (no subtitle)
,and other MODs have not been tested and are not planned for future support.


** Features and Usage **
After launching the game and opening the PvP menu,
 the features you enabled during installation will be added.

PvP BGM Extension:
The "Random" option will be added to the BGM selection menu.
Selecting it plays a random track from the ones you have heard at least once in-game.
In Extended, you will also be able to select the tracks added by Extended.
These are likewise limited to tracks you have heard at least once in-game.
In Extended, selecting "Vs Butokai Puppeteer" played a different track;
 with this extension, the correct track is played.

Random Selection of PvP BGM:
You can configure which tracks are eligible for the random BGM.
If you turn this feature off during installation,
 all unlocked SoD battle themes become eligible.
It is off on a fresh install, to avoid spoiling track titles.

Specifying the Battle Background:
A new option to select a background image has been added at the bottom of the screen.
You can set the background for battles to the image selected here.
This option is limited to backgrounds that previously appeared randomly.
If you select "Random," the background will appear randomly from the available options.
This behaves the same as the original version.

Replay Subfolder Access:
On the replay selection screen, you can open subfolders directly under save\replay
 and play the replays inside them.

Hide Version Prefix in Replay List:
Hides the "verX.XX " prefix at the head of each row in the replay list. This improves readability when filenames are long.

Auto-capture the Select Screen in Network Battles:
If you have selected "save replays" in the in-game settings,
 the puppet-selection screen in online battles is captured automatically.
The captured screen is saved to the replay folder as a .png with the same name
 as the replay file (.rep).


** Behavior Notes **
With the PvP BGM Extension active, the unlock state of "Vs Butokai Puppeteer"
becomes shared with that of "Vs Yukari Yakumo".
Even if you hear "Vs Butokai Puppeteer" played during gameplay, it cannot be
selected from the menu unless you have also heard "Vs Yukari Yakumo".


** Configuration **
This extension's settings live in the [pvp_hub] section of "TPDPHook.ini".
Since the installer handles this, manual editing is usually not necessary.

Settings:
[pvp_hub]
language          = jp        ; In-game label language
bgm_extension     = true      ; Extend the BGM selection
bgm_random_pool   = 1,2,3...  ; Random BGM pool, specified by number
background_select = true      ; Battle background selection
replay_subfolder  = true      ; Replay subfolder access
replay_hide_ver   = true      ; Hide the replay version prefix
replay_screenshot = true      ; Auto-capture the select screen in network battles

To switch the in-game label language, change "language" to "jp" or "en".
To temporarily disable a feature, change its value from true to false.
The numbers in "bgm_random_pool" are the positions of the tracks as shown in the
BGM selection menu (the first entry is 1).
A game restart is required for changes to take effect.


** Change History **
[ver2.2: 2026.07.19]
- Added the ability to choose which tracks are eligible for the random BGM selection
- Added the ability to play replays inside subfolders on the replay selection screen
- Added an option to hide the version prefix in the replay list
- Added auto-capture of the select screen
- Fixed an issue where the background-select field briefly appeared when starting a battle via match code or IP

[ver1.93: 2026.05.09]
- Fixed a delay in displaying the background selection field when opening the PvP menu

[ver1.6: 2026.05.05]
- Compatible with SoD
- Added a random BGM selection
- Added a Background selection

[ver1.1: 2026.04.26]
- Released exclusively for Extended
- Added a feature to allow selection of songs added in the Extended version


** Credit **
 幻想人形演舞-ユメノカケラ- (Gensou Ningyou Enbu Yume no Kakera
 / Touhou Puppet Dance Performance: Shard of Dreams)
are the works of　the doujin circle FocasLens (http://www.fo-lens.net/)
 / 幻想人形劇団(Gensou Ningyou Gekidan)(https://x.com/gn_gekidan),
and are derivative works of Touhou Project.

"Touhou Puppet Dance Performance: Shard of Dreams" is the unofficial English title.

"Touhou Puppet Dance Performance: Shard of Dreams -Extended-"
(http://gensoushinki.com/index.php?lang=ja) is an unofficial expansion patch
created by Barudo (https://twitter.com/Nukekip) and his team.

"Mod:Shard of Dreams - Battle Overlay
(https://tpdp.miraheze.org/wiki/Mod:Shard_of_Dreams_-_Battle_Overlay)"
is an unofficial expansion patch released by Wower.

This extension is an unofficial creation by くしち (Kushichi) (individual).
Please do NOT contact FocasLens, Gensou Ningyou Gekidan, Barudo's team, Wower
about this tool — it would only cause them trouble.