Documentation ¶
Index ¶
- Constants
- Variables
- func CheckUniqueKeys(keys ...string) bool
- func CheckUniqueNames(recipes []Recipe) bool
- func CheckValidKey(key string) bool
- func Validate(startPause string, stop string, confirm string, cancel string, ...) (string, error)
- func ValidateRecipe(startPause string, stop string, confirm string, cancel string, recipe Recipe) error
- func ValidateSettings(startPause string, stop string, confirm string, cancel string) error
- func WriteToConfig(StartPause string, Stop string, Confirm string, Cancel string, ...) error
- type Config
- type Recipe
Constants ¶
View Source
const ( Waiting = iota Crafting Pausing Paused Stopping Stopped Finished )
Indices for status color codes
Variables ¶
View Source
var ( TitleStyle = lipgloss.NewStyle().Padding(0, 1).Background(Primary) TitleView = TitleStyle.Render("XIVCrafter") ListStyle = lipgloss.NewStyle().Margin(1, 1) MainStyle = lipgloss.NewStyle().Margin(1, 3) StatusStyle = lipgloss.NewStyle().PaddingLeft(6) ListStatusStyle = lipgloss.NewStyle().PaddingLeft(4) )
View Source
var ( // XIVCrafter config file path ConfigPath string )
View Source
var Logger *log.Logger
For debug mode
View Source
var ( // Status color codes Status = []string{ lipgloss.NewStyle().Foreground(Gray).Render("Waiting"), lipgloss.NewStyle().Foreground(Green).Render("Crafting"), lipgloss.NewStyle().Foreground(Yellow).Render("Pausing"), lipgloss.NewStyle().Foreground(Yellow).Render("Paused"), lipgloss.NewStyle().Foreground(Red).Render("Stopping"), lipgloss.NewStyle().Foreground(Red).Render("Stopped"), lipgloss.NewStyle().Foreground(Green).Render("Finished"), } )
Functions ¶
func CheckUniqueKeys ¶
CheckUniqueKeys checks to see if all hotkeys are unique
func CheckUniqueNames ¶
CheckUniqueNames checks to see if the Name field are unique per Recipe
func CheckValidKey ¶
CheckValidKey checks to see if the given string is a valid hotkey for XIVCrafter
func Validate ¶
func Validate(startPause string, stop string, confirm string, cancel string, recipes []Recipe) (string, error)
Validate checks and validates the entire config for XIVCrafter
func ValidateRecipe ¶
func ValidateRecipe(startPause string, stop string, confirm string, cancel string, recipe Recipe) error
ValidateSettings checks and validates the XIVCrafter settings and a recipe
func ValidateSettings ¶
ValidateSettings checks and validates just the XIVCrafter settings
Types ¶
type Config ¶
type Recipe ¶
type Recipe struct { // XIVCrafter Settings Name string `json:"name"` // Consumables Food string `json:"food"` FoodDuration int `json:"food_duration"` Potion string `json:"potion"` // In-Game Hotkeys Macro1 string `json:"macro1"` Macro1Duration int `json:"macro1_duration"` Macro2 string `json:"macro2"` Macro2Duration int `json:"macro2_duration"` Macro3 string `json:"macro3"` Macro3Duration int `json:"macro3_duration"` }
Click to show internal directories.
Click to hide internal directories.