MCPcopy Create free account
hub / github.com/SolarLune/masterplan / UpdateTargetTimerText

Method UpdateTargetTimerText

contents.go:1918–1933  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1916}
1917
1918func (tc *TimerContents) UpdateTargetTimerText() {
1919 var big, small int
1920
1921 modeGroup := tc.Card.Properties.Get("mode group").AsInt()
1922
1923 if modeGroup == 1 {
1924 big = tc.Card.Properties.Get("max minutes").AsInt()
1925 small = tc.Card.Properties.Get("max seconds").AsInt()
1926 } else if modeGroup == 2 {
1927 big = tc.Card.Properties.Get("schedule hour").AsInt()
1928 small = tc.Card.Properties.Get("schedule minute").AsInt()
1929 }
1930
1931 tc.TargetTimeLabel.SetTextRaw([]rune(fmt.Sprintf("%02d", big) + ":" + fmt.Sprintf("%02d", small)))
1932
1933}
1934
1935func (tc *TimerContents) Update() {
1936

Callers 3

NewTimerContentsFunction · 0.95
SetCountdownTimeMethod · 0.95
SetScheduleTimeMethod · 0.95

Calls 3

AsIntMethod · 0.80
SetTextRawMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected