Skip to content

Commit

Permalink
Merge branch 'master' into utilities-in-gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
rjhancock authored Jul 20, 2024
2 parents e4e522c + ffcccdf commit 7a53366
Show file tree
Hide file tree
Showing 29 changed files with 257 additions and 47 deletions.
Binary file modified megamek/data/images/hexes/artyhit.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added megamek/data/images/hexes/artymiss.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added megamek/data/images/hexes/bombhit.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added megamek/data/images/hexes/bombmiss.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added megamek/data/images/misc/Archives/artyhit.old
Binary file not shown.
Binary file added megamek/data/images/misc/Archives/artyhit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added megamek/data/images/misc/Archives/artymiss.old
Binary file not shown.
Binary file added megamek/data/images/misc/Archives/bombhit.old
Binary file not shown.
Binary file added megamek/data/images/misc/Archives/bombhit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added megamek/data/images/misc/Archives/bombmiss.old
Binary file not shown.
Binary file added megamek/data/images/misc/Archives/bombmiss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 13 additions & 18 deletions megamek/data/mechfiles/mechs/3050U/Grasshopper GHR-7K.mtf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
generator:MegaMek Suite 0.50.0-SNAPSHOT on 2024-07-18
chassis:Grasshopper
model:GHR-7K
mul id:1270
Expand All @@ -9,11 +10,8 @@ source:TRO: 3050
rules level:2
role:Skirmisher



quirk:rugged_1


mass:70
engine:280 Fusion Engine(IS)
structure:IS Endo Steel
Expand All @@ -37,8 +35,8 @@ RTR armor:10
RTC armor:13

Weapons:5
Light PPC, Left Arm
Light PPC, Right Arm
Light PPC, Left Arm
Snub-Nose PPC, Left Torso
Snub-Nose PPC, Right Torso
ER Medium Laser, Head
Expand All @@ -48,14 +46,14 @@ Shoulder
Upper Arm Actuator
Lower Arm Actuator
Hand Actuator
ISDoubleHeatSink
ISDoubleHeatSink
ISDoubleHeatSink
Light PPC
Light PPC
IS Endo Steel
IS Endo Steel
IS Endo Steel
IS Endo Steel
-Empty-
-Empty-

Right Arm:
Shoulder
Expand All @@ -80,24 +78,24 @@ ISDoubleHeatSink
ISDoubleHeatSink
ISSNPPC
ISSNPPC
ISC3SlaveUnit
IS Endo Steel
IS Endo Steel
IS Endo Steel
IS Endo Steel
-Empty-

Right Torso:
ISDoubleHeatSink
ISDoubleHeatSink
ISDoubleHeatSink
ISDoubleHeatSink
ISDoubleHeatSink
ISDoubleHeatSink
ISSNPPC
ISSNPPC
ISC3SlaveUnit
IS Endo Steel
IS Endo Steel
IS Endo Steel
IS Endo Steel
IS Endo Steel
IS Endo Steel
-Empty-

Center Torso:
Fusion Engine
Expand Down Expand Up @@ -156,18 +154,15 @@ Jump Jet
-Empty-

overview:Originally intended as a stealthy hunter-killer of light and medium 'Mechs for the SLDF, the Grasshopper entered service in 2780 after hostilities had already ceased in the Amaris Civil War.

capabilities:With great mobility and a predominately shorter-ranged, energy-based weaponry, the Grasshopper proved itself during the First Succession War. The 'Mech's ground speed of 64.8 km/h was augmented by four Leviathan Lifter jump jets, one pair in each leg, giving it a jumping capability of one hundred and twenty meters. Revolutionary for its time, the appearance of a heavy 'Mech with the mobility of a lighter design caused a change in tactics; the Grasshopper became known for using surprise and speed to appear suddenly in the midst of a tightly-packed Lance, a devastating situation should the enemy lack short-ranged weapons themselves. The use of twenty-two heat sinks also gave it superior heat dissipation rates compared to other heavy 'Mechs, while its low dependence on ammunition allowed the Grasshopper to operate away from established supply lines for extended periods of time. Though it could be outgunned by other 'Mechs of similar tonnage, the combination of its mobility and thirteen tons of standard armor allowed the Grasshopper to at least inflict significant damage before being forced to withdraw. Finally, mounting its primary weapon in its center torso meant the Grasshopper remained combat-capable despite suffering crippling damage, including losing both arms, leading many to classify it as a "zombie" 'Mech.

deployment:An upgrade of the 6K introduced in 3068, the 7K replaces the weapons with an eye toward making the Grasshopper independent of supply concerns common during the Jihad. Two arm-mounted Light PPCs provide long-range firepower, while short-range firepower is provided by twin torso-mounted Snub-Nose PPCs. A head-mounted ER Medium Laser takes the place of the 6K's Streak launcher, while the addition of a Guardian ECM Suite and C3 slave unit makes this Grasshopper a difficult-to-detect guerrilla fighter.

history:Problems integrating the original stealth systems with the chassis meant the Grasshopper missed the climactic end to the conflict. The stealth systems were ultimately removed from the final design. The untested and unorthodox 'Mech was distributed primarily to the regular army rather than the more prestigious Royal units, and within four years it could be found in most Star League regiments. Thus as the League dissolved, with the chaos of Operation EXODUS and the defection of many SLDF units to the Successor States, Grasshoppers found their way into the various House armies one way or another. Besides hunting down lighter machines to clear the way for heavier, less-mobile 'Mechs, the Grasshopper's mobility and endurance meant it often spearheaded assaults to storm fortifications, led flanking attacks to hit the enemy from the rear, and served as back-up brawler for companies of light and medium 'Mechs. Its ability to operate independently made it an excellent choice as a raider and guerrilla fighter, an attribute also prized by mercenary units in need of self-reliant 'Mechs. While popular the Grasshopper was also an uncommon sight during the Succession Wars, causing many commanders to mistakenly treat it as just another heavy 'Mech. By the time they realized their mistake it was too late, though following ComStar's publication of Technical Readout: 3025 military leaders became more familiar with the 'Mech. In the midst of the Second Succession War the Lantren Corporation's factory on Bryant was destroyed in 2843, a result of worsening global storms and damage inflicted during the conflict, causing production of the 'Mech to cease. However, the Grasshopper was usually prioritized over other 'Mechs, even a unit commander's own, when it came time to repair and rebuild after a battle. Thus most of the original production run was still in active duty even after centuries of use. Lantren Corporation would eventually introduce a new variant in 3049, the GHR-5J, which upgraded many of its original systems with superior lostech components. Yet the original model was so popular that it would still outnumber the -5J for decades to come by a ratio of three to one. Only when the Draconis Combine introduced their own C3 variant that trend began to reverse. Further variants were introduced in the years following, and the Grasshopper participated in many conflicts, including both sides of the Jihad.

manufacturer:LexaTech Industries
manufacturer:LexaTech Industries
primaryfactory:Hun Ho
systemmanufacturer:CHASSIS:Mingh z33/9 Endo Steel
systemmanufacturer:ENGINE:VOX 280
systemmanufacturer:ARMOR:Maximillian 100
systemmanufacturer:JUMPJET:Lexington Lifters
systemmanufacturer:COMMUNICATIONS:Allet-C308 with ECM
systemmanufacturer:TARGETING:Allet T-11

1 change: 1 addition & 0 deletions megamek/docs/history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ MEGAMEK VERSION HISTORY:
+ PR #5743: Lobby: export full chassis to clipboard for meks with clan/is names
+ PR #5702, #5747: Code internals: MMLogger with Sentry Tracking
+ PR #5746: Tweaked FontHandler logging
+ PR #5751: Add "miss" and "drifted"/"hit" markers for Artillery and Bomb attacks, with concomitant client settings

0.49.20 (2024-06-28 2100 UTC) (THIS IS THE LAST VERSION TO SUPPORT JAVA 11)
+ PR #5281, #5327, #5308, #5336, #5318, #5383, #5369, #5384, #5455, #5505, #5541: Code internals: preparatory work for supporting game types such as SBF, code cleanup for string drawing, superclass change for BoardView,
Expand Down
8 changes: 8 additions & 0 deletions megamek/i18n/megamek/client/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,14 @@ CommonSettingsDialog.gameBoard=Game Board
CommonSettingsDialog.buttonOrder=Button Order
CommonSettingsDialog.buttonsPerRow.tooltip=Configures how many buttons are displayed per row for Phase Display button panels.
CommonSettingsDialog.buttonsPerRow=Buttons Per Row
CommonSettingsDialog.hexes.ShowArtilleryMisses=Show Artillery Misses
CommonSettingsDialog.hexes.ShowArtilleryDriftedHits=Show Artillery Drifted Hits
CommonSettingsDialog.hexes.ShowBombMisses=Show Bomb Misses
CommonSettingsDialog.hexes.ShowBombHits=Show Bomb Hits
CommonSettingsDialog.hexes.ShowArtilleryMisses.tooltip=Display "miss" marker where artillery fire was aimed, but missed
CommonSettingsDialog.hexes.ShowArtilleryDriftedHits.tooltip=Display "hit" artillery shots that drifted but landed on the map
CommonSettingsDialog.hexes.ShowBombMisses.tooltip=Display "miss" marker where bombs were dropped but missed their target hex
CommonSettingsDialog.hexes.ShowBombHits.tooltip="Mother Nature just pissed her pantsuit!"
CommonSettingsDialog.colors.BoardSpaceTextColor=Board Space Text Color
CommonSettingsDialog.colors.BoardTextColor=Board Text Color
CommonSettingsDialog.colors.BuildingTextColor=Building Text Color:
Expand Down
5 changes: 4 additions & 1 deletion megamek/i18n/megamek/common/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -594,4 +594,7 @@ PilotingSPA.EnvSpec.WindSpec=Wind Specialist

BeastSize.large=Large
BeastSize.very_large=Very Large
BeastSize.monstrous=Monstrous
BeastSize.monstrous=Monstrous

ArtilleryMessage.drifted=Artillery drifted here
BombMessage.drifted=Bomb drifted here
6 changes: 5 additions & 1 deletion megamek/src/megamek/client/ui/swing/BombPayloadDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void initialize(JFrame parent, String title, int[] b,
c.gridwidth = 4;
c.gridheight = 1;
c.gridx = 0;
c.gridy = 0;
//c.gridy = 0;
c.insets = new Insets(5, 5, 5, 5);

description = new JLabel();
Expand Down Expand Up @@ -156,10 +156,12 @@ private void initialize(JFrame parent, String title, int[] b,
c.gridy = i+1;
c.anchor = GridBagConstraints.EAST;
add(b_labels[i], c);
gridbag.setConstraints(b_labels[i], c);
c.gridx = 2;
c.gridy = i+1;
c.anchor = GridBagConstraints.WEST;
add(b_choices[i], c);
gridbag.setConstraints(b_choices[i], c);
}

// Allow the player to confirm or abort the choice.
Expand All @@ -183,10 +185,12 @@ public void windowClosing(WindowEvent e) {
+ (parent.getSize().height / 2)) - (size.height / 2));
}

/**
@Override
public Dimension getPreferredSize() {
return new Dimension(500,200);
}
*/

private void setupButtons() {
butOK.addActionListener(this);
Expand Down
26 changes: 26 additions & 0 deletions megamek/src/megamek/client/ui/swing/CommonSettingsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ private <T> void moveElement(DefaultListModel<T> srcModel, int srcIndex, int trg
private final JCheckBox mouseWheelZoom = new JCheckBox(Messages.getString("CommonSettingsDialog.mouseWheelZoom"));
private final JCheckBox mouseWheelZoomFlip = new JCheckBox(Messages.getString("CommonSettingsDialog.mouseWheelZoomFlip"));

// Bomb and Artillery displays
private final JCheckBox artilleryDisplayMisses = new JCheckBox(Messages.getString("CommonSettingsDialog.hexes.ShowArtilleryMisses"));
private final JCheckBox artilleryDisplayDriftedHits = new JCheckBox(Messages.getString("CommonSettingsDialog.hexes.ShowArtilleryDriftedHits"));
private final JCheckBox bombsDisplayMisses = new JCheckBox(Messages.getString("CommonSettingsDialog.hexes.ShowBombMisses"));
private final JCheckBox bombsDisplayHits = new JCheckBox(Messages.getString("CommonSettingsDialog.hexes.ShowBombHits"));


private final JCheckBox moveDefaultClimbMode = new JCheckBox(Messages.getString("CommonSettingsDialog.moveDefaultClimbMode"));
private ColourSelectorButton csbMoveDefaultColor;
Expand Down Expand Up @@ -677,6 +683,16 @@ private JPanel getGameBoardPanel() {
darkenMapAtNight.setSelected(GUIP.getDarkenMapAtNight());
comps.add(checkboxEntry(translucentHiddenUnits, null));
translucentHiddenUnits.setSelected(GUIP.getTranslucentHiddenUnits());
comps.add(checkboxEntry(artilleryDisplayMisses, Messages.getString("CommonSettingsDialog.hexes.ShowArtilleryMisses.tooltip")));

// Artillery and bomb display choices
artilleryDisplayMisses.setSelected(GUIP.getShowArtilleryMisses());
comps.add(checkboxEntry(artilleryDisplayDriftedHits, Messages.getString("CommonSettingsDialog.hexes.ShowArtilleryDriftedHits.tooltip")));
artilleryDisplayDriftedHits.setSelected(GUIP.getShowArtilleryDrifts());
comps.add(checkboxEntry(bombsDisplayMisses, Messages.getString("CommonSettingsDialog.hexes.ShowBombMisses.tooltip")));
bombsDisplayMisses.setSelected(GUIP.getShowBombMisses());
comps.add(checkboxEntry(bombsDisplayHits, Messages.getString("CommonSettingsDialog.hexes.ShowBombHits.tooltip")));
bombsDisplayHits.setSelected(GUIP.getShowBombHits());

row = new ArrayList<>();

Expand Down Expand Up @@ -1988,6 +2004,11 @@ protected void cancelAction() {
darkenMapAtNight.setSelected(GUIP.getDarkenMapAtNight());
translucentHiddenUnits.setSelected(GUIP.getTranslucentHiddenUnits());

artilleryDisplayMisses.setSelected(GUIP.getShowArtilleryMisses());
artilleryDisplayDriftedHits.setSelected(GUIP.getShowArtilleryDrifts());
bombsDisplayMisses.setSelected(GUIP.getShowBombMisses());
bombsDisplayHits.setSelected(GUIP.getShowBombHits());

for (String option: savedAdvancedOpt.keySet()) {
GUIP.setValue(option, savedAdvancedOpt.get(option));
}
Expand Down Expand Up @@ -2179,6 +2200,11 @@ protected void okAction() {
GUIP.setDarkenMapAtNight(darkenMapAtNight.isSelected());
GUIP.setTranslucentHiddenUnits(translucentHiddenUnits.isSelected());

GUIP.setShowArtilleryMisses(artilleryDisplayMisses.isSelected());
GUIP.setShowArtilleryDrifts(artilleryDisplayDriftedHits.isSelected());
GUIP.setShowBombMisses(bombsDisplayMisses.isSelected());
GUIP.setShowBombHits(bombsDisplayHits.isSelected());

GUIP.setMoveFontType(fontTypeChooserMoveFont.getSelectedItem().toString());
try {
GUIP.setMoveFontSize(Integer.parseInt(moveFontSize.getText()));
Expand Down
40 changes: 40 additions & 0 deletions megamek/src/megamek/client/ui/swing/GUIPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public class GUIPreferences extends PreferenceStoreProxy {
public static final String BOARD_TRANSLUCENT_HIDDEN_UNITS = "BoardTranslucentHiddenUnits";
public static final String BOARD_TMM_PIP_MODE = "BoardTmmPipMode";

public static final String SHOW_ARTILLERY_MISSES = "ShowArtilleryMisses";
public static final String SHOW_ARTILLERY_DRIFTS = "ShowArtilleryHits";
public static final String SHOW_BOMB_MISSES = "ShowBombMisses";
public static final String SHOW_BOMB_HITS = "ShowBombHits";

public static final String UNIT_OVERVIEW_TEXT_SHADOW_COLOR = "UnitOverviewTextShadowColor";
public static final String UNIT_OVERVIEW_CONDITION_SHADOW_COLOR = "UnitOverviewConditionShadowColor";

Expand Down Expand Up @@ -518,6 +523,12 @@ protected GUIPreferences() {
store.setDefault(BOARD_TRANSLUCENT_HIDDEN_UNITS, true);
setDefault(BOARD_TMM_PIP_MODE, 2); // show pips with colors based on move type

store.setDefault(SHOW_ARTILLERY_MISSES, true);
store.setDefault(SHOW_ARTILLERY_DRIFTS, true);
store.setDefault(SHOW_BOMB_MISSES, true);
store.setDefault(SHOW_BOMB_HITS, false);


setDefault(UNIT_OVERVIEW_TEXT_SHADOW_COLOR, Color.black);
setDefault(UNIT_OVERVIEW_CONDITION_SHADOW_COLOR, Color.darkGray);

Expand Down Expand Up @@ -2783,6 +2794,35 @@ public void setTranslucentHiddenUnits(boolean b) {
store.setValue(BOARD_TRANSLUCENT_HIDDEN_UNITS, b);
}

public void setShowArtilleryMisses(boolean b){
store.setValue(SHOW_ARTILLERY_MISSES, b);
}
public boolean getShowArtilleryMisses(){
return getBoolean(SHOW_ARTILLERY_MISSES);
}

public void setShowArtilleryDrifts(boolean b) {
store.setValue(SHOW_ARTILLERY_DRIFTS, b);
}
public boolean getShowArtilleryDrifts(){
return getBoolean(SHOW_ARTILLERY_DRIFTS);
}

public void setShowBombMisses(boolean b) {
store.setValue(SHOW_BOMB_MISSES, b);
}
public boolean getShowBombMisses(){
return getBoolean(SHOW_BOMB_MISSES);
}

public void setShowBombHits(boolean b) {
store.setValue(SHOW_BOMB_HITS, b);
}
public boolean getShowBombHits(){
return getBoolean(SHOW_BOMB_HITS);
}


public int getTMMPipMode() {
return getInt(BOARD_TMM_PIP_MODE);
}
Expand Down
16 changes: 13 additions & 3 deletions megamek/src/megamek/client/ui/swing/boardview/BoardView.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ public final class BoardView extends AbstractBoardView implements BoardListener,
private int scrollYDifference = 0;
// are we drag-scrolling?
private boolean dragging = false;
private boolean wantsPopup = false;

/** True when the right mouse button was pressed to start a drag */
private boolean shouldScroll = false;

Expand Down Expand Up @@ -483,6 +485,9 @@ public void mouseMoved(MouseEvent e) {
disp.isMouseOver(point, drawDimension);
}

// Reset popup flag if the user moves their mouse away
wantsPopup = false;

final Coords mcoords = getCoordsAt(point);
if (!mcoords.equals(lastCoords) && game.getBoard().contains(mcoords)) {
lastCoords = mcoords;
Expand Down Expand Up @@ -593,11 +598,14 @@ public void mouseDragged(MouseEvent e) {
GUIP.addPreferenceChangeListener(this);
KeyBindParser.addPreferenceChangeListener(this);

SpecialHexDisplay.Type.ARTILLERY_MISS.init();
SpecialHexDisplay.Type.ARTILLERY_HIT.init();
SpecialHexDisplay.Type.ARTILLERY_INCOMING.init();
SpecialHexDisplay.Type.ARTILLERY_TARGET.init();
SpecialHexDisplay.Type.ARTILLERY_ADJUSTED.init();
SpecialHexDisplay.Type.ARTILLERY_AUTOHIT.init();
SpecialHexDisplay.Type.BOMB_MISS.init();
SpecialHexDisplay.Type.BOMB_HIT.init();
SpecialHexDisplay.Type.PLAYER_NOTE.init();

fovHighlightingAndDarkening = new FovHighlightingAndDarkening(this);
Expand Down Expand Up @@ -2016,7 +2024,7 @@ private void drawHex(Coords c, Graphics boardGraph, boolean saveBoardImage) {
try {
if (shdList != null) {
for (SpecialHexDisplay shd : shdList) {
if (shd.drawNow(game.getPhase(), game.getRoundCount(), localPlayer)) {
if (shd.drawNow(game.getPhase(), game.getRoundCount(), localPlayer, GUIP)) {
scaledImage = getScaledImage(shd.getType().getDefaultImage(), true);
g.drawImage(scaledImage, 0, 0, boardPanel);
}
Expand Down Expand Up @@ -3776,7 +3784,7 @@ public void mousePressed(MouseEvent me) {
}

if (me.isPopupTrigger() && !dragging) {
mouseAction(getCoordsAt(point), BOARD_HEX_POPUP, me.getModifiersEx(), me.getButton());
wantsPopup = true;
return;
}

Expand All @@ -3799,11 +3807,12 @@ public void mousePressed(MouseEvent me) {
@Override
public void mouseReleased(MouseEvent me) {
// don't show the popup if we are drag-scrolling
if (me.isPopupTrigger() && !dragging) {
if ((me.isPopupTrigger() || wantsPopup) && !dragging) {
mouseAction(getCoordsAt(me.getPoint()), BOARD_HEX_POPUP,
me.getModifiersEx(), me.getButton());
// stop scrolling
shouldScroll = false;
wantsPopup = false;
return;
}

Expand All @@ -3814,6 +3823,7 @@ public void mouseReleased(MouseEvent me) {
scrollYDifference = 0;
dragging = false;
shouldScroll = false;
wantsPopup = false;
boardPanel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public String getTooltip(Point point, Coords movementTarget) {
// The exception is auto hits. There will be an icon for auto
// hits, so we need to draw a tooltip
if (!shd.isObscured(localPlayer)
&& (shd.drawNow(game.getPhase(), round, localPlayer)
&& (shd.drawNow(game.getPhase(), round, localPlayer, GUIP)
|| (isHexAutoHit && isTypeAutoHit))) {
if (shd.getType() == SpecialHexDisplay.Type.PLAYER_NOTE) {
if (Objects.equals(localPlayer, shd.getOwner())) {
Expand Down
Loading

0 comments on commit 7a53366

Please sign in to comment.