Techmino icon indicating copy to clipboard operation
Techmino copied to clipboard

Refactor eventsets by passing in arguments using ENV

Open Not-A-Normal-Robot opened this issue 1 year ago • 1 comments

As an example, currently, we have different eventsets for each of the Classic modes. This means there is a lot of repeated code.

An approach we could use to fix this is to supply eventset arguments using ENV.

-- mode
return{
  -- ...
  eventset='classic',
  start_lvl=18,
  transition_lines=100,
  end_lines=200
  -- ...
}

-- eventset
return{
  -- ...
  task=function()
    ENV.start_lvl=ENV.start_lvl or 18
    -- ...
  end
}

Not-A-Normal-Robot avatar May 28 '24 00:05 Not-A-Normal-Robot

~~Too lazy to fix, you can do it if you don't want to see them~~

MrZ626 avatar May 28 '24 00:05 MrZ626