#Thread
1 messages · Page 1 of 1 (latest)
What's the code it's running
wait man im trynna explain, wait..
Okay, so whenever you change the value of this slider, no matter what value you change it to, you call this function with false?
false means "do not send this to undo/redo manager, wait until its final so that we dont have thousands of stacks"
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..
Okay, first off, you should definitely not be using magic numbers to define completely different functionality
why does the color change for every single text
How are the text colors defined
What is TextMarkColor
what is it an array of
With this much spaghetti code you're going to need to set a breakpoint and look at what the code is actually doing
its a list of every color gradient system has
and how do those colors get propagated to text objects?
it has nothing to do with text system so i dont understand
what's a color gradient?
attempting to follow this by hand with so many magic numbers and conditionals is just not going to happen
!code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/, https://scriptbin.xyz/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
this,
1 sec
pastebin is better than screenshots
wait wdym color gradient, where is that
you tell me
That's literally what he's asking you
you just said TextMarkColors was a list of color gradients
oh yeah one sec
its the colors on right which are the same as the colors on left
but not sorted
I'm really just asking to see code
but - it's a List<Color>?
That's all I was asking
public List<Color> TextMarkColors;
Where do those colors get used?
yep
also What is AllMarksHandles?
in function ShaderGraphic, we do this
!code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/, https://scriptbin.xyz/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
thes 4 things
i mean you're copying the reference to the array here
but you're not actually consuming the colors
cmon man that would take way longer
but thats not the problem, i dont call shaderGraphic at all
I really don't know how you pasting your script to a bin is slower than showing us one function every ten minutes after tons of cajoling and you not understanding the questions
If you're just writing colors to an array somewhere and never using them, then your code wouldn't do anything at all, period.
IDK what "shaderGraphic" is or how it's relevant tbh
give me a second
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?
we still haven't seen the code that actually uses the colors to do something
when changing a mark color, the colors get changed for each text object
show us the code
don't describe the code
but i dont call it???
Okay, what is a "text object" and where are its colors changed
i literally disabled it
then your code would do nothing at all
but it changes for everything somehow
Your code is doing it
if you share the code we can help you find where
let me try and debug it
And if their colors are changed anyway, then what you disabled wasn't the thing that did it
yes that would be a good idea
ah wait, i explained it wrong
not the colros are changed, but the script that holds the data for the colors
okay one second
look for a seconds here
when i disable this part here
nothing happens anymore
the colors dont change
Okay, so, presumably, that code does the thing you want it to not do
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...
well presumably because you're just sharing a single array betwen them all
but it's really hard to say WITHOUT SEEING THE CODE
the whole code is like 2000 lines ðŸ˜
Well, it's modifying the values of TextMarkColors and AllMarksHandles which are presumably being used somewhere
that's literally nothing my dude
I'm a professional software engineer
I probably read 50k lines of code every day
you really don't need to read them all if you know how to read code
Which is a big fuckin problem for one thing, this code is horribly architected but that's not the question here
then i guess its not this part that does it, i think its because when the color array gets changed, after that another function gets triggered
Why do you guess that
i will try to debug everything right now and see how it works
I think at this point we are just highly paid rubber duckies
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
ðŸ˜
I'll take it