ui

package
v0.0.0-...-fa69912 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OP_QUIT = iota

	//modlist commands
	OP_RELOAD
	OP_SAVE
	OP_SORT

	//constraints
	OP_CNT_LOAD
	OP_CNT_SAVE
	OP_CNT_NEW_RULE

	//dialogs
	OP_DLG_STEAMWORKSHOP
	OP_DLG_RIMGAME
	OP_DLG_RIMSETTINGS
	OP_DLG_MODLIST_EXPORT
	OP_DLG_MODLIST_IMPORT
)

Variables

View Source
var (
	ErrSettingsMissing     = errors.New("missing settings")
	ErrSettingsMisconfig   = errors.New("one or more settings is misconfigured")
	ErrStateNotInitialised = errors.New("state not initialised")
)
View Source
var BUS = make(chan Operation, 1)

Functions

func Run

func Run(s *prefs.Settings)

Types

type Operation

type Operation int

type State

type State struct {
	ModList            []moddata.AboutXML // List of all Mods
	EnabledMods        []int
	DisabledMods       []int
	ConstraintsCatalog *moddata.ConstraintCatalog
	ModsConfig         *moddata.ModsConfig
	Settings           *prefs.Settings
	Log                strings.Builder

	// UI
	Theme *theme.Theme

	// Window
	Win *g.MasterWindow
	// contains filtered or unexported fields
}

func NewState

func NewState(s *prefs.Settings) *State

func (*State) AddConstraintRule

func (s *State) AddConstraintRule() *moddata.ConstraintRule

func (*State) BuildEnabledMods

func (s *State) BuildEnabledMods() error

BuildEnabledMods builds the state.EnabledMods and state.DisabledMods array of indices

func (*State) CheckSettings

func (s *State) CheckSettings() bool

CheckSettings

func (*State) DisableMod

func (s *State) DisableMod(mod int)

func (*State) EnableMod

func (s *State) EnableMod(mod int)

func (*State) GetModIdxByName

func (s *State) GetModIdxByName(name string) int

func (*State) IsDisabled

func (s *State) IsDisabled(packageId string) (bool, int)

func (*State) IsEnabled

func (s *State) IsEnabled(packageId string) (bool, int)

func (*State) IsModSorted

func (s *State) IsModSorted(modIdx int) (bool, string)

func (*State) LoadConstraints

func (s *State) LoadConstraints() error

func (*State) LoadModList

func (s *State) LoadModList(_ string) error

func (*State) LoadMods

func (s *State) LoadMods() error

LoadMods loads all mods parsing all About.xml data files

func (*State) LoadModsConfig

func (s *State) LoadModsConfig() error

LoadModsConfig loads the config/ModsConfig.xml Rimworld configuration file

func (*State) Reload

func (s *State) Reload()

func (*State) SaveConstraints

func (s *State) SaveConstraints() error

func (*State) SaveExternalModList

func (s *State) SaveExternalModList(filename string) error

func (*State) SaveModlist

func (s *State) SaveModlist()

func (*State) Sort

func (s *State) Sort()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL