Hey, thanks for reading this :)
I have this little code, which logs the sent parameters(*args) whenever Window_something.new(*args) is called.
However, it doesn't seem to work- $window_parameters stays empty..
I have this little code, which logs the sent parameters(*args) whenever Window_something.new(*args) is called.
However, it doesn't seem to work- $window_parameters stays empty..
- class Window
- def self.inherited(subclass)
- $window_parameters = {} if $window_parameters.nil?
- code = "class #{subclass}" + "\n"
- code += "alias win_init initialize" + "\n"
- code += "def initialize(*args)" + "\n"
- code += "$window_parameters[#{subclass}] = *args" + "\n"
- code += "win_init(*args)" + "\n"
- code += "end" + "\n"
- code += "end" + "\n"
- eval(code)
- end
- end
Expand to see the code.