Navigation
Browse the developer docs

FH2 Mod Platform for .NET

ANNA

Add entries to FH2 ANNA's in-car menu from your mod.

By Bartholomew Ho (qiangqiang101) · MIT license · v0.12.0 · 15 Nov 2026 · repository · original page

On this page

Add entries to ANNA's menu from your mod. ANNA is the in-car assistant from the separate FH2 ANNA mod: press d-pad down while driving to open her menu on the HUD.

Your entries need FH2 ANNA installed (version 4 of its interface or newer). Without it, ANNA.IsAvailable is false and adding entries does nothing. Your mod still runs fine.

Thread: any for IsOpen. Add your entries in OnInit. The code an entry runs when it's chosen runs on the game thread, so it can use the other FH2 classes straight away.

Example

Add a list called "My Tools" to ANNA's top list, with an entry that sets the time to noon. Add a headlights switch to her Car > Lights list that stays open, and only shows while you're in a car.

protected override void OnInit()
{
    var tools = ANNA.Menu.AddList("My Tools");
    tools.Add("Noon", () => World.TimeOfDay = TimeSpan.FromHours(12));

    var lights = ANNA.CarLights.Add("Headlights", () =>
    {
        if (Player.Car is { } car) car.HeadlightsOn = !car.HeadlightsOn;
    }, staysOpen: true);
    lights.Visible = () => Player.Car is not null;
}
Protected Overrides Sub OnInit()
    Dim tools = ANNA.Menu.AddList("My Tools")
    tools.Add("Noon", Sub() World.TimeOfDay = TimeSpan.FromHours(12))

    Dim lights = ANNA.CarLights.Add("Headlights", Sub()
                                                      Dim car = Player.Car
                                                      If car IsNot Nothing Then car.HeadlightsOn = Not car.HeadlightsOn
                                                  End Sub, staysOpen:=True)
    lights.Visible = Function() Player.Car IsNot Nothing
End Sub

Members

ANNA

MemberWhat it does
IsAvailable (property, bool)True when FH2 ANNA is installed and has given its menu to other mods.
IsOpen (property, bool)True while ANNA's menu is open on the HUD. Any thread.
Menu (field, MenuList)ANNA's top list.
Car (field, MenuList)ANNA's Car list (Lights, Doors, Roof...).
CarLights (field, MenuList)ANNA's Car > Lights list.
CarDoors (field, MenuList)ANNA's Car > Doors list.
Route (field, MenuList)ANNA's Set Route To Nearest list.
List(string key) (method, returns MenuList)Any list in ANNA's menu, by its key: another mod's, a native mod's (see its author's docs), or one of hers. Your entries show once that list exists. If its mod isn't installed, they never show.
Items(string name) (method, returns MenuList)A list in ANNA's menu by what it's called: one of hers ("Car", "Car > Lights", "Car > Doors", "Set Route To Nearest") or one a .NET mod added ("CarSpawner"). Use "A > B" for a list inside a list. A key works too.

ANNA.Lists

The keys of ANNA's own lists (all const string).

MemberWhat it does
Car"car", the Car list.
CarLights"car.lights", the Car > Lights list.
CarDoors"car.doors", the Car > Doors list.
Route"route", the Set Route To Nearest list.

ANNA.MenuList

A list in ANNA's menu: the top list, one of hers, or one of yours.

MemberWhat it does
Key (property, string?)The list's key. Null for the top list, or for a list looked up by name that isn't there yet.
Add(string label, Action onChoose, bool staysOpen = false, string? parent = null, string? key = null) (method, returns MenuItem)Adds an entry that runs onChoose (on the game thread) when it's chosen. With staysOpen, ANNA stays open afterwards, for things you flip back and forth. parent puts the entry in another list (by key) instead of this one. key sets the entry's key yourself.
AddList(string label, string? key = null) (method, returns MenuList)Adds a list of your own under this one. It shows once something is in it. Its key is "<your mod>.<label>".

ANNA.MenuItem

One entry in ANNA's menu. You can change its label, or when it shows, at any time.

MemberWhat it does
Key (property, string)The entry's key.
Parent (property, string?)The key of the list it's in. Null for the top list, or for a list looked up by name that isn't there yet.
Label (property, string, get/set)What the entry says. A change shows the next time its list opens.
Visible (property, Func<bool>?, get/set)Asked each time its list opens. Returning false hides the entry.
Enabled (property, Func<bool>?, get/set)Asked each time its list opens. Returning false greys the entry out.

Notes

  • FH2 ANNA is looked up once every mod has started. So early on (for example in OnInit) IsAvailable may still be false. That's fine: entries you add are kept and handed to ANNA once she's found.
  • Keys are made for you from your mod's assembly name and the label, in lower case, with anything other than letters and digits turned into _. For example, a list "My Tools" in a mod whose assembly is MyMod gets the key "mymod.my_tools". Use MenuList.Key to see a key.
  • Your entries are always under your mod's name, so two mods' entries can't clash.
  • With Items(name), the list doesn't have to exist yet. Your entries wait for it until every mod has started. If no list ever has that name, the entries don't show and platform.log says so.
  • If an entry's code (or its Visible or Enabled function) throws, the error is written to platform.log. A failing Visible or Enabled counts as true.
  • When your mod is reloaded, its entries do nothing until the new copy adds them again. Adding an entry with the same key again keeps its place in the menu and uses the new code. Visible and Enabled are cleared, so set them again.
  • ANNA talks to the FH2 ANNA mod, not to the game's code, so it doesn't switch off on an unsupported game build. It only depends on FH2 ANNA being installed.

See also

Copied from the wiki page ANNA at commit 7396a07 · MIT license
MIT License

Copyright (c) 2026 Bartholomew Ho

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.