Skip to content

Commit

Permalink
hide wesnoth.fire_wml_menu_item for normal scenarios
Browse files Browse the repository at this point in the history
as noted in the comment of that function, its only meant to be used in tests.
  • Loading branch information
gfgtdf committed Dec 11, 2016
1 parent d5f172b commit 5a13937
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/scripting/game_lua_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4088,7 +4088,6 @@ game_lua_kernel::game_lua_kernel(game_state & gs, play_controller & pc, reports
{ "find_vacant_tile", &dispatch<&game_lua_kernel::intf_find_vacant_tile > },
{ "fire_event", &dispatch2<&game_lua_kernel::intf_fire_event, false > },
{ "fire_event_by_id", &dispatch2<&game_lua_kernel::intf_fire_event, true > },
{ "fire_wml_menu_item", &dispatch<&game_lua_kernel::intf_fire_wml_menu_item > },
{ "float_label", &dispatch<&game_lua_kernel::intf_float_label > },
{ "gamestate_inspector", &dispatch<&game_lua_kernel::intf_gamestate_inspector > },
{ "get_all_vars", &dispatch<&game_lua_kernel::intf_get_all_vars > },
Expand Down Expand Up @@ -4171,6 +4170,15 @@ game_lua_kernel::game_lua_kernel(game_state & gs, play_controller & pc, reports
lua_newtable(L);
}
luaL_setfuncs(L, callbacks, 0);

if(play_controller_.get_classification().campaign_type == game_classification::CAMPAIGN_TYPE::TEST) {
static luaL_Reg const test_callbacks[] = {
{ "fire_wml_menu_item", &dispatch<&game_lua_kernel::intf_fire_wml_menu_item > },
{ nullptr, nullptr }
};
luaL_setfuncs(L, test_callbacks , 0);
}

//lua_cpp::set_functions(L, cpp_callbacks);
lua_setglobal(L, "wesnoth");

Expand Down

0 comments on commit 5a13937

Please sign in to comment.