Exemplo n.º 1
0
 public static void RegisterConfigMenuOptions(Func <OverlayConfig> getThis, GenericModConfigMenuAPI api, GMCMOptionsAPI apiExt, IManifest modManifest)
 {
     api.AddSectionTitle(modManifest, I18n.Config_Overlay, I18n.Config_Overlay_Desc);
     api.AddBoolOption(
         mod: modManifest,
         name: I18n.Config_Overlay_Enabled,
         tooltip: I18n.Config_Overlay_Enabled_Desc,
         getValue: () => getThis().enabled,
         setValue: (bool val) => getThis().enabled = val);
     api.AddKeybind(
         mod: modManifest,
         name: I18n.Config_Overlay_Hotkey,
         tooltip: I18n.Config_Overlay_Hotkey_Desc,
         getValue: () => getThis().hotkey,
         setValue: (SButton val) => getThis().hotkey = val);
     api.AddBoolOption(
         mod: modManifest,
         name: I18n.Config_Overlay_HideAtFestivals,
         tooltip: I18n.Config_Overlay_HideAtFestivals_Desc,
         getValue: () => getThis().hideAtFestivals,
         setValue: (bool val) => getThis().hideAtFestivals = val);
     api.AddNumberOption(
         mod: modManifest,
         name: I18n.Config_Overlay_MaxWidth,
         tooltip: I18n.Config_Overlay_MaxWidth_Desc,
         getValue: () => getThis().maxWidth,
         setValue: (int val) => getThis().maxWidth = val);
     api.AddNumberOption(
         mod: modManifest,
         name: I18n.Config_Overlay_MaxItems,
         tooltip: I18n.Config_Overlay_MaxItems_Desc,
         getValue: () => getThis().maxItems,
         setValue: (int val) => getThis().maxItems = val);
     if (apiExt is not null)
     {
         apiExt.AddColorOption(
             mod: modManifest,
             name: I18n.Config_Overlay_BackgroundColor,
             tooltip: I18n.Config_Overlay_BackgroundColor_Desc,
             getValue: () => getThis().backgroundColor,
             setValue: (c) => getThis().backgroundColor = c,
             colorPickerStyle: (uint)(GMCMOptionsAPI.ColorPickerStyle.AllStyles | GMCMOptionsAPI.ColorPickerStyle.RadioChooser));
         apiExt.AddColorOption(
             mod: modManifest,
             name: I18n.Config_Overlay_TextColor,
             tooltip: I18n.Config_Overlay_TextColor_Desc,
             getValue: () => getThis().textColor,
             setValue: (c) => getThis().textColor = c,
             colorPickerStyle: (uint)(GMCMOptionsAPI.ColorPickerStyle.AllStyles | GMCMOptionsAPI.ColorPickerStyle.RadioChooser));
     }
 }