MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ClipboardCopy

Method ClipboardCopy

engine/Poseidon/UI/Map/UIMapExt.cpp:1168–1247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1166}
1167
1168void CStaticMapArcade::ClipboardCopy()
1169{
1170 GetGClipboard().Clear();
1171 float mouseX = 0.5 + InputSubsystem::Instance().GetCursorX() * 0.5;
1172 float mouseY = 0.5 + InputSubsystem::Instance().GetCursorY() * 0.5;
1173 GClipboardPos = ScreenToWorld(DrawCoord(mouseX, mouseY));
1174 for (int i = 0; i < _template->emptyVehicles.Size(); i++)
1175 {
1176 ArcadeUnitInfo& uInfo = _template->emptyVehicles[i];
1177 if (uInfo.selected)
1178 {
1179 GetGClipboard().emptyVehicles.Add(uInfo);
1180 }
1181 }
1182 for (int i = 0; i < _template->sensors.Size(); i++)
1183 {
1184 ArcadeSensorInfo& sInfo = _template->sensors[i];
1185 if (sInfo.selected)
1186 {
1187 GetGClipboard().sensors.Add(sInfo);
1188 }
1189 }
1190 for (int i = 0; i < _template->markers.Size(); i++)
1191 {
1192 ArcadeMarkerInfo& mInfo = _template->markers[i];
1193 if (mInfo.selected)
1194 {
1195 GetGClipboard().markers.Add(mInfo);
1196 }
1197 }
1198 for (int i = 0; i < _template->groups.Size(); i++)
1199 {
1200 ArcadeGroupInfo& gInfo = _template->groups[i];
1201 bool grpSelected = false;
1202 for (int j = 0; j < gInfo.units.Size(); j++)
1203 {
1204 ArcadeUnitInfo& uInfo = gInfo.units[j];
1205 if (uInfo.selected)
1206 {
1207 grpSelected = true;
1208 break;
1209 }
1210 }
1211 if (!grpSelected)
1212 {
1213 continue;
1214 }
1215 int index = GetGClipboard().groups.Add();
1216 ArcadeGroupInfo& gDest = GetGClipboard().groups[index];
1217 for (int j = 0; j < gInfo.units.Size(); j++)
1218 {
1219 ArcadeUnitInfo& uInfo = gInfo.units[j];
1220 if (uInfo.selected)
1221 {
1222 gDest.units.Add(uInfo);
1223 }
1224 }
1225 for (int j = 0; j < gInfo.sensors.Size(); j++)

Callers

nothing calls this directly

Calls 8

SelectLeaderFunction · 0.85
CheckSynchroMethod · 0.80
ClearMethod · 0.45
GetCursorXMethod · 0.45
GetCursorYMethod · 0.45
SizeMethod · 0.45
AddMethod · 0.45
CompactMethod · 0.45

Tested by

no test coverage detected