gui

package
v0.0.0-...-c9f76b9 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NO_ID       = -11111
	MP_ID       = 50000
	SMP_BASE_ID = 10000
)

Variables

This section is empty.

Functions

func IndexSliceTab

func IndexSliceTab(sl []tab, id int) int

func InsertAtSliceInt

func InsertAtSliceInt(sl []int, item, index int) []int

func InsertAtSliceTab

func InsertAtSliceTab(sl []tab, item tab, index int) []tab

func RemoveSliceInt

func RemoveSliceInt(sl []int, item int) (int, []int)

func RemoveSliceTab

func RemoveSliceTab(sl []tab, id int) (int, []tab)

Types

type ComboButton

type ComboButton struct {
	*ui.Button
	// contains filtered or unexported fields
}

ComboButton is special type of button allowing you to Show/Hide combo. You need to provide your combo (allows to place it where you need it).

func NewComboButton

func NewComboButton(buttonTitle string, options []string, combo *ui.Combobox) *ComboButton

func (*ComboButton) OnClicked

func (cbtn *ComboButton) OnClicked(f func(b *ui.Button))

OnClicked will set OnSelected function for combo and set hiding/showing combo for button.

func (*ComboButton) Selected

func (cbtn *ComboButton) Selected() int

type DynamicBox

type DynamicBox struct {
	*ui.Box
	// contains filtered or unexported fields
}

DynamicBox allows to remove child and keep good order, so you will always remove correct entry. DynamicBox is always padded by default.

func NewDynamicVbox

func NewDynamicVbox() *DynamicBox

func (*DynamicBox) Append

func (db *DynamicBox) Append(child ui.Control, id int)

func (*DynamicBox) Delete

func (db *DynamicBox) Delete(id int)

func (*DynamicBox) DeleteAll

func (db *DynamicBox) DeleteAll()

type DynamicTab

type DynamicTab struct {
	*ui.Tab
	// contains filtered or unexported fields
}

func NewDynamicTab

func NewDynamicTab() *DynamicTab

func (*DynamicTab) Append

func (dt *DynamicTab) Append(name string, child ui.Control, id int)

func (*DynamicTab) Delete

func (dt *DynamicTab) Delete(id int)

func (*DynamicTab) InsertAt

func (dt *DynamicTab) InsertAt(name string, pos int, child ui.Control, id int)

func (*DynamicTab) SetMargined

func (dt *DynamicTab) SetMargined(id int, margined bool)

type Gui

type Gui struct {
	// contains filtered or unexported fields
}

func NewCreatorGUI

func NewCreatorGUI(s *Settings) *Gui

func (*Gui) SetCBCompressAllToFile

func (g *Gui) SetCBCompressAllToFile(f func(mp *Modpack, file string) error)

func (*Gui) SetCBCreateNewMod

func (g *Gui) SetCBCreateNewMod(f func() error)

func (*Gui) SetCBLoadAll

func (g *Gui) SetCBLoadAll(f func(path string) (*Modpack, error))

func (*Gui) SetCBSaveAll

func (g *Gui) SetCBSaveAll(f func(mp *Modpack, path string) error)

func (*Gui) SetCBSaveStepLO

func (g *Gui) SetCBSaveStepLO(f func(s *Step) error)

func (*Gui) Show

func (g *Gui) Show()

type Input

type Input interface {
	ui.Control
	SetText(text string)
}

Input allows to abstract text input Entries

type Mod

type Mod struct {
	ID                       int
	Name, Version, Author    string
	HomepageURL, DownloadURL string
}

type Modpack

type Modpack struct {
	DirPath               string
	Name, Version, Author string
	Homepage, Description string
	InstallFolder         string
	Steps                 []*Step
}

type Settings

type Settings struct {
	Modpack              *Modpack
	DownloadDir, GameDir string
}

type Step

type Step struct {
	ID             int
	Name           string
	Description    string
	AlternativeTo  int
	Optional, Stop bool
	StopMsg        string
	StopCommands   []string
	Mods           []*Mod
}

Step represents one Modpack step

Jump to

Keyboard shortcuts

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