Navigation
Browse the developer docs

FH2 Mod Platform for .NET

SettingsTile

A tile of your mod's own on Pause > Settings.

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

On this page

Gives your mod a tile of its own on Pause > Settings, next to Controls. The tile opens a page with only your mod's rows, instead of having them among every mod's rows on the MODS pages. A keyboard-and-mouse mod with many options (key bindings, mouse speed) can use it so players find them easily.

Thread: call Add from your mod's OnInit. RefreshRow and IsShown work from any thread.

Example

A tile called MOUSE with two rows, and a "Preset" row that sets the other two.

using FH2;
using FH2ModPlatform;

public sealed class MouseSettings : Mod
{
    public override ModInfo Info => new("MouseSettings", "1.0.0");

    protected override void OnInit()
    {
        AddSetting(new SliderSetting("Speed", "Mouse speed", 1, 0.1f, 3));
        AddSetting(new ToggleSetting("Invert", "Invert mouse Y", false));
        AddSetting(new ChoiceSetting("Preset", "Preset", ["Custom", "Default", "Fast"], 0)
        {
            Changed = choice =>
            {
                if (choice == 0) return;
                SetSlider("Speed", choice == 2 ? 2 : 1);
                SetSetting("Invert", false);
                SettingsTile.RefreshRow("Speed");
                SettingsTile.RefreshRow("Invert");
            },
        });

        // After the rows: the tile, its title, and what's drawn on it.
        SettingsTile.Add(this, () => "MOUSE",
            "<Border Width=\"160\" Height=\"110\" BorderBrush=\"#FFDCDCDC\" BorderThickness=\"10\" CornerRadius=\"20\" />");
    }
}
Imports FH2
Imports FH2ModPlatform

Public Class MouseSettings
    Inherits [Mod]

    Public Overrides ReadOnly Property Info As ModInfo
        Get
            Return New ModInfo("MouseSettings", "1.0.0")
        End Get
    End Property

    Protected Overrides Sub OnInit()
        AddSetting(New SliderSetting("Speed", "Mouse speed", 1, 0.1F, 3))
        AddSetting(New ToggleSetting("Invert", "Invert mouse Y", False))
        AddSetting(New ChoiceSetting("Preset", "Preset", {"Custom", "Default", "Fast"}, 0) With {
            .Changed = Sub(choice)
                           If choice = 0 Then Return
                           SetSlider("Speed", If(choice = 2, 2.0F, 1.0F))
                           SetSetting("Invert", False)
                           SettingsTile.RefreshRow("Speed")
                           SettingsTile.RefreshRow("Invert")
                       End Sub
        })

        ' After the rows: the tile, its title, and what's drawn on it.
        SettingsTile.Add(Me, Function() "MOUSE",
            "<Border Width=""160"" Height=""110"" BorderBrush=""#FFDCDCDC"" BorderThickness=""10"" CornerRadius=""20"" />")
    End Sub
End Class

Members

MemberWhat it does
IsShown (property, bool)True once the Settings page has been given the tile. The page is read when it first shows, so this is false until then.
Add(Mod mod, Func<string> title, string pictureXaml) (method)Gives mod the tile. Call it from OnInit, after adding your rows. title is the tile's and the page's title; it's asked each time they're read, so it can follow the game's language. pictureXaml is what's drawn on the tile.
RefreshRow(string key) (method)Makes the open page show a row's new value, for rows you changed yourself (a preset row that sets other rows). The row the player changed updates by itself.

Notes

  • One mod per game. Add throws InvalidOperationException ("Another mod has the Settings tile.") if a mod already has it.
  • The picture is XAML placed inside the tile's grid, about 280 x 280. Draw it in the light grey of the game's icons, #FFDCDCDC.
  • The title can hold any characters, not only English letters.
  • Opening the tile shows only your rows. The MODS pages then leave your rows out, so they're never listed twice.
  • RefreshRow works on the tile's page. Call it from a row's Changed handler, as in the example: the rows you name are shown again right after that handler returns. Change the values with SetSetting or SetSlider first.
  • Unsupported game build: if the Settings page or its code isn't as expected, the tile isn't added, your rows stay on the MODS pages as usual, and platform.log says "SettingsTile off: ..." or "SettingsTile: ... the rows stay on the MODS pages". Your mod keeps working either way.
  • For a hosted mod, the platform's Hosted .NET mods page tells players where its settings are (Pause > Settings > your title).

See also

Copied from the wiki page SettingsTile 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.