Ask for a grammar
Ask for a grammar
I want to add a drag bar in the setting interface. How do I do it? Thank you
- NotRexButCaesar
- Smart Inserter
- Posts: 1133
- Joined: Sun Feb 16, 2020 12:47 am
- Contact:
Re: Ask for a grammar
You can either click and drag the little notch indicator, or type in the number box:
Video
Last edited by NotRexButCaesar on Sat Dec 25, 2021 7:21 am, edited 1 time in total.
Ⅲ—Crevez, chiens, si vous n'étes pas contents!
Re: Ask for a grammar
Thank you. I think you understand it wrong. I mean: I want to implement this drag bar in my own mod. How to add it grammatically
Maybe I didn't express it clearly enough. Thank you
Maybe I didn't express it clearly enough. Thank you
- NotRexButCaesar
- Smart Inserter
- Posts: 1133
- Joined: Sun Feb 16, 2020 12:47 am
- Contact:
Re: Ask for a grammar
Oh, I should have seen what forum it was in.
I am not sure what you mean by 'grammatically'.
Here is an example of a script that will create one:
Code: Select all
/c
local player = game.player
player.gui.center.clear()
local frame = player.gui.center.add
{
type = 'frame'
}
local slider = frame.add
{
type = 'slider',
style = 'notched_slider',
minimum_value = 1,
maximum_value = 10,
value = 1,
value_step = 1,
discrete_slider = true,
discrete_values = true,
name = 'testslider',
}
slider.style.width = 200
Ⅲ—Crevez, chiens, si vous n'étes pas contents!
Re: Ask for a grammar
Can it be implemented in "settings. Lua"?
I the following paragraph is invalid:
I the following paragraph is invalid:
Code: Select all
{
type = "int-setting",
name = "setting6",
setting_type = "startup",
default_value = 7,
minimum_value = 3,
maximum_value = 32,
discrete_slider = true,
discrete_values = true,
value_step = 1,
order = "2-4"
},
Re: Ask for a grammar
Can it be implemented in "settings. Lua"?NotRexButCaesar wrote: ↑Sat Dec 25, 2021 7:18 amOh, I should have seen what forum it was in.
I am not sure what you mean by 'grammatically'.
Here is an example of a script that will create one:Code: Select all
/c local player = game.player player.gui.center.clear() local frame = player.gui.center.add { type = 'frame' } local slider = frame.add { type = 'slider', style = 'notched_slider', minimum_value = 1, maximum_value = 10, value = 1, value_step = 1, discrete_slider = true, discrete_values = true, name = 'testslider', } slider.style.width = 200
I the following paragraph is invalid:
Code: Select all
{
type = "int-setting",
name = "setting6",
setting_type = "startup",
default_value = 7,
minimum_value = 3,
maximum_value = 32,
discrete_slider = true,
discrete_values = true,
value_step = 1,
order = "2-4"
},
- NotRexButCaesar
- Smart Inserter
- Posts: 1133
- Joined: Sun Feb 16, 2020 12:47 am
- Contact:
Re: Ask for a grammar
It should be in control.lua
Here is an example of a mod using notched sliders:
https://github.com/raiguard/Factorio-Qu ... st.lua#L95
That file is required in control.lua:
https://github.com/raiguard/Factorio-Qu ... ol.lua#L14
Ⅲ—Crevez, chiens, si vous n'étes pas contents!
Re: Ask for a grammar
Thank you.NotRexButCaesar wrote: ↑Sat Dec 25, 2021 9:59 pmIt should be in control.lua
Here is an example of a mod using notched sliders:
https://github.com/raiguard/Factorio-Qu ... st.lua#L95
That file is required in control.lua:
https://github.com/raiguard/Factorio-Qu ... ol.lua#L14
Re: Ask for a grammar
I still want to ask you for help. I'm stupid. I studied the content you provided for a long time, but finally failed. I just want to know the following:NotRexButCaesar wrote: ↑Sat Dec 25, 2021 9:59 pmIt should be in control.lua
Here is an example of a mod using notched sliders:
https://github.com/raiguard/Factorio-Qu ... st.lua#L95
That file is required in control.lua:
https://github.com/raiguard/Factorio-Qu ... ol.lua#L14
What to add in "control. Lua" and what to add in "settings. Lua".
This may be troublesome. Sorry