#Thread

1 messages · Page 1 of 1 (latest)

scarlet latch
#

here

#

We have slider that changes mark

#

lets focus on "On Value Changed"

slow nebula
#

What's the code it's running

scarlet latch
#

we do this

scarlet latch
slow nebula
# scarlet latch

Okay, so whenever you change the value of this slider, no matter what value you change it to, you call this function with false?

scarlet latch
#

so it goes trough this code...

#

WhatDo == 23 in this case

#

this is in a loop of buildingscript.WhatWeSelected

#

which is just the elements we have selected

#

after we exit the loop

#

we do this

#

since there is only 1 gradient system, so we dont need to do it each time

#

now..

#

in gradient system - we have this..

slow nebula
#

Okay, first off, you should definitely not be using magic numbers to define completely different functionality

scarlet latch
#

why does the color change for every single text

bright fog
#

What is TextMarkColor

#

what is it an array of

slow nebula
#

With this much spaghetti code you're going to need to set a breakpoint and look at what the code is actually doing

scarlet latch
bright fog
#

and how do those colors get propagated to text objects?

scarlet latch
#

it has nothing to do with text system so i dont understand

bright fog
slow nebula
#

attempting to follow this by hand with so many magic numbers and conditionals is just not going to happen

bright fog
#

!code

wise pulsarBOT
scarlet latch
bright fog
#

no

#

I mean I want to see the code

scarlet latch
scarlet latch
bright fog
#

pastebin is better than screenshots

scarlet latch
bright fog
#

you tell me

slow nebula
bright fog
#

you just said TextMarkColors was a list of color gradients

scarlet latch
#

its the colors on right which are the same as the colors on left

#

but not sorted

bright fog
#

I'm really just asking to see code

#

but - it's a List<Color>?

#

That's all I was asking

scarlet latch
bright fog
#

Where do those colors get used?

scarlet latch
#

yep

bright fog
scarlet latch
slow nebula
wise pulsarBOT
scarlet latch
bright fog
#

but you're not actually consuming the colors

scarlet latch
bright fog
#

please just share the code

#

no, it would be way faster

#

this is like pulling teeth

scarlet latch
slow nebula
bright fog
#

IDK what "shaderGraphic" is or how it's relevant tbh

scarlet latch
#

give me a second

slow nebula
#

To be honest, I don't even know what the problem is. What objects are having their colors changed? What code is changing their colors?

bright fog
#

we still haven't seen the code that actually uses the colors to do something

scarlet latch
bright fog
#

don't describe the code

slow nebula
scarlet latch
#

i literally disabled it

bright fog
scarlet latch
bright fog
#

if you share the code we can help you find where

scarlet latch
slow nebula
bright fog
#

yes that would be a good idea

scarlet latch
#

not the colros are changed, but the script that holds the data for the colors

bright fog
#

and which script is that?

#

It's reaaaally hard to help without details

scarlet latch
#

okay one second

#

look for a seconds here

#

when i disable this part here

#

nothing happens anymore

#

the colors dont change

slow nebula
#

Okay, so, presumably, that code does the thing you want it to not do

scarlet latch
#

the data thats attached to the text doesnt change too

#

now

#

if i enable it back it changes the data for every text that out there

#

why? it shouldnt do anything at all...

bright fog
#

but it's really hard to say WITHOUT SEEING THE CODE

scarlet latch
slow nebula
bright fog
#

I'm a professional software engineer

#

I probably read 50k lines of code every day

scarlet latch
#

okay wait a sec

bright fog
#

you really don't need to read them all if you know how to read code

slow nebula
scarlet latch
#

give me a second

#

i think it is all because another function is triggered

scarlet latch
bright fog
#

Why do you guess that

scarlet latch
#

i will try to debug everything right now and see how it works

slow nebula
bright fog
#

It seems to me based on the very limited information you have shared that you are simply sharing the same array among all your components

#

so - when you modify that one array, all of them see the modification