#help setactive

1 messages · Page 1 of 1 (latest)

spiral mist
#

@gritty echo here write

#

wait explain:

#

there is :

#

therre is

#

phpyadmin

#

example there setactive(false and true)

#

and write phpyadmin auto login (false and true)

#

or

#

think

feral tangle
#

public string AlertsWarn

#

see how it says string

#

not bool

spiral mist
#

yes i know

#

string is write

#

and not bool.

#

why phpyadmin.

feral tangle
#

so what is your confusion?

spiral mist
spiral mist
feral tangle
#

phpmyadmin is completely irrelevant to your problem

#

don't even think about it

spiral mist
feral tangle
#

?

spiral mist
#

WarnAlerts = false example

#

only string write phpyadmin false and true

#

or also 0 and 1

feral tangle
#
bool x = true;
WarnAlerts.SetActive(x);```^This is good. This works
```cs
string x = "true";
WarnAlerts.SetActive(x);```^This is bad. Not work.
spiral mist
#

hmmm i see.

#

wait think.

spiral mist
#

think is number 0 and 1?

#

correct?

#

ah no no "bool x = true;" no no but only text there hasve string alertswarn

#

but hard think,

feral tangle
#

more or less, but not really relevant. ¯_(ツ)_/¯

spiral mist
#

i know and hard think wait

#

and other help who.

#

AlertsText.text = bl_DataBase.Instance.LocalUser.MessageAlerts;

#

there is working

#

only is text

#

and other is gameobject (false and true for setactive)

feral tangle
#

.text is a string, so it's ok

#

SetActive needs bool, so it's not ok.

spiral mist
#

no no have.

spiral mist
#

i see "GameObject WarnAlerts;" yes but only is alerts

#

there

#

enable and disable

feral tangle
#

why not make it public bool AlertsWarn

spiral mist
#

ok wait check

#

test

#

think

#

Ah

#

i see.

#

do not work

#

but is data for phpyadmin

feral tangle
#

then you just need to convert the string to a bool

spiral mist
#

hmm

feral tangle
#

AlertsWarn = string.Equals(data["alertsWarn"], "true", StringComparison.InvariantCultureIgnoreCase);

spiral mist
#

Ah

#

forget

#

yes is data

#

ok wait

feral tangle
#

fixed

spiral mist
#

ok work

#

and why "true"?

feral tangle
#

idk maybe you want "1"

#

it's however your database stores it

spiral mist
#

ok think wait test

#

@feral tangle error

#

AlertsWarn = string.Equals(data["alertsWarn"], "true", StringComparison.InvariantCultureIgnoreCase);

#

do not no work

#

xd

#

think "StringComparison.InvariantCultureIgnoreCase" incorrect.

#

AlertsWarn = string.Equals(data["alertsWarn"], "true");

#

maybe try.

#

nah no work

#

rip.

#

public string AlertsWarn;

spiral mist
#

buut

#

example think bl_DataBase.Instance.LocalUser.AlertsWarn x = WarnAlerts.SetActive(x);

#

hmmm

#

uhm last little.

spiral mist
#

@feral tangle ah idea probably is [i] index number 1 , 2 , 3

#

but sorry no remember missing

#

and only remember [i]