Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- disableSave = true
- --Remember to set this to false once you are done making changes
- --Then, after you save & apply it, save your game too
- --Color information for button text (r,g,b, values of 0-1)
- buttonFontColor = {0.08,0.08,0.08,95}
- --Color information for button background
- buttonColor = {0,0,0,0}
- --Color information for checkbox background
- checkboxColor = {1,1,1,0}
- --Change scale of button (Avoid changing if possible)
- buttonScale = {0.1,0.1,0.1}
- --This is the button placement information
- defaultButtonData = {
- --Add checkboxes
- checkbox = {
- --[[
- pos = the position (pasted from the helper tool)
- size = height/width/font_size for checkbox
- state = default starting value for checkbox (true=checked, false=not)
- ]]
- --Schaden 1
- {
- pos = {-0.905,0.107,-1.159},
- size = 300,
- state = false
- },
- --Schaden 2
- {
- pos = {-0.826,0.107,-1.159},
- size = 300,
- state = false
- },
- --Schaden 3
- {
- pos = {-0.748,0.107,-1.159},
- size = 300,
- state = false
- },
- --Schaden 4
- {
- pos = {-0.669,0.107,-1.159},
- size = 300,
- state = false
- },
- --Schaden 5
- {
- pos = {-0.591,0.107,-1.159},
- size = 300,
- state = false
- },
- --Erschöpfung 1
- {
- pos = {-0.905,0.107,-1.062},
- size = 300,
- state = false
- },
- --Erschöpfung 2
- {
- pos = {-0.826,0.107,-1.062},
- size = 300,
- state = false
- },
- --Erschöpfung 3
- {
- pos = {-0.747,0.107,-1.062},
- size = 300,
- state = false
- },
- --Erschöpfung 4
- {
- pos = {-0.661,0.107,-1.062},
- size = 300,
- state = false
- },
- --Erschöpfung 5
- {
- pos = {-0.591,0.107,-1.062},
- size = 300,
- state = false
- },
- --Verwirrung 1
- {
- pos = {-0.905,0.107,-0.965},
- size = 300,
- state = false
- },
- --Verwirrung 2
- {
- pos = {-0.826,0.107,-0.965},
- size = 300,
- state = false
- },
- --Verwirrung 3
- {
- pos = {-0.747,0.107,-0.965},
- size = 300,
- state = false
- },
- --Verwirrung 4
- {
- pos = {-0.669,0.107,-0.965},
- size = 300,
- state = false
- },
- --Verwirrung 5
- {
- pos = {-0.591,0.107,-0.965},
- size = 300,
- state = false
- },
- --Zweifel 1
- {
- pos = {-0.905,0.107,-0.868},
- size = 300,
- state = false
- },
- --Zweifel 2
- {
- pos = {-0.826,0.107,-0.868},
- size = 300,
- state = false
- },
- --Zweifel 3
- {
- pos = {-0.747,0.107,-0.868},
- size = 300,
- state = false
- },
- --Zweifel 4
- {
- pos = {-0.669,0.107,-0.868},
- size = 300,
- state = false
- },
- --Zweifel 5
- {
- pos = {-0.591,0.107,-0.868},
- size = 300,
- state = false
- },
- --Verhungernd
- {
- pos = {-1.143,0.107,-0.623},
- size = 300,
- state = false
- },
- --Verdurstend
- {
- pos = {-0.65,0.107,-0.623},
- size = 300,
- state = false
- },
- --Schlaflos
- {
- pos = {-1.143,0.107,-0.526},
- size = 300,
- state = false
- },
- --Erfrierend
- {
- pos = {-0.65,0.107,-0.526},
- size = 300,
- state = false
- },
- --Mutation 1
- {
- pos = {0.613,0.107,0.447},
- size = 300,
- state = false
- },
- --Mutation 2
- {
- pos = {0.706,0.107,0.447},
- size = 300,
- state = false
- },
- --Mutation 3
- {
- pos = {0.799,0.107,0.447},
- size = 300,
- state = false
- },
- --Mutation 4
- {
- pos = {0.892,0.107,0.447},
- size = 300,
- state = false
- },
- --Mutation 5
- {
- pos = {0.985,0.107,0.447},
- size = 300,
- state = false
- },
- --Mutation 6
- {
- pos = {1.087,0.107,0.447},
- size = 300,
- state = false
- },
- --Mutation 7
- {
- pos = {1.180,0.107,0.447},
- size = 300,
- state = false
- },
- --Mutation 8
- {
- pos = {1.273,0.107,0.447},
- size = 300,
- state = false
- },
- --Mutation 9
- {
- pos = {1.366,0.107,0.447},
- size = 300,
- state = false
- },
- --Mutation 10
- {
- pos = {1.459,0.107,0.447},
- size = 300,
- state = false
- },
- --Kumpel 1
- {
- pos = {1.406,0.107,1.374},
- size = 300,
- state = false
- },
- --Kumpel 2
- {
- pos = {1.406,0.107,1.471},
- size = 300,
- state = false
- },
- --Kumpel 3
- {
- pos = {1.406,0.107,1.568},
- size = 300,
- state = false
- },
- --Kumpel 4
- {
- pos = {1.406,0.107,1.665},
- size = 300,
- state = false
- },
- --Fäulnis 1
- {
- pos = {-1.457,0.107,1.714},
- size = 300,
- state = false
- },
- --Fäulnis 2
- {
- pos = {-1.364,0.107,1.714},
- size = 300,
- state = false
- },
- --Fäulnis 3
- {
- pos = {-1.271,0.107,1.714},
- size = 300,
- state = false
- },
- --Fäulnis 4
- {
- pos = {-1.178,0.107,1.714},
- size = 300,
- state = false
- },
- --Fäulnis 5
- {
- pos = {-1.085,0.107,1.714},
- size = 300,
- state = false
- },
- --Fäulnis 6
- {
- pos = {-0.983,0.107,1.714},
- size = 300,
- state = false
- },
- --Fäulnis 7
- {
- pos = {-0.89,0.107,1.714},
- size = 300,
- state = false
- },
- --Fäulnis 8
- {
- pos = {-0.797,0.107,1.714},
- size = 300,
- state = false
- },
- --Fäulnis 9
- {
- pos = {-0.704,0.107,1.714},
- size = 300,
- state = false
- },
- --Fäulnis 10
- {
- pos = {-0.611,0.107,1.714},
- size = 300,
- state = false
- },
- --Erfahrung 1
- {
- pos = {-1.457,0.107,1.958},
- size = 300,
- state = false
- },
- --Erfahrung 2
- {
- pos = {-1.364,0.107,1.958},
- size = 300,
- state = false
- },
- --Erfahrung 3
- {
- pos = {-1.271,0.107,1.958},
- size = 300,
- state = false
- },
- --Erfahrung 4
- {
- pos = {-1.178,0.107,1.958},
- size = 300,
- state = false
- },
- --Erfahrung 5
- {
- pos = {-1.085,0.107,1.958},
- size = 300,
- state = false
- },
- --Erfahrung 6
- {
- pos = {-0.983,0.107,1.958},
- size = 300,
- state = false
- },
- --Erfahrung 7
- {
- pos = {-0.89,0.107,1.958},
- size = 300,
- state = false
- },
- --Erfahrung 8
- {
- pos = {-0.797,0.107,1.958},
- size = 300,
- state = false
- },
- --Erfahrung 9
- {
- pos = {-0.704,0.107,1.958},
- size = 300,
- state = false
- },
- --Erfahrung 10
- {
- pos = {-0.611,0.107,1.958},
- size = 300,
- state = false
- },
- --End of checkboxes
- },
- --Add counters that have a + and - button
- counter = {
- --[[
- pos = the position (pasted from the helper tool)
- size = height/width/font_size for counter
- value = default starting value for counter
- hideBG = if background of counter is hidden (true=hidden, false=not)
- ]]
- { --Stärke
- pos = {-1.255,0.107,-1.1617},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Geschickl
- pos = {-1.255,0.107,-1.0647},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Verstand
- pos = {-1.255,0.107,-0.9677},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Empathie
- pos = {-1.255,0.107,-0.8707},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 1
- pos = {-0.6447,0.107,0.0065},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 2
- pos = {-0.6447,0.107,0.1039},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 3
- pos = {-0.6447,0.107,0.2013},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 4
- pos = {-0.6447,0.107,0.2987},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 5
- pos = {-0.6447,0.107,0.3961},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 6
- pos = {-0.6447,0.107,0.4935},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 7
- pos = {-0.6447,0.107,0.5909},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 8
- pos = {-0.6447,0.107,0.6883},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 9
- pos = {-0.6447,0.107,0.7857},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 10
- pos = {-0.6447,0.107,0.8831},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 11
- pos = {-0.6447,0.107,0.9805},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 12
- pos = {-0.6447,0.107,1.0779},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 13
- pos = {-0.6447,0.107,1.1753},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 14
- pos = {-0.6447,0.107,1.2727},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 15
- pos = {-0.6447,0.107,1.3701},
- size = 360,
- value = 0,
- hideBG = true
- },
- { --Skill 16
- pos = {-0.6447,0.107,1.4675},
- size = 360,
- value = 0,
- hideBG = true
- },
- --End of counters
- },
- --Add editable text boxes
- textbox = {
- --[[
- pos = the position (pasted from the helper tool)
- rows = how many lines of text you want for this box
- width = how wide the text box is
- font_size = size of text. This and "rows" effect overall height
- label = what is shown when there is no text. "" = nothing
- value = text entered into box. "" = nothing
- alignment = Number to indicate how you want text aligned
- (1=Automatic, 2=Left, 3=Center, 4=Right, 5=Justified)
- ]]
- { --Name
- pos = {0.071,0.107,-1.2575},
- rows = 1,
- width = 4040,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Rolle
- pos = {1.073,0.107,-1.2575},
- rows = 1,
- width = 4115,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Erscheinung 1
- pos = {0.077,0.1,-1.0126},
- rows = 1,
- width = 3810,
- font_size = 250,
- label = "",
- value = "",
- alignment = 2
- },
- { --Erscheinung 2
- pos = {0.013,0.107,-0.916},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Erscheinung 3
- pos = {0.070,0.107,-0.8193},
- rows = 1,
- width = 3840,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Erscheinung 4
- pos = {0.013,0.107,-0.7217},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Erscheinung 5
- pos = {0.085,0.107,-0.6252},
- rows = 1,
- width = 3700,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Erscheinung 6
- pos = {0.013,0.107,-0.5275},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Talente 1
- pos = {1.0346,0.1,-1.0126},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Talente 2
- pos = {1.0346,0.107,-0.917},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Talente 3
- pos = {1.0346,0.107,-0.8193},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Talente 4
- pos = {1.0346,0.107,-0.7225},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Talente 5
- pos = {1.0346,0.107,-0.625},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Talente 6
- pos = {1.0346,0.107,-0.527},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Talente 7
- pos = {1.0346,0.107,-0.42933},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Talente 8
- pos = {1.0346,0.107,-0.3322},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Rüstung
- pos = {1.404,0.107,0.688},
- rows = 1,
- width = 1000,
- font_size = 240,
- label = "",
- value = "",
- alignment = 3
- },
- { --Ausrüstung 1
- pos = {0.026,0.107,-0.2845},
- rows = 1,
- width = 4500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Ausrüstung 2
- pos = {0.026,0.107,-0.1866},
- rows = 1,
- width = 4500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Ausrüstung 3
- pos = {0.026,0.107,-0.0892},
- rows = 1,
- width = 4500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Ausrüstung 4
- pos = {0.026,0.107,0.0053},
- rows = 1,
- width = 4500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Ausrüstung 5
- pos = {0.026,0.107,0.1035},
- rows = 1,
- width = 4500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Ausrüstung 6
- pos = {0.026,0.107,0.201},
- rows = 1,
- width = 4500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Ausrüstung 7
- pos = {0.026,0.107,0.298},
- rows = 1,
- width = 4500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Ausrüstung 8
- pos = {0.026,0.107,0.395},
- rows = 1,
- width = 4500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Ausrüstung 9
- pos = {0.026,0.107,0.4936},
- rows = 1,
- width = 4500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Ausrüstung 10
- pos = {0.026,0.107,0.5918},
- rows = 1,
- width = 4500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Kugeln 1
- pos = {0.08,0.107,0.686},
- rows = 1,
- width = 3940,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Mutation 1
- pos = {1.0346,0.107,-0.0885},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Mutation 2
- pos = {1.0346,0.107,0.01},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Mutation 3
- pos = {1.0346,0.107,0.1055},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Mutation 4
- pos = {1.0346,0.107,0.2025},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Verletzungen 1
- pos = {-0.837,0.107,-0.429},
- rows = 1,
- width = 2800,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Verletzungen 2
- pos = {-1.03,0.107,-0.333},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Verletzungen 3
- pos = {-1.03,0.107,-0.236},
- rows = 1,
- width = 4600,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Skill 13 Name
- pos = {-1.115,0.107,1.181},
- rows = 1,
- width = 3700,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Skill 14 Name
- pos = {-1.115,0.107,1.276},
- rows = 1,
- width = 3700,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Skill 15 Name
- pos = {-1.115,0.107,1.375},
- rows = 1,
- width = 3700,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Skill 16 Name
- pos = {-1.115,0.107,1.469},
- rows = 1,
- width = 3700,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Rüstung Feld
- pos = {0.922,0.107,0.688},
- rows = 1,
- width = 3450,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Waffe 1 Name
- pos = {-0.111,0.107,0.935},
- rows = 1,
- width = 3500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Waffe 1 Bonus
- pos = {0.3945,0.107,0.935},
- rows = 1,
- width = 1000,
- font_size = 240,
- label = "",
- value = "",
- alignment = 3
- },
- { --Waffe 1 Schaden
- pos = {0.6475,0.107,0.935},
- rows = 1,
- width = 1000,
- font_size = 240,
- label = "",
- value = "",
- alignment = 3
- },
- { --Waffe 1 Reichweite
- pos = {0.9005,0.107,0.935},
- rows = 1,
- width = 1080,
- font_size = 240,
- label = "",
- value = "",
- alignment = 3
- },
- { --Waffe 1 Besonderheit
- pos = {1.2785,0.107,0.935},
- rows = 1,
- width = 2285,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Waffe 2 Name
- pos = {-0.111,0.107,1.031},
- rows = 1,
- width = 3500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Waffe 2 Bonus
- pos = {0.3945,0.107,1.031},
- rows = 1,
- width = 1000,
- font_size = 240,
- label = "",
- value = "",
- alignment = 3
- },
- { --Waffe 2 Schaden
- pos = {0.6475,0.107,1.031},
- rows = 1,
- width = 1000,
- font_size = 240,
- label = "",
- value = "",
- alignment = 3
- },
- { --Waffe 2 Reichweite
- pos = {0.9005,0.107,1.031},
- rows = 1,
- width = 1080,
- font_size = 240,
- label = "",
- value = "",
- alignment = 3
- },
- { --Waffe 2 Besonderheit
- pos = {1.2785,0.107,1.031},
- rows = 1,
- width = 2285,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Waffe 3 Name
- pos = {-0.111,0.107,1.1275},
- rows = 1,
- width = 3500,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Waffe 3 Bonus
- pos = {0.3945,0.107,1.1275},
- rows = 1,
- width = 1000,
- font_size = 240,
- label = "",
- value = "",
- alignment = 3
- },
- { --Waffe 3 Schaden
- pos = {0.6475,0.107,1.1275},
- rows = 1,
- width = 1000,
- font_size = 240,
- label = "",
- value = "",
- alignment = 3
- },
- { --Waffe 3 Reichweite
- pos = {0.9005,0.107,1.1275},
- rows = 1,
- width = 1080,
- font_size = 240,
- label = "",
- value = "",
- alignment = 3
- },
- { --Waffe 3 Besonderheit
- pos = {1.2785,0.107,1.1275},
- rows = 1,
- width = 2285,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --SC 1
- pos = {0.456,0.107,1.3725},
- rows = 1,
- width = 7910,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --SC 2
- pos = {0.456,0.107,1.4695},
- rows = 1,
- width = 7910,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --SC 3
- pos = {0.456,0.107,1.5665},
- rows = 1,
- width = 7910,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --SC 4
- pos = {0.456,0.107,1.6635},
- rows = 1,
- width = 7910,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Hass
- pos = {0.61,0.107,1.76},
- rows = 1,
- width = 8750,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Beschützen
- pos = {0.69,0.107,1.8585},
- rows = 1,
- width = 7880,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- { --Traum
- pos = {0.692,0.107,1.9545},
- rows = 1,
- width = 7950,
- font_size = 240,
- label = "",
- value = "",
- alignment = 2
- },
- --End of textboxes
- }
- }
- --Lua beyond this point, I recommend doing something more fun with your life
- --Save function
- function updateSave()
- saved_data = JSON.encode(ref_buttonData)
- if disableSave==true then saved_data="" end
- self.script_state = saved_data
- end
- --Startup procedure
- function onload(saved_data)
- if disableSave==true then saved_data="" end
- if saved_data ~= "" then
- local loaded_data = JSON.decode(saved_data)
- ref_buttonData = loaded_data
- else
- ref_buttonData = defaultButtonData
- end
- spawnedButtonCount = 0
- createCheckbox()
- createCounter()
- createTextbox()
- end
- --Click functions for buttons
- --Checks or unchecks the given box
- function click_checkbox(tableIndex, buttonIndex)
- if ref_buttonData.checkbox[tableIndex].state == true then
- ref_buttonData.checkbox[tableIndex].state = false
- self.editButton({index=buttonIndex, label=""})
- else
- ref_buttonData.checkbox[tableIndex].state = true
- self.editButton({index=buttonIndex, label=string.char(10008)})
- end
- updateSave()
- end
- --Applies value to given counter display
- function click_counter(tableIndex, buttonIndex, amount)
- ref_buttonData.counter[tableIndex].value = ref_buttonData.counter[tableIndex].value + amount
- self.editButton({index=buttonIndex, label=ref_buttonData.counter[tableIndex].value})
- updateSave()
- end
- --Updates saved value for given text box
- function click_textbox(i, value, selected)
- if selected == false then
- ref_buttonData.textbox[i].value = value
- updateSave()
- end
- end
- --Dud function for if you have a background on a counter
- function click_none() end
- --Button creation
- --Makes checkboxes
- function createCheckbox()
- for i, data in ipairs(ref_buttonData.checkbox) do
- --Sets up reference function
- local buttonNumber = spawnedButtonCount
- local funcName = "checkbox"..i
- local func = function() click_checkbox(i, buttonNumber) end
- self.setVar(funcName, func)
- --Sets up label
- local label = ""
- if data.state==true then label=string.char(10008) end
- --Creates button and counts it
- self.createButton({
- label=label, click_function=funcName, function_owner=self,
- position=data.pos, height=data.size, width=data.size,
- font_size=data.size, scale=buttonScale,
- color=checkboxColor, font_color=buttonFontColor
- })
- spawnedButtonCount = spawnedButtonCount + 1
- end
- end
- --Makes counters
- function createCounter()
- for i, data in ipairs(ref_buttonData.counter) do
- --Sets up display
- local displayNumber = spawnedButtonCount
- --Sets up label
- local label = data.value
- --Sets height/width for display
- local size = data.size
- if data.hideBG == true then size = 0 end
- --Creates button and counts it
- self.createButton({
- label=label, click_function="click_none", function_owner=self,
- position=data.pos, height=size, width=size,
- font_size=data.size, scale=buttonScale,
- color=buttonColor, font_color=buttonFontColor
- })
- spawnedButtonCount = spawnedButtonCount + 1
- --Sets up add 1
- local funcName = "counterAdd"..i
- local func = function() click_counter(i, displayNumber, 1) end
- self.setVar(funcName, func)
- --Sets up label
- local label = "+"
- --Sets up position
- local offsetDistance = (data.size/2 + data.size/4) * (buttonScale[1] * 0.0018)
- local pos = {data.pos[1] + offsetDistance, data.pos[2], data.pos[3]}
- --Sets up size
- local size = data.size / 1.5
- --Creates button and counts it
- self.createButton({
- label=label, click_function=funcName, function_owner=self,
- position=pos, height=size, width=size,
- font_size=size, scale=buttonScale,
- color=buttonColor, font_color=buttonFontColor
- })
- spawnedButtonCount = spawnedButtonCount + 1
- --Sets up subtract 1
- local funcName = "counterSub"..i
- local func = function() click_counter(i, displayNumber, -1) end
- self.setVar(funcName, func)
- --Sets up label
- local label = "-"
- --Set up position
- local pos = {data.pos[1] - offsetDistance, data.pos[2], data.pos[3]}
- --Creates button and counts it
- self.createButton({
- label=label, click_function=funcName, function_owner=self,
- position=pos, height=size, width=size,
- font_size=size, scale=buttonScale,
- color=buttonColor, font_color=buttonFontColor
- })
- spawnedButtonCount = spawnedButtonCount + 1
- end
- end
- function createTextbox()
- for i, data in ipairs(ref_buttonData.textbox) do
- --Sets up reference function
- local funcName = "textbox"..i
- local func = function(_,_,val,sel) click_textbox(i,val,sel) end
- self.setVar(funcName, func)
- self.createInput({
- input_function = funcName,
- function_owner = self,
- label = data.label,
- alignment = data.alignment,
- position = data.pos,
- scale = buttonScale,
- width = data.width,
- height = (data.font_size*data.rows)+24,
- font_size = data.font_size,
- font_color = buttonFontColor,
- color = buttonColor,
- value = data.value,
- })
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement