Additional work on entities and themes
This commit is contained in:
		@@ -5,10 +5,11 @@ type stat struct {
 | 
				
			|||||||
	name string
 | 
						name string
 | 
				
			||||||
	short string
 | 
						short string
 | 
				
			||||||
	value int
 | 
						value int
 | 
				
			||||||
 | 
						current int
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type attributes struct {
 | 
					type attributes struct {
 | 
				
			||||||
	health       stat 
 | 
						health       stat
 | 
				
			||||||
	strength     stat
 | 
						strength     stat
 | 
				
			||||||
	endurance    stat
 | 
						endurance    stat
 | 
				
			||||||
	dexterity    stat
 | 
						dexterity    stat
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@ func (p *Player) AdjustStats(which string, newvalue int) *Player {
 | 
				
			|||||||
	case "endurance","end":
 | 
						case "endurance","end":
 | 
				
			||||||
		p.stats.endurance.value = newvalue
 | 
							p.stats.endurance.value = newvalue
 | 
				
			||||||
		p.stats.health.value = 5 + (5*newvalue)
 | 
							p.stats.health.value = 5 + (5*newvalue)
 | 
				
			||||||
 | 
							p.stats.health.current = 5 + (5*newvalue)
 | 
				
			||||||
	case "wisdom","wis":
 | 
						case "wisdom","wis":
 | 
				
			||||||
		p.stats.wisdom.value = newvalue
 | 
							p.stats.wisdom.value = newvalue
 | 
				
			||||||
	case "intelligence","int":
 | 
						case "intelligence","int":
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,7 @@ import (
 | 
				
			|||||||
	bubbleadapter "github.com/BigJk/crt/bubbletea"
 | 
						bubbleadapter "github.com/BigJk/crt/bubbletea"
 | 
				
			||||||
	"github.com/BigJk/crt/shader"
 | 
						"github.com/BigJk/crt/shader"
 | 
				
			||||||
	tea "github.com/charmbracelet/bubbletea"
 | 
						tea "github.com/charmbracelet/bubbletea"
 | 
				
			||||||
 | 
						"git.vertinext.com/roryejinn/Ultralight/ui"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type model struct {
 | 
					type model struct {
 | 
				
			||||||
@@ -38,12 +39,14 @@ func (m model) View() string {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func main() {
 | 
					func main() {
 | 
				
			||||||
 | 
						thisTheme := ui.MakeTheme()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fonts, err := crt.LoadFaces("assets/fonts/IosevkaTerm-Extended.ttf", "assets/fonts/IosevkaTerm-ExtendedBold.ttf", "assets/fonts/IosevkaTerm-ExtendedMedium.ttf", crt.GetFontDPI(), 16.0)
 | 
						fonts, err := crt.LoadFaces("assets/fonts/IosevkaTerm-Extended.ttf", "assets/fonts/IosevkaTerm-ExtendedBold.ttf", "assets/fonts/IosevkaTerm-ExtendedMedium.ttf", crt.GetFontDPI(), 16.0)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		panic(err)
 | 
							panic(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	win, _, err := bubbleadapter.Window(1000, 600, fonts, model{}, color.RGBA{R: 35, G: 33, B: 54, A: 255})
 | 
						win, _, err := bubbleadapter.Window(1000, 600, fonts, model{}, thisTheme.base)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		panic(err)
 | 
							panic(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user