()
| 4081 | } |
| 4082 | |
| 4083 | func (td *TableData) Update() { |
| 4084 | |
| 4085 | td.Changed = false |
| 4086 | |
| 4087 | x := td.Table.Card.DisplayRect.X |
| 4088 | y := td.Table.Card.DisplayRect.Y |
| 4089 | |
| 4090 | // Buttons |
| 4091 | |
| 4092 | completedColor := getThemeColor(GUICompletedColor) |
| 4093 | |
| 4094 | if td.Table.Card.CustomColor != nil { |
| 4095 | h, s, v := td.Table.Card.CustomColor.HSV() |
| 4096 | completedColor = NewColorFromHSV(h+30, s-0.2, v+0.4) |
| 4097 | } |
| 4098 | |
| 4099 | if td.Table.Card.Resizing == "" { |
| 4100 | |
| 4101 | for yi := range td.Data { |
| 4102 | |
| 4103 | if yi >= td.Height { |
| 4104 | break |
| 4105 | } |
| 4106 | |
| 4107 | for xi, content := range td.Data[yi] { |
| 4108 | |
| 4109 | if xi >= td.Width { |
| 4110 | break |
| 4111 | } |
| 4112 | |
| 4113 | content.Button.Active = td.Table.Card.selected |
| 4114 | content.Button.Rect.X = x + 4 |
| 4115 | content.Button.Rect.Y = y + 4 |
| 4116 | content.Button.Update() |
| 4117 | content.Button.IconSrc.X = (float32(content.Value) * 24) + 24 |
| 4118 | x += 32 |
| 4119 | content.Button.IconSrc.Y = 488 - (float32(td.ValueDisplayMode) * 24) |
| 4120 | |
| 4121 | content.Button.BGIconTint = ColorWhite |
| 4122 | |
| 4123 | tint := ColorWhite |
| 4124 | if td.ValueDisplayMode == ValueDisplayModeCheck && td.Value(xi, yi) == 1 { |
| 4125 | tint = completedColor |
| 4126 | } |
| 4127 | content.Button.Tint = tint |
| 4128 | |
| 4129 | } |
| 4130 | |
| 4131 | y += 32 |
| 4132 | x = td.Table.Card.DisplayRect.X |
| 4133 | } |
| 4134 | |
| 4135 | hoveringX := int(math.Floor(float64((globals.Mouse.WorldPosition().X - td.Table.Card.DisplayRect.X) / 32))) |
| 4136 | hoveringY := int(math.Floor(float64((globals.Mouse.WorldPosition().Y - td.Table.Card.DisplayRect.Y) / 32))) |
| 4137 | |
| 4138 | hoveringAlpha := float32(1) |
| 4139 | |
| 4140 | if hoveringX >= 0 && hoveringX < td.Width && hoveringY >= 0 && hoveringY < td.Height { |
nothing calls this directly
no test coverage detected