ID:144890
 
Code:
part 1
obj
HUD
X
InventoryStatScreen
name = "Close"
New(client/C,x,y)
..()
src.screen_loc = "[x],[y]"
C.screen+=src

MouseUp(loc,x,y)
src.icon_state = "out"
usr.canattack=0
usr.inventory_and_stat_screen=0
usr.lock = 0
usr.Move(locate(usr.last_x,usr.last_y,usr.last_z))
usr.client.screen = null
usr.client.screen+=new/obj/HUD/Attack_Off
usr.client.output=null
usr.client.view="16x16"
usr.client.eye = usr.client.mob
usr.client.show_verb_panel = 1
usr.starting = 0

return

part 2
            if(usr.inventory_and_stat_screen==0)
src.client.show_verb_panel = 0
src.starting = 1
src.last_x = src.x
src.last_y = src.y
src.last_z = src.z
src.client.view = "15x13"
src.loc = locate(0,0,0)
src.canattack=0
for(var/obj/HUD/HUD in usr.client.screen)
del HUD
for(var/I in icon_states('Equip and Stat Screen v3.PNG'))
var/obj/S = new/obj/HUD/Equip_and_Stat_Screen
S.icon_state=I
S.screen_loc=I
S.name = "Inventory and Stat Screen"
S.name = I
usr.client.screen+=S
usr.inventory_and_stat_screen=1
usr.lock = 1
new/obj/HUD/X/InventoryStatScreen(usr.client,"13","15")
Find_Stats()

There is more to this code but it is too long and i know noone would want to read it...lol
Problem description:
When i click on the X, it closes the window....but the weird part is...when it closes, any mobs or objs in my view become invisible until i walk of the screen and come back...




[EDIT]I forgot, the code on the bottom adds a screen to the player's hud and the top code closes the screen.[/EDIT]

anyone know wat is wrong?

anyone no wats wrong?
In response to Flame48
Move the ..() in the New below the 2 lines after it. Whenever you're overriding a built in proc, make your edits to it first then call the parent.

Example:

obj
var/attack = 0
sword
New()
attack = 1
..()
In response to Pyro_dragons
Pyro_dragons wrote:
Move the ..() in the New below the 2 lines after it. Whenever you're overriding a built in proc, make your edits to it first then call the parent.

Quite wrong! The time to call ..() depends greatly on the proc, but in most cases it makes the most sense to call that first, not last.

Lummox JR
In response to Lummox JR
Oh oops. I must be more tired than I though to have fogotten that. Long days suck...
In response to Flame48
Flame48 wrote:
anyone no wats wrong?

???????
In response to Flame48
ANYONE????
In response to Flame48
If no1 replied a working solution by now, I suggest you probably should remake the system or seomthing <.<

- GhostAnime
In response to Lummox JR
Lummox JR wrote:
Pyro_dragons wrote:
Move the ..() in the New below the 2 lines after it. Whenever you're overriding a built in proc, make your edits to it first then call the parent.

Quite wrong! The time to call ..() depends greatly on the proc, but in most cases it makes the most sense to call that first, not last.

Lummox JR

Also, doesn't ..() do nothing in New(), anyway?
In response to Airjoe
Quite correct, only client/New() actually does something ...
But I still find it quite important to be there, just incase.