button factory method moved

This commit is contained in:
onyx-and-iris 2022-06-23 14:04:57 +01:00
parent a07df8f7b8
commit 9b7be8d89d

View File

@ -7,6 +7,11 @@ type button struct {
index int index int
} }
// newButton returns a button type
func newButton(i int) button {
return button{i}
}
// getter returns the value of a macrobutton parameter // getter returns the value of a macrobutton parameter
func (m *button) getter(mode int) bool { func (m *button) getter(mode int) bool {
return getMacroStatus(m.index, mode) == 1 return getMacroStatus(m.index, mode) == 1
@ -23,11 +28,6 @@ func (m *button) setter(v bool, mode int) {
setMacroStatus(m.index, value, mode) setMacroStatus(m.index, value, mode)
} }
// newButton returns a button type
func newButton(i int) button {
return button{i}
}
// String implements the stringer interface // String implements the stringer interface
func (m *button) String() string { func (m *button) String() string {
return fmt.Sprintf("MacroButton%d\n", m.index) return fmt.Sprintf("MacroButton%d\n", m.index)