@@ -11,6 +11,7 @@ class CreateGame < Form
1111 include GameManager
1212 include Lib ::Settings
1313 include Lib ::WhatsThis ::AutoRoute
14+ include Lib ::WhatsThis ::EngineV2
1415
1516 needs :mode , default : :multi , store : true
1617 needs :flash_opts , default : { } , store : true
@@ -99,6 +100,7 @@ def render_content
99100 end
100101
101102 inputs << render_random_seed
103+ inputs << render_engine_v2 if should_render_engine_v2?
102104 inputs << render_optional if should_render_optional?
103105 inputs << render_game_info
104106 end
@@ -455,6 +457,7 @@ def submit
455457 title : game_params [ :title ] ,
456458 }
457459 game_data [ :settings ] [ :seed ] = game_params [ :seed ] if game_params [ :seed ]
460+ game_data [ :settings ] [ :use_engine_v2 ] = game_params [ :use_engine_v2 ] if game_params [ :use_engine_v2 ]
458461
459462 when :json
460463 begin
@@ -711,5 +714,22 @@ def update_player_range(meta)
711714 title = meta . title
712715 @min_p [ title ] , @max_p [ title ] = meta ::PLAYER_RANGE
713716 end
717+
718+ def render_engine_v2
719+ render_input (
720+ 'Use Engine V2 (experimental)' ,
721+ id : 'use_engine_v2' ,
722+ type : :checkbox ,
723+ container_style : { paddingLeft : '0.5rem' } ,
724+ attrs : { checked : false } ,
725+ siblings : [ engine_v2_whats_this ] ,
726+ )
727+ end
728+
729+ def should_render_engine_v2?
730+ # for now, only available locally for any contributors
731+ # https://github.com/tobymao/18xx/issues/12193
732+ !@production
733+ end
714734 end
715735end
0 commit comments