Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carry objects #5706

Merged
merged 40 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d832beb
backing structures and player config
NickAragua Jul 8, 2024
49921d6
Merge branch 'master' of https://github.com/MegaMek/megamek
NickAragua Jul 8, 2024
ddd16b7
wtf is this nonsense
NickAragua Jul 8, 2024
a042635
minefield display refactor
NickAragua Jul 8, 2024
0e26a51
deploy minefield refactor
NickAragua Jul 9, 2024
7640d7d
minefield deployment component; start of gui display
NickAragua Jul 10, 2024
c20172a
sprite display minus actual icon
NickAragua Jul 10, 2024
09c325e
pick up command on client side
NickAragua Jul 11, 2024
93e386f
refactor minefield display popup
NickAragua Jul 11, 2024
5e8d0ff
remove unnecessary dialog class
NickAragua Jul 11, 2024
812af5f
server side processing; firing restrictions
NickAragua Jul 11, 2024
fb6cb51
push tuning
NickAragua Jul 12, 2024
0d7a8cc
adjustments
NickAragua Jul 12, 2024
ca54306
drop button work
NickAragua Jul 12, 2024
e2d10c4
Merge branch 'master' into carry_objects
NickAragua Jul 16, 2024
c261387
drop object; display fix
NickAragua Jul 17, 2024
6527a4c
drop; status
NickAragua Jul 17, 2024
b38812d
cargo damage from incoming attacks
NickAragua Jul 18, 2024
100b74c
further firing restrictions, dialog fix
NickAragua Jul 18, 2024
6e3454c
some changes I don't really remember
NickAragua Jul 19, 2024
e1fa637
fix NPE; add flee message
NickAragua Jul 19, 2024
f01c9e5
weapons fire cannot damage invulnerable cargo
NickAragua Jul 19, 2024
7fa284b
Merge branch 'master' into carry_objects
NickAragua Jul 22, 2024
1e096ee
no negative numbers; 20 char limit for object name
NickAragua Jul 22, 2024
69cb27d
add report for falling
NickAragua Jul 24, 2024
85a6709
actually drop cargo when knocked over
NickAragua Jul 24, 2024
81e1ba8
cleanup
NickAragua Jul 24, 2024
20be2aa
drop cargo on entity destruction (for any reason)
NickAragua Jul 24, 2024
552ff62
refactor into btobject hierarchy
NickAragua Jul 26, 2024
9060f46
work entity sprites in BoardView into allSprites processing
SJuliez Jul 26, 2024
bd2c3d3
work entity sprites in BoardView into allSprites processing
SJuliez Jul 26, 2024
d1e3b83
make IsometricSprites HexSprites
SJuliez Jul 26, 2024
bdb5152
restore toString method
NickAragua Jul 26, 2024
da2c0cc
clean up, draw transparent iso sprite again
SJuliez Jul 26, 2024
1cc47e5
clean up
SJuliez Jul 26, 2024
ae91fb9
Merge branch 'master' of https://github.com/MegaMek/megamek into carr…
NickAragua Jul 28, 2024
9b4908e
Merge branch 'ent-sprites-in-allsprites' of https://github.com/SJulie…
NickAragua Jul 28, 2024
e6a1a2a
sprite scaling; unit tooltip
NickAragua Jul 28, 2024
4c60b46
adjust report ordering
NickAragua Jul 28, 2024
6b48dd4
InGameobject; pick up correct object when it's not first in list
NickAragua Jul 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added megamek/data/images/misc/cargo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions megamek/i18n/megamek/client/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,8 @@ DeployMinefieldDisplay.its_your_turn=It's your turn to deploy minefields.
DeployMinefieldDisplay.removeMines=Remove
DeployMinefieldDisplay.waitingForDeploymentPhase=Waiting to begin Deployment phase...
DeployMinefieldDisplay.waitingForDeployMinefieldPhase=Waiting to begin Deploy minefield phase...
DeployMinefieldDisplay.deployCarriable=Cargo({0})
DeployMinefieldDisplay.deployCarriableDialogHeader=Deploy Ground Object

#Expand Map Dialog
ExpandMapDialog.title=Expand map settings
Expand Down Expand Up @@ -2422,6 +2424,8 @@ MovementDisplay.butLoad=Load
MovementDisplay.butLand=Land
MovementDisplay.butJoin=Join
MovementDisplay.butManeuver=Maneuver
MovementDisplay.moveDropCargo=Drop Cargo
MovementDisplay.movePickupCargo=Pick Up Cargo
MovementDisplay.moveModeConvert=Convert Mode
MovementDisplay.moveModeLeg=Walk
MovementDisplay.moveModeTrack=Engage tracks
Expand Down Expand Up @@ -2866,6 +2870,7 @@ PlayerSettingsDialog.header.initMod=Initiative Modifier
PlayerSettingsDialog.header.minefields=Minefields
PlayerSettingsDialog.header.skills=Method for Rolling Pilot Skills
PlayerSettingsDialog.header.email=Round Report Email
PlayerSettingsDialog.header.GroundObjects=Carryable Ground Objects
PlayerSettingsDialog.botSettings=Bot Settings...
PlayerSettingsDialog.autoConfigFaction=Faction:
PlayerSettingsDialog.autoConfig=Autoconfig
Expand Down Expand Up @@ -3925,6 +3930,8 @@ WeaponAttackAction.BPodAtInf=B-Pod firing at infantry
WeaponAttackAction.BPodOnlyAtInf=B-Pods can't target non-infantry.
WeaponAttackAction.CantAimAndCallShots=you can't combine aimed shots and called shots.
WeaponAttackAction.CantClearMines=Weapon can't clear minefields.
WeaponAttackAction.CantFireWhileCarryingCargo=Carrying cargo prevents arm/torso weapon firing.
WeaponAttackAction.CantFireWhileLoadingUnloadingCargo=Cannot fire weapons while loading/unloading cargo.
WeaponAttackAction.CantFireWhileGrappled=Can only fire head and front torso weapons when grappled.
WeaponAttackAction.CantFireWithOtherWeapons=Already firing a weapon that can only be fired by itself! (%s)
WeaponAttackAction.CantFireArmsAndMainGun=Can't fire arm-mounted weapons and the main gun in the same turn.
Expand Down
9 changes: 9 additions & 0 deletions megamek/i18n/megamek/common/report-messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@
2510=, <span class='warning'>Starts to flip.</span>
2511=, <span class='warning'>Capsizes and sinks.</span>
2512=<data> deploys a chaff pod.
2513=<data> loads <data> from <data>.
2514=<data> unloads <data> in <data>
2515=<data> attempts to drop <data>. Needs <data>, rolls <data> : <msg:2516,2517>
2516=<span class='success'>success</span> - cargo placed on the ground.
2517=<span class='warning'>failure</span> - cargo destroyed!

3000=<newline><B>Weapon Attack Phase</B><newline>-------------------
3003=Inferno fire (bombs) started in hex <data>.
Expand Down Expand Up @@ -980,6 +985,10 @@
6700=Limb Blow off avoided due to armored actuator.
6710=Critical hit to <data> avoided due to armored component.

#cargo reports.
6720=<data> damaged by incoming attack. <data> tons remaining.
6721=<data> damaged by incoming attack and is completely destroyed.

6800=<data> (<data>) was not properly secured prior to takeoff.

7000=<newline><B>Victory!</B><newline>-------------------<newline>
Expand Down
16 changes: 16 additions & 0 deletions megamek/src/megamek/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,13 @@ public void sendAddSquadron(FighterSquadron fs, Collection<Integer> fighterIds)
public void sendDeployMinefields(Vector<Minefield> minefields) {
send(new Packet(PacketCommand.DEPLOY_MINEFIELDS, minefields));
}

/**
* Sends an updated state of ground objects (i.e. cargo etc)
*/
public void sendDeployGroundObjects(Map<Coords, List<ICarryable>> groundObjects) {
send(new Packet(PacketCommand.UPDATE_GROUND_OBJECTS, groundObjects));
}

/**
* Sends a "set Artillery Autohit Hexes" packet
Expand Down Expand Up @@ -574,6 +581,12 @@ protected void receiveEntityVisibilityIndicator(Packet packet) {
game.processGameEvent(new GameEntityChangeEvent(this, e));
}
}

@SuppressWarnings("unchecked")
protected void receiveUpdateGroundObjects(Packet packet) {
game.setGroundObjects((Map<Coords, List<ICarryable>>) packet.getObject(0));
game.processGameEvent(new GameBoardChangeEvent(this));
}

@SuppressWarnings("unchecked")
protected void receiveDeployMinefields(Packet packet) {
Expand Down Expand Up @@ -883,6 +896,9 @@ protected boolean handleGameSpecificPacket(Packet packet) {
case REMOVE_MINEFIELD:
receiveRemoveMinefield(packet);
break;
case UPDATE_GROUND_OBJECTS:
receiveUpdateGroundObjects(packet);
break;
case ADD_SMOKE_CLOUD:
SmokeCloud cloud = (SmokeCloud) packet.getObject(0);
game.addSmokeCloud(cloud);
Expand Down
17 changes: 14 additions & 3 deletions megamek/src/megamek/client/ui/swing/ClientGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ public class ClientGUI extends AbstractClientGUI implements BoardViewListener,
private MovementModifierSpriteHandler movementModifierSpriteHandler;
private SensorRangeSpriteHandler sensorRangeSpriteHandler;
private CollapseWarningSpriteHandler collapseWarningSpriteHandler;
private GroundObjectSpriteHandler groundObjectSpriteHandler;
private FiringSolutionSpriteHandler firingSolutionSpriteHandler;
private FiringArcSpriteHandler firingArcSpriteHandler;

Expand Down Expand Up @@ -490,12 +491,13 @@ private void initializeSpriteHandlers() {
FlareSpritesHandler flareSpritesHandler = new FlareSpritesHandler(bv, client.getGame());
sensorRangeSpriteHandler = new SensorRangeSpriteHandler(bv, client.getGame());
collapseWarningSpriteHandler = new CollapseWarningSpriteHandler(bv);
groundObjectSpriteHandler = new GroundObjectSpriteHandler(bv, client.getGame());
firingSolutionSpriteHandler = new FiringSolutionSpriteHandler(bv, client);
firingArcSpriteHandler = new FiringArcSpriteHandler(bv, this);

spriteHandlers.addAll(List.of(movementEnvelopeHandler, movementModifierSpriteHandler,
sensorRangeSpriteHandler, flareSpritesHandler, collapseWarningSpriteHandler,
firingSolutionSpriteHandler, firingArcSpriteHandler));
groundObjectSpriteHandler, firingSolutionSpriteHandler, firingArcSpriteHandler));
spriteHandlers.forEach(BoardViewSpriteHandler::initialize);
}

Expand Down Expand Up @@ -1177,7 +1179,7 @@ void switchPanel(GamePhase phase) {
// otherwise, hide the panel
panSecondary.setVisible(false);
}

// Set the new panel's listeners
if (curPanel instanceof BoardViewListener) {
bv.addBoardViewListener((BoardViewListener) curPanel);
Expand Down Expand Up @@ -2912,11 +2914,20 @@ public void showSensorRanges(Entity entity, Coords assumedPosition) {
/**
* Shows collapse warnings in the given list of Coords in the BoardView
*
* @param warnList The Coords to show the warning on
* @param warnList The list of coordinates to show the warning on
*/
public void showCollapseWarning(List<Coords> warnList) {
collapseWarningSpriteHandler.setCFWarningSprites(warnList);
}

/**
* Shows ground object icons in the given list of Coords in the BoardView
*
* @param groundObjectList The list of coordinates to show
*/
public void showGroundObjects(Map<Coords, List<ICarryable>> groundObjectList) {
groundObjectSpriteHandler.setGroundObjectSprites(groundObjectList);
}

/**
* Shows firing solutions from the viewpoint of the given entity on targets
Expand Down
Loading
Loading