proc
FadeWindow()
set background = 1
var/o = winget(client,"loginsplash","alpha")
world << "[o]"
var/n = text2num("[o]")
var/m = num2text("[n]")
while(n >= 9)
n -= 10
winset(client,"loginsplash","alpha =[m]")
world << "[m]"
break
Problem description:
I am trying to fade the window "loginsplash" out gradually, I haven't used while loops extensivly, so I am not too sure of what I am doing... Right now it starts, and the windows opacity is 255, then immediately after it is 0.
There was also a second more minor problem, that is you might have the case that the alpha ends up less than your intended 9 minimum. To solve that I introduced a min() function.
Here's the function directly as it was but with my alterations.
Here's the function again but upgraded to be modular.