Jump to content

checkBoxGetSelected


Recommended Posts

if source == bv2 then
if DGS:dgsCheckBoxGetSelected(v12,true) then
if DGS:dgsCheckBoxGetSelected(v14,true) then
window5 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"+",false)
else if DGS:dgsCheckBoxGetSelected(v12,false) then
else if DGS:dgsCheckBoxGetSelected(v14,false) then
window6 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"-",false)

bv2 - button

There are 4 checkboxes .(v11,v12,v13,v14) 

When a player chooses checkboxes(v12 and v14) window5 open(it's fine) but i need when this checkboxes not selected then windows6 show. I mean (example you select v11 and v14 - window6 will be show or select v12 and v13 also window6 will be show or noone checkbox selected - windows6 will be show and etc) but when select v12 and v14 window5 will be open.

How it's work? The first part works fine but second didn't work.

I use dgs. https://wiki.multitheftauto.com/wiki/Resource:Dgs

You can explain the example of CEGUI if can't on dgs.

Link to comment

if source == bv2 then
    if DGS:dgsCheckBoxGetSelected(v12,true) and DGS:dgsCheckBoxGetSelected(v14,true) then
        window5 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"+",false)
    elseif DGS:dgsCheckBoxGetSelected(v12,false) and DGS:dgsCheckBoxGetSelected(v14,false) then
        window6 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"-",false)
    end
end

 

Link to comment
1 hour ago, Shux said:

if source == bv2 then
    if DGS:dgsCheckBoxGetSelected(v12,true) and DGS:dgsCheckBoxGetSelected(v14,true) then
        window5 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"+",false)
    elseif DGS:dgsCheckBoxGetSelected(v12,false) and DGS:dgsCheckBoxGetSelected(v14,false) then
        window6 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"-",false)
    end
end

 

for v12 and v14 - true it's work fine but for 

elseif DGS:dgsCheckBoxGetSelected(v12,false) and DGS:dgsCheckBoxGetSelected(v14,false) then
        window6 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"-",false)

didn't work

Link to comment
2 hours ago, slapz0r said:

for v12 and v14 - true it's work fine but for 

didn't work

 

Oops, this is what you want here.

if source == bv2 then
    if  ( DGS:dgsCheckBoxGetSelected(v12) == true ) and ( DGS:dgsCheckBoxGetSelected(v14) == true ) then
        window5 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"+",false)
    elseif ( DGS:dgsCheckBoxGetSelected(v12) ~= true ) and ( DGS:dgsCheckBoxGetSelected(v14) ~= true )then
        window6 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"-",false)
    end
end

 

Edited by Shux
  • Like 1
Link to comment
7 hours ago, Shux said:

 

Oops, this is what you want here.


if source == bv2 then
    if  ( DGS:dgsCheckBoxGetSelected(v12) == true ) and ( DGS:dgsCheckBoxGetSelected(v14) == true ) then
        window5 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"+",false)
    elseif ( DGS:dgsCheckBoxGetSelected(v12) ~= true ) and ( DGS:dgsCheckBoxGetSelected(v14) ~= true )then
        window6 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"-",false)
    end
end

 

If you just select (v11) open window6 - it's fine

if you just select (v12) nothing happens ( need open window6)

if you just select (v13) open window6 - it's fine

if you just select (v14) nothing happens (need open window6)

if you just select (v11 and v12) nothing happens(need open window6)

if you just select (v11 and v13) open window6 - it's fine

if you just select (v11 and v14) nothing happens(need open window6)

if you select (v11 and v12 and v14) open window5 - and it is necessary that only when selected only (v12 and v14)

Maybe I did not put it exactly what I want, but can you help me with this?

and if none of the checkboxes are selected - open windows6 

how to do it?

Edited by slapz0r
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...