unitview

package
v0.0.0-...-4bf0284 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeGenericContextMenu

func MakeGenericContextMenu(cache *lbx.LbxCache, ui *uilib.UI, unit UnitView, disbandMessage string, doDisband func()) *uilib.UIElementGroup

func MakeSmallListView

func MakeSmallListView(cache *lbx.LbxCache, ui *uilib.UI, stack []UnitView, title string, clicked func(UnitView)) []*uilib.UIElement

list of units that shows up when you right click on an enemy unit stack

func MakeUnitAbilitiesElements

func MakeUnitAbilitiesElements(group *uilib.UIElementGroup, cache *lbx.LbxCache, imageCache *util.ImageCache, unit UnitView, mediumFont *font.Font, x int, y int, counter *uint64, layer uilib.UILayer, getAlpha *util.AlphaFadeFunc, pureAbilities bool, page uint32) []*uilib.UIElement

func MakeUnitContextMenu

func MakeUnitContextMenu(cache *lbx.LbxCache, ui *uilib.UI, unit UnitView, doDisband func()) *uilib.UIElementGroup

func RenderCombatImage

func RenderCombatImage(screen *ebiten.Image, imageCache *util.ImageCache, unit UnitView, options ebiten.DrawImageOptions, counter uint64)

func RenderExperienceBadge

func RenderExperienceBadge(screen *ebiten.Image, imageCache *util.ImageCache, unit UnitView, font *font.Font, defaultOptions ebiten.DrawImageOptions, showExperience bool) float64

func RenderUnitInfoBuild

func RenderUnitInfoBuild(screen *ebiten.Image, imageCache *util.ImageCache, unit UnitView, descriptionFont *font.Font, smallFont *font.Font, defaultOptions ebiten.DrawImageOptions)

func RenderUnitInfoNormal

func RenderUnitInfoNormal(screen *ebiten.Image, imageCache *util.ImageCache, unit UnitView, extraTitle string, namePrefix string, descriptionFont *font.Font, smallFont *font.Font, defaultOptions ebiten.DrawImageOptions)

func RenderUnitInfoStats

func RenderUnitInfoStats(screen *ebiten.Image, imageCache *util.ImageCache, unit UnitView, maxIconsPerLine int, descriptionFont *font.Font, smallFont *font.Font, defaultOptions ebiten.DrawImageOptions)

func UnitDisbandMessage

func UnitDisbandMessage(unit UnitView) string

Types

type PortraitUnit

type PortraitUnit interface {
	// returns the lbx file and index that the portrait is in
	GetPortraitLbxInfo() (string, int)
}

type UnitView

type UnitView interface {
	GetName() string
	GetTitle() string // for heroes. normal units will not have a title
	GetBanner() data.BannerType
	GetCombatLbxFile() string
	GetCombatIndex(units.Facing) int
	GetLbxFile() string
	GetLbxIndex() int
	GetCount() int
	GetUpkeepGold() int
	GetUpkeepFood() int
	GetUpkeepMana() int
	GetMovementSpeed() int
	GetProductionCost() int
	GetEnchantments() []data.UnitEnchantment
	RemoveEnchantment(data.UnitEnchantment)
	GetWeaponBonus() data.WeaponBonus
	GetExperience() int
	GetExperienceData() units.ExperienceData
	GetBaseMeleeAttackPower() int
	GetMeleeAttackPower() int
	GetBaseRangedAttackPower() int
	GetRangedAttackPower() int
	GetRangedAttackDamageType() units.Damage
	GetBaseDefense() int
	GetDefense() int
	GetResistance() int
	GetBaseResistance() int
	GetHitPoints() int
	GetBaseHitPoints() int
	GetAbilities() []data.Ability
	GetArtifactSlots() []artifact.ArtifactSlot
	GetArtifacts() []*artifact.Artifact
	GetRace() data.Race
}

Jump to

Keyboard shortcuts

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