0.2.2 Color updating. /JL

This commit is contained in:
2022-12-18 22:59:49 +01:00
parent 8e2bae5203
commit e325df9fbb
3 changed files with 22 additions and 24 deletions

View File

@@ -17,8 +17,8 @@ type (
info *walk.ImageView
warning *walk.ImageView
Brand string
Series string
Weight int
Series []string
Weight []int
Name string
ColorID int
Red byte
@@ -62,12 +62,7 @@ func LoadBeads(mw *MyMainWindow) {
log.Println("Loading bead: " + bead.ColorName + " ...")
if !bead.Disabled {
bc := NewBeadColor(mw, bead.ColorName, bead.ColorIndex, bead.OnHand, bead.Red, bead.Green, bead.Blue)
for _, series := range brand.Series {
if series.Serie == mw.serie_combo.Text() {
bc.Series = series.Serie
bc.Weight = series.Weight
}
}
bc.Series = bead.Series.Serie
bc.Brand = brand.BrandName
bc.Name = bead.ColorName
bc.ColorID = bead.ColorIndex
@@ -162,8 +157,3 @@ func (bc *BeadColor) SetInStock(inStock bool) {
func (bc *BeadColor) GetColorID() int {
return bc.ColorID
}
func (bc *BeadColor) AddOnHand(grams int) {
addbeads := grams / bc.Weight * 1000
bc.onHand += int(addbeads)
}