Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ This page lists all the individual contributions to the project by their author.
- Disable `DamageSound` for buildings
- Power plant damage factor
- **FS-21**:
- Interactive mission selection screen
- Dump Object Info enhancements
- `Powered.KillSpawns`
- `Spawner.LimitRange`
Expand Down
2 changes: 2 additions & 0 deletions Phobos.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<ClCompile Include="src\Misc\Hooks.Timers.cpp" />
<ClCompile Include="src\Misc\Hooks.UI.cpp" />
<ClCompile Include="src\Misc\Hooks.VeinholeMonster.cpp" />
<ClCompile Include="src\Misc\MapSelectionClass.cpp" />
<ClCompile Include="src\Misc\MessageColumn.cpp" />
<ClCompile Include="src\Misc\PhobosToolTip.cpp" />
<ClCompile Include="src\Misc\RetryDialog.cpp" />
Expand Down Expand Up @@ -396,6 +397,7 @@
<ClInclude Include="src\Misc\ExceptionHandler.h" />
<ClInclude Include="src\Misc\ExceptionHandler.Resource.h" />
<ClInclude Include="src\Misc\FlyingStrings.h" />
<ClInclude Include="src\Misc\MapSelectionClass.h" />
<ClInclude Include="src\Misc\MessageColumn.h" />
<ClInclude Include="src\Misc\PhobosToolTip.h" />
<ClInclude Include="src\Misc\SyncLogging.h" />
Expand Down
119 changes: 119 additions & 0 deletions docs/User-Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,125 @@ In `uimd.ini`:
DisableEmptySpawnPositions=false ; boolean
```

## Mission selection screen

- In vanilla Yuri's Revenge, branching campaign progression was disabled and skipped. Now you can use the Tiberian Sun interactive mission selection screen between campaign missions with full support for territory hover zones, mission briefings, voiceovers, video cutscenes, overlay animations, target cursors, and soundtrack themes.
- Configuration is read from `mapselmd.ini`.
- `[Sides]` and faction sections map the player's side/house to campaign stages.
- Each stage section defines the map background, videos, animations, target coordinates, sounds, and selectable mission choices.
- `MapVQ` specifies the introductory cutscene movie or video background.
- `Map` specifies an optional static background SHP image.
- `MapPCX` specifies an optional static background PCX image (taking precedence over `Map`).
- `Palette` specifies the palette used for UI rendering and animations (defaults to `mapsel.pal`).
- `OverlayPalette` specifies the palette used for territory overlay rendering (defaults to `msovrly.pal`).
- `Overlays` specifies a comma-separated list of territory overlay SHP files that sweep into the map after the intro video.
- `OverlaysPCX` specifies a comma-separated list of PCX overlay files (taking precedence over `Overlays`).
- `Targets` defines the count and (X,Y) coordinates of animated mission target crosshairs on the map.
- `TargetFlyInAnim` specifies the target zoom-in SHP animation (defaults to `TARGET1.SHP`).
- `TargetFlyInAnimPCX` specifies a base PCX filename for the target zoom-in animation (declaring `TARGET1.PCX` or `TARGET1 0000.PCX` automatically loads the sequence of frame files `TARGET1 0000.PCX`, `TARGET1 0001.PCX`, etc., taking precedence over `TargetFlyInAnim`).
- `TargetMarkerAnim` specifies the target crosshair marker SHP animation (defaults to `TARGET2.SHP`). The first half of the file's total frames are looped while the target is in idle state, and the second half of the frames are looped while the cursor hovers over the corresponding region.
- `TargetMarkerAnimPCX` specifies a base PCX filename for the target crosshair marker animation (declaring `TARGET2.PCX` or `TARGET2 0000.PCX` automatically loads the sequence of frame files `TARGET2 0000.PCX`, `TARGET2 0001.PCX`, etc., taking precedence over `TargetMarkerAnim`). Just like the SHP version, the first half of frames are looped in idle and the second half in hover.
- `Anim<N>` defines stage-specific decorative SHP animations (`<file.shp>,<x>,<y>,<delay>[,<palette.pal>]`) on the map interface (logos, radar sweeps, spinning globes, beacons). An optional custom palette filename can be provided (defaulting to `Palette`).
- `[Anims]` defines global SHP animations shared across all stages (`<index>=<file.shp>,<x>,<y>,<delay>[,<palette.pal>]`). An optional custom palette filename can be provided (defaulting to `Palette`).
- `[Anims<SideIndex>]` / `[Anims<SideName>]` defines side-specific global SHP animations (which can also be referenced via `Anims=` under `[SOMESIDE]`, or declared directly as `Anim<N>` inside `[SOMESIDE]`).
- `[AnimsPCX]` defines global multi-frame PCX animations shared across all stages (`<index>=<base.pcx>,<x>,<y>,<delay>`).
- `[Anims<SideIndex>PCX]` / `[Anims<SideName>PCX]` defines side-specific global multi-frame PCX animations (which can also be referenced via `AnimsPCX=` under `[SOMESIDE]`, or declared directly as `Anim<N>PCX` inside `[SOMESIDE]`).
- `ClickMap` specifies an 8-bit indexed 256-color PCX mask image. Color indices `0` and `255` represent non-clickable background areas (oceans, borders, or transparent zones), while palette color indices `1` through `254` represent clickable territory zones (referenced by `<mask's color index>=`).
- `<mask's color index>=<StageName>` binds a palette color index from the `ClickMap` PCX to a mission choice section (e.g. `3=NODB03` and `4=NODA03`). When the player hovers over pixels painted with palette color index `3`, the game highlights and displays the briefing for `[NODB03]`, and launches its scenario upon clicking. Up to 254 unique clickable territory zones per screen are supported.
- `Sounds` specifies an external sound configuration section (e.g. `Sounds=GDISFX` or `Sounds=NODSFX`). This allows centralizing and sharing a common sound palette across multiple stages or sides instead of repeating audio tags in every stage section. Individual stages can still override any sound locally.
- `[Sounds]` defines optional global sound effects shared across all sides.
- `[Sounds<SideIndex>]` / `[Sounds<SideName>]` defines optional side-specific global sound effects (e.g. `[Sounds0]` or `[SoundsGDI]`).
- All sound tags support an optional volume percentage suffix: `<sound_name_or_file>[,<volume_percent>]` (e.g. `BESTBOX.WAV,75` or `EFFICIEN.WAV,40`). Volume defaults to 100% if omitted.
- Sound tags accept either a sound entry ID from `soundmd.ini` or a direct WAV filename (from disk or `.MIX` archives). Specifying an explicit `.wav` extension prioritizes searching for the standalone audio file, whereas omitting the extension prioritizes looking up the sound ID in `soundmd.ini` (falling back to `<name>.wav` if not found).
- `VoiceOver` defines the spoken audio brief played when hovering over a mission choice (supports WAV filename or sound ID, with optional volume).
- `EnterRegion` defines the sound played when entering/hovering over a territory.
- `ClickRegion` defines the sound played when confirming a mission selection.
- `Overlay` defines the sound played during the territory overlay sweep.
- `TargetFlyIn` defines the sound played during target crosshair zoom-in animation.
- `ExitRegion` defines the sound played when cursor exits a territory.
- `MouseOnMapSound` / `MouseOffMapSound` defines sounds played when cursor enters or leaves the map window.
- `Theme` specifies an optional soundtrack theme played during map selection (silent by default unless specified).
- `TypeSound` specifies the typing sound effect from `soundmd.ini` (e.g. `TypeSound=TextBleep` or `TypeSound=none` to disable; defaults to `TextBleep`).
- `TextColor` specifies the text color (`R,G,B`) for the mission briefing (defaults to the active side's `MessageTextColor` in `rulesmd.ini`, or the country's `Color` scheme, falling back to white).
- `TextRect` specifies an optional custom bounding rectangle (`<x>,<y>,<width>,<height>`) for the mission briefing text, relative to the map window (defaults to `92,322,332,78` matching Tiberian Sun's HUD plate).
- `Description` specifies the CSF string key or text for the mission briefing, displayed in the metallic briefing panel with automatic multi-line word wrapping and typewriter animation.

In `mapselmd.ini`:
```ini
[Sides]
<index>= ; Side

[SOMESIDE] ; Side
<index>= ; Stage
Sounds= ; Section name
Anims= ; Section name
AnimsPCX= ; Section name
Anim<N>= ; Animation SHP (file.shp,x,y,delay[,palette.pal])
Anim<N>PCX= ; Animation PCX (base.pcx,x,y,delay)

[Sounds] ; Optional global sound effects for all sides
TargetFlyIn= ; Sound ID or WAV filename[,volume]
Overlay= ; Sound ID or WAV filename[,volume]
EnterRegion= ; Sound ID or WAV filename[,volume]
ExitRegion= ; Sound ID or WAV filename[,volume]
ClickRegion= ; Sound ID or WAV filename[,volume]
MouseOnMapSound= ; Sound ID or WAV filename[,volume]
MouseOffMapSound= ; Sound ID or WAV filename[,volume]
TypeSound= ; Sound ID or WAV filename[,volume]

[Sounds<SideIndex>] ; Optional global sound effects for a specific side
TargetFlyIn= ; Sound ID or WAV filename[,volume]
Overlay= ; Sound ID or WAV filename[,volume]
EnterRegion= ; Sound ID or WAV filename[,volume]
ExitRegion= ; Sound ID or WAV filename[,volume]
ClickRegion= ; Sound ID or WAV filename[,volume]

[SOMESTAGE] ; Stage
Scenario= ; Scenario filename
Description= ; CSF label or text
Map= ; SHP filename
MapPCX= ; PCX filename
Palette=mapsel.pal ; Palette filename
OverlayPalette=msovrly.pal ; Palette filename
MapVQ= ; video filename
Overlays= ; list of SHP filenames
OverlaysPCX= ; list of PCX filenames
Targets= ; integer, point list
TargetFlyInAnim=TARGET1.SHP ; SHP filename
TargetFlyInAnimPCX= ; PCX filename
TargetMarkerAnim=TARGET2.SHP ; SHP filename
TargetMarkerAnimPCX= ; PCX filename
ClickMap= ; PCX filename
Theme= ; Soundtrack theme ID
Sounds= ; Section name
VoiceOver= ; Sound ID or WAV filename[,volume]
Overlay= ; Sound ID or WAV filename[,volume]
TargetFlyIn= ; Sound ID or WAV filename[,volume]
EnterRegion= ; Sound ID or WAV filename[,volume]
ClickRegion= ; Sound ID or WAV filename[,volume]
ExitRegion= ; Sound ID or WAV filename[,volume]
MouseOnMapSound= ; Sound ID or WAV filename[,volume]
MouseOffMapSound= ; Sound ID or WAV filename[,volume]
TypeSound= ; Sound ID or WAV filename[,volume]
TextColor=<side MessageTextColor/Color> ; ColorStruct (R,G,B)
TextRect=92,322,332,78 ; Rectangle (x,y,width,height)
Anim<N>= ; Animation SHP (file.shp,x,y,delay[,palette.pal])
Anim<N>PCX= ; Animation PCX (base.pcx,x,y,delay)
<mask's color index>= ; Choice Stage

[Anims] ; Optional global SHP animations for all sides
<index>= ; Animation SHP (file.shp,x,y,delay[,palette.pal])

[Anims<SideIndex>] ; Optional global SHP animations for a specific side
<index>= ; Animation SHP (file.shp,x,y,delay[,palette.pal])

[AnimsPCX] ; Optional global PCX animations for all sides
<index>= ; Animation PCX (base.pcx,x,y,delay)

[Anims<SideIndex>PCX] ; Optional global PCX animations for a specific side
<index>= ; Animation PCX (base.pcx,x,y,delay)
```

## Miscellanous

### Skip saving game on starting a new campaign
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ HideShakeEffects=false ; boolean
- [Modify ammo on impact](New-or-Enhanced-Logics.md#modify-ammo-on-impact) (by FS-21)
- [Customize ivan bomb visibility](Fixed-or-Improved-Logics.md#customize-ivan-bomb-visibility) (by NetsuNegi)
- [Customize whether mind-controlled `Insignificant` technos can be auto-targeted](Fixed-or-Improved-Logics.md#customize-whether-mind-controlled-insignificant-technos-can-be-auto-targeted) (by Noble_Fish)
- [Mission selection screen](User-Interface.md#mission-selection-screen) (by FS-21)
- [AutoDeath based on player power status and player credits](New-or-Enhanced-Logics.md#kill-object-automatically) (by Flactine)
- [Roof production anim](New-or-Enhanced-Logics.md#roof-production-anim) (by Noble_Fish)
- [Customize whether the unit exits from the roof](Fixed-or-Improved-Logics.md#customize-whether-the-unit-exits-from-the-roof) (by Noble_Fish)
Expand Down
20 changes: 18 additions & 2 deletions src/Ext/Scenario/Hooks.Variables.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "Body.h"
#include <Misc/MapSelectionClass.h>

DEFINE_HOOK(0x689910, ScenarioClass_SetLocalToByID, 0x5)
{
Expand Down Expand Up @@ -183,8 +184,23 @@ static bool __fastcall MapSelectClass_SetNextScenario_CustomMission(MapSelectCla
return false;
}

// Return to the original function.
return pThis->SetNextScenario(pItem);
// Try opening our interactive Map Selection Screen if SkipMapSelect is false
if (MapSelectionClass::OpenMapSelectionWindow(pItem))
{
return true;
}

// Safe fallback to NextScenario if map selection was cancelled or empty (prevents crashing on dead vanilla code)
const char* nextScenario = (pItem->NextScenario && pItem->NextScenario[0]) ? pItem->NextScenario : pItem->FileName;
if (nextScenario && nextScenario[0])
{
pItem->Stage = 0;
strncpy(pItem->FileName, nextScenario, 0x104u);
pItem->FileName[259] = '\0';
return true;
}

return false;
}

DEFINE_JUMP(LJMP, 0x685A38, 0x685A63) // Skip the original code
Expand Down
Loading
Loading