MCPcopy Create free account
hub / github.com/SimHacker/micropolis / toolDown

Method toolDown

MicropolisCore/src/MicropolisEngine/src/tool.cpp:1487–1506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1485
1486
1487void Micropolis::toolDown(EditingTool tool, short tileX, short tileY)
1488{
1489 ToolResult result = doTool(tool, tileX, tileY);
1490
1491 if (result == TOOLRESULT_NEED_BULLDOZE) {
1492 sendMessage(MESSAGE_BULLDOZE_AREA_FIRST, NOWHERE, NOWHERE, false, true);
1493 /// @todo: Multi player: This sound should only be heard by the user
1494 /// who called this function.
1495 makeSound("interface", "UhUh", tileX <<4, tileY <<4);
1496
1497 } else if (result == TOOLRESULT_NO_MONEY) {
1498 sendMessage(MESSAGE_NOT_ENOUGH_FUNDS, NOWHERE, NOWHERE, false, true);
1499 /// @todo: Multi player: This sound should only be heard by the user
1500 /// who called this function.
1501 makeSound("interface", "Sorry", tileX <<4, tileY <<4);
1502 }
1503
1504 simPass = 0;
1505 invalidateMaps();
1506}
1507
1508/**
1509 * Drag a tool from (\a fromX, \a fromY) to (\a toX, \a toY).

Callers 2

handleMouseDownMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected