Skip to content
EvilEngine.Formats.Records

WeaponMode record

public sealed record WeaponMode

One of a weapon’s modes, an entry in its record’s modes list, as Garry’s Mod’s physics gun has. A player picks one by holding Alt, and while it’s picked its title, icons, view model, world model, hold, effects and attachments stand in for the weapon’s. Each one it leaves out is the weapon’s. A behaviour reads the picked mode’s index from IWeaponHolder.Mode, and the record’s EffectsIn, WorldModelIn, HoldIn and AttachmentsIn fold a mode over the weapon for it.

modes = [
    { title = "Rifle", accent = "#40a0ff" },
    { title = "Grenade", accent = "#ff8020", viewmodel = "pulse:viewmodel/pulse_gl", effects = { muzzle = "pulse:effect/thump" } },
]
Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

WeaponMode constructor

public WeaponMode(string Title, string Accent)

Makes a mode with its title and accent and nothing else.

Title property

public string Title { get; init; }

The mode’s name, from title, which the wheel and the mode picker show in place of the weapon’s while it’s picked. A record’s mode must have one.

Accent property

public string Accent { get; init; }

The mode’s colour in the mode picker, from accent, a lowercase #rrggbb or #rrggbbaa. A record’s mode must have one.

ViewModel property

public ContentId? ViewModel { get; init; }

The viewmodel record drawn in first person in this mode, from viewmodel, or null for the weapon’s.

WorldModel property

public WeaponWorldModel? WorldModel { get; init; }

The model in the holder’s hand in this mode, from worldmodel, or null for the weapon’s.

Hold property

public string? Hold { get; init; }

The hold type the holder’s body takes in this mode, from hold, or null for the weapon’s.

Icon property

public WeaponIcon? Icon { get; init; }

The mode’s icon, from icon, on the wheel while it’s picked and in the mode picker, or null for the weapon’s.

IconSelected property

public WeaponIcon? IconSelected { get; init; }

The icon drawn while the weapon or the mode is hovered, from icon_selected, or null for the mode’s Icon, then the weapon’s selected icon and its icon.

Effects property

public WeaponEffects Effects { get; init; }

The mode’s looks, from effects, each slot it sets over the weapon’s. None unless set.

Attachments property

public WeaponAttachments Attachments { get; init; }

The attachments the mode’s looks come from, from attachments, each one it names over the weapon’s. None unless set.