How to make a menu option a clone of another one?

正在查看此主题的用户

For example, there are two menu options in different menus, assuming A and B,  and I want to make B only a clone of A, in other words, when player click B, the consequence is as exactly same as click A. However, I don't want to only copy codes for the sake of maintenence. Is there any better ways to do it? :oops:
 
there are two menu options in different menus
This means two pieces of code, the question is how much and where. 

If A and B both require identical, very complicated code to be run, then write that code in module_scripts and call_script from the module_game_menus code, passing it the appropriate arguments, instead of duplicating it.
 
Please do use the stickied Q&A thread for these "how should I?" type questions. It's what it is there for.
 
xenoargh 说:
there are two menu options in different menus
This means two pieces of code, the question is how much and where. 

If A and B both require identical, very complicated code to be run, then write that code in module_scripts and call_script from the module_game_menus code, passing it the appropriate arguments, instead of duplicating it.
A good idea, thanks :grin:
 
后退
顶部 底部