MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / UpdateTools

Method UpdateTools

Source/Editors/map_editor.cpp:1884–1912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1882}
1883
1884void MapEditor::UpdateTools(const LineSegment& mouseray, GameCursor* cursor) {
1885 EditorTypes::Tool t;
1886 if (active_tool_ == EditorTypes::OMNI) {
1887 t = omni_tool_tool_;
1888 } else {
1889 t = active_tool_;
1890 }
1891 Collision mouseray_collision_selected = lineCheckActiveSelected(scenegraph_, mouseray.start, mouseray.end, NULL, NULL);
1892 switch (t) {
1893 case EditorTypes::ADD_ONCE: {
1894 Mouse* mouse = &(Input::Instance()->getMouse());
1895 if (mouse->mouse_down_[Mouse::LEFT] == Mouse::CLICKED) {
1896 ActorsEditor_UnlocalizeIDs(&add_desc_list_, scenegraph_);
1897 ActorsEditor_AddEntitiesAtMouse(add_desc_list_source_, scenegraph_, add_desc_list_, mouseray, create_as_prefab_);
1898 QueueSaveHistoryState();
1899 SetTool(EditorTypes::OMNI);
1900 }
1901 break;
1902 }
1903 case EditorTypes::TRANSLATE:
1904 case EditorTypes::SCALE:
1905 case EditorTypes::ROTATE:
1906 UpdateTransformTool(scenegraph_, t, mouseray, mouseray_collision_selected, cursor);
1907 break;
1908 default:
1909 // mjh - what is a reasonable thing to do here?
1910 break;
1911 }
1912}
1913
1914bool MapEditor::HandleScrollSelect(const vec3& start, const vec3& end) {
1915 bool something_happened = false;

Callers

nothing calls this directly

Calls 3

lineCheckActiveSelectedFunction · 0.85

Tested by

no test coverage detected