ID:149066
 
hey im having this weird problem with my game i coded two verbs + 1 closing verb which can be activated by the hud but it only shows 1 verb and the closing verb.....
so far i have this code and i was wondering if any-1 could take a look at it and tell me what im doing wrong and how i can fix it.

Code:


mob
var
openmenu = 0//This var will be used to tell if a menu is open already

//End var define


//Begin proc define

mob
proc
openmenu(var/menutype)//This will be used to open menus when they get clicked
switch(menutype)//Shortens the code by allowing to use if(condition)
if("main")//If the argument to the proc is "main"
if(openmenu)//If there's already an open menu
src.closeall()//Closes all menus using the proc
new/obj/hud/items/mainitems/say(src.client)//creates a say object on the screen
new/obj/hud/items/close/closemain(src.client)
new/obj/hud/items/mainitems/afk(src.client)
src.openmenu = 1//Now there's a menu open
else//Does the same as above except no closing
new/obj/hud/items/mainitems/say(src.client)
new/obj/hud/items/close/closemain(src.client)
new/obj/hud/items/afk(src.client)
src.openmenu = 1
closeall()
src.openmenu = 0//No menu open
for(var/obj/hud/items/I in src.client.screen)//Loops over all types in /obj/hud/items
del(I)//deletes them


//BegIn HUD define

obj
hud
menus//for the main menus
layer = MOB_LAYER + 1//appears above mobs
icon = 'menu.dmi'//sets the icon for all the things defined under /obj/hud/menus
main//The main button
icon_state = "main"
Click()//When clicked
usr.openmenu("main")//Calls the openmenu proc with "main" as it's argument
New(client/C)//When created
screen_loc = "1,11"//Locates it on the screen
C.screen+=src//Adds it to client's screen
items
layer = MOB_LAYER + 1
mainitems
icon = 'items.dmi'
say
icon_state = "say"
Click()
var/T = input("Say what?")as null|text//Works as a say verb
if(!T)//If there's no text
return//Stops the proc
else
world << "[usr]: [T]"
New(client/C)
screen_loc = "1,10"
C.screen+=src
New(client/C)
C.screen+=src

items
layer = MOB_LAYER + 1
menus
icon = 'items.dmi'
say
icon_state = "Afk"
Click()
world << "[usr]: Is now AFK"
New(client/C)
screen_loc = "1,8"
C.screen+=src
New(client/C)
C.screen+=src





close//Used to close the seperate menus
icon = 'items.dmi'
icon_state = "close"
closemain
Click()
usr.closeall()//Closes all open menus
New(client/C)
screen_loc = "1,9"
C.screen+=src
closemove
Click()
usr.closeall()
New(client/C)
screen_loc = "2,9"
C.screen+=src


//End HUD define

//Begin creation define

client/New()//When a client connects to a mob
..()
new/obj/hud/menus/move(src)//Creates a new move menu in the client which also calls the object's New() proc
new/obj/hud/menus/main(src)
new/obj/hud/items/mainitems/afk(src)


/obj/hud/items/mainitems/afk
/obj/hud/items/afk



by the way i used the Hud code nadrew made........