Skip to content

Commit

Permalink
Equipment screen add upgrade info toggle button
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd committed Aug 30, 2024
1 parent eea35a8 commit fda5609
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 14 deletions.
1 change: 1 addition & 0 deletions data/de/labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3729,6 +3729,7 @@
<entry key='buildings.vocational_institute.desc'>With the help of well trained workforce, factories on the planet will increase their output by 1.5x and worker requirements of other buildings will be decreased too.</entry>
<entry key='buildings.university'>University</entry>
<entry key='buildings.university.desc'>With the help of well trained scientists, research centers on the planet will work 1.5x faster and worker requirements of other buildings will be decreased too.</entry>
<entry key='equipment.upgrade_toggle_info.tooltip'>Toggle the list of equipments and the amount you have to produce in order to fully upgrade the current fleet or planet.[n]Shortcut: [c=FFFFFFFF]U[/c]</entry>
<entry key=""></entry>
<entry key=""></entry>
<entry key=""></entry>
Expand Down
1 change: 1 addition & 0 deletions data/en/labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3671,4 +3671,5 @@
<entry key='equipment.sell_button.tooltip'>Hold [c=FFFFFFFF]SHIFT[/c] to sell 10</entry>
<entry key='buildings.water_vaporator.upgrade_1'>Increases the population growth to 140%, morale by 150%, worker demand and energy usage by 150%.</entry>
<entry key='buildings.water_vaporator.upgrade_2'>Increases the population growth to 180%, morale by 200%, energy usage by 200% and worker demand by 175%.</entry>
<entry key='equipment.upgrade_toggle_info.tooltip'>Toggle the list of equipments and the amount you have to produce in order to fully upgrade the current fleet or planet.[n]Shortcut: [c=FFFFFFFF]U[/c]</entry>
</labels>
1 change: 1 addition & 0 deletions data/es/labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3621,4 +3621,5 @@
<entry key="buildings.vocational_institute.desc">Con la ayuda de mano de obra bien formada, las fábricas del planeta aumentarán su producción en 1,5 veces y las necesidades de mano de obra de otros edificios también disminuirán.</entry>
<entry key="buildings.university">Universidad</entry>
<entry key="buildings.university.desc">Con la ayuda de científicos bien formados, los centros de investigación del planeta funcionarán 1,5 veces más rápido y las necesidades de mano de obra de otros edificios también disminuirán.</entry>
<entry key='equipment.upgrade_toggle_info.tooltip'>Toggle the list of equipments and the amount you have to produce in order to fully upgrade the current fleet or planet.[n]Shortcut: [c=FFFFFFFF]U[/c]</entry>
</labels>
1 change: 1 addition & 0 deletions data/fr/labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3632,4 +3632,5 @@
<entry key='buildings.vocational_institute.desc'>With the help of well trained workforce, factories on the planet will increase their output by 1.5x and worker requirements of other buildings will be decreased too.</entry>
<entry key='buildings.university'>University</entry>
<entry key='buildings.university.desc'>With the help of well trained scientists, research centers on the planet will work 1.5x faster and worker requirements of other buildings will be decreased too.</entry>
<entry key='equipment.upgrade_toggle_info.tooltip'>Toggle the list of equipments and the amount you have to produce in order to fully upgrade the current fleet or planet.[n]Shortcut: [c=FFFFFFFF]U[/c]</entry>
</labels>
1 change: 1 addition & 0 deletions data/hu/labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3704,4 +3704,5 @@
<entry key='equipment.sell_button.tooltip'>A [c=FFFFFFFF]SHIFT[/c] billentyű tartása mellett 10 eladása</entry>
<entry key='buildings.water_vaporator.upgrade_1'>Megnöveli a lakosság-növekedés mértékét 140%-ra, a morált 150%-kal, a munkás és energiaigényt 150%-kal.</entry>
<entry key='buildings.water_vaporator.upgrade_2'>Megnöveli a lakosság-növekedés mértékét 180%-ra, a morált 200%-kal, az energiaigényt 200%-kal és a munkásigényt 175%-kal.</entry>
<entry key='equipment.upgrade_toggle_info.tooltip'>A gyártandó felszerelések listájának és mennyiségeinek mutatása vagy elrejtése.[n]Gyorsbillentyű: [c=FFFFFFFF]U[/c]</entry>
</labels>
1 change: 1 addition & 0 deletions data/ru/labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3690,4 +3690,5 @@
<entry key='buildings.vocational_institute.desc'>With the help of well trained workforce, factories on the planet will increase their output by 1.5x and worker requirements of other buildings will be decreased too.</entry>
<entry key='buildings.university'>University</entry>
<entry key='buildings.university.desc'>With the help of well trained scientists, research centers on the planet will work 1.5x faster and worker requirements of other buildings will be decreased too.</entry>
<entry key='equipment.upgrade_toggle_info.tooltip'>Toggle the list of equipments and the amount you have to produce in order to fully upgrade the current fleet or planet.[n]Shortcut: [c=FFFFFFFF]U[/c]</entry>
</labels>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions open-ig-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<comment>Open Imperium Galactica Configuration</comment>
<entry key="fileName">open-ig-config.xml</entry>
<entry key="tileCacheBuildingLimit">10</entry>
<entry key="researchMoneyPercent">1000</entry>
<entry key="researchMoneyPercent">2000</entry>
<entry key="language">hu</entry>
<entry key="videoVolume">100</entry>
<entry key="showBuildingName">true</entry>
Expand All @@ -13,24 +13,24 @@
<entry key="hostPorts-count">0</entry>
<entry key="textCacheSize">0</entry>
<entry key="intro">false</entry>
<entry key="height">644</entry>
<entry key="muteMusic">false</entry>
<entry key="height">522</entry>
<entry key="muteMusic">true</entry>
<entry key="reequipTanks">true</entry>
<entry key="timestep">30</entry>
<entry key="scaleAllScreens">false</entry>
<entry key="aiGroundAttackMixed">true</entry>
<entry key="showStarmapScroll">true</entry>
<entry key="maximized">true</entry>
<entry key="maximized">false</entry>
<entry key="classicControls">false</entry>
<entry key="allowWeather">true</entry>
<entry key="allowWeather">false</entry>
<entry key="fullScreen">false</entry>
<entry key="uiScale">100</entry>
<entry key="hostUPnP">false</entry>
<entry key="buildingTextBackgrounds">true</entry>
<entry key="spacewarFreeformMovement">false</entry>
<entry key="useStandardFonts">false</entry>
<entry key="spacewarDiminishingAttach">true</entry>
<entry key="left">158</entry>
<entry key="left">677</entry>
<entry key="aiAllowBuildingUpgrades">false</entry>
<entry key="tileCacheSize">0</entry>
<entry key="autoBuildLimit">20000</entry>
Expand All @@ -43,15 +43,15 @@
<entry key="animateInventory">true</entry>
<entry key="showStarmapMinimap">true</entry>
<entry key="buttonSounds">true</entry>
<entry key="autoDisplayObjectives">true</entry>
<entry key="autoDisplayObjectives">false</entry>
<entry key="muteVideo">false</entry>
<entry key="autoRepairLimit">10000</entry>
<entry key="autoRepairLimit">0</entry>
<entry key="showTooltips">true</entry>
<entry key="disableD3D">false</entry>
<entry key="joinPorts-count">0</entry>
<entry key="slowOnEnemyAttack">true</entry>
<entry key="showStarmapInfo">true</entry>
<entry key="top">107</entry>
<entry key="top">349</entry>
<entry key="showStarmapLists">true</entry>
<entry key="radarUnion">true</entry>
<entry key="aiGroundAttackEverything">true</entry>
Expand All @@ -66,15 +66,15 @@
<entry key="disableDirectDraw">false</entry>
<entry key="computerVoiceScreen">true</entry>
<entry key="productionHistoryLimit">10</entry>
<entry key="automaticBattle">false</entry>
<entry key="automaticBattle">true</entry>
<entry key="movieClickSkip">true</entry>
<entry key="joinAddresses-count">0</entry>
<entry key="dayNightCycle">true</entry>
<entry key="aiAutoBuildProduction">true</entry>
<entry key="aiAutoBuildProduction">false</entry>
<entry key="computerVoiceNotify">true</entry>
<entry key="aiGroundAttackGetCloser">true</entry>
<entry key="swapMouseButtons">false</entry>
<entry key="width">1179</entry>
<entry key="width">656</entry>
<entry key="ignore-count">0</entry>
<entry key="disableOpenGL">false</entry>
<entry key="customCursors">true</entry>
Expand Down
3 changes: 3 additions & 0 deletions src/hu/openig/gfx/EquipmentGFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ public class EquipmentGFX {
/** Upgrade everything button. */
@Btn2(name = "equipment/button_upgrade_all")
public BufferedImage[] upgradeAll;
/** Upgrade info toggle button. */
@Btn2(name = "equipment/button_upgrade_info_toggle")
public BufferedImage[] upgradeInfoToggle;
/** No flagship. */
@Img(name = "equipment/label_no_flagship")
public BufferedImage noFlagship;
Expand Down
19 changes: 17 additions & 2 deletions src/hu/openig/screen/items/EquipmentScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ public class EquipmentScreen extends ScreenBase implements EquipmentScreenAPI {
boolean planetVisible;
/** Upgrade all medium and large ships with the available best equipment. */
UIImageButton upgradeAll;
/** Toggle the display of demands for newer equipment. */
UIImageButton upgradeInfoToggle;
/** The global planet statistics. */
private PlanetStatistics statistics;
/** Displays a demands for newer equipment. */
Expand Down Expand Up @@ -826,6 +828,14 @@ public void invoke() {
}
};

upgradeInfoToggle = new UIImageButton(commons.equipment().upgradeInfoToggle);
upgradeInfoToggle.onClick = new Action0() {
@Override
public void invoke() {
upgradeVisible = !upgradeVisible;
}
};

add(leftFighterCells);
add(rightFighterCells);
add(leftTankCells);
Expand Down Expand Up @@ -1115,6 +1125,7 @@ public void onResize() {
deleteButton.location(sell.x - sell.width * 3 / 2, sell.y);

upgradeAll.location(deleteButton.location());
upgradeInfoToggle.location(deleteButton.location().x + upgradeAll.width + 2, deleteButton.location().y);

}
@Override
Expand Down Expand Up @@ -1520,6 +1531,7 @@ void update() {
void updateFleet(Fleet f) {
// -----------------------------
setTooltip(upgradeAll, "equipment.upgrade_fleet.tooltip");
setTooltip(upgradeInfoToggle, "equipment.upgrade_toggle_info.tooltip");
// -----------------------------

ResearchType rt = research();
Expand Down Expand Up @@ -1754,10 +1766,9 @@ void updateFleet(Fleet f) {
sell.visible(false);
}
upgradeAll.visible(own && secondary == null && ps.hasMilitarySpaceport

&& mayUpgradeAll(f)

);
upgradeInfoToggle.visible(upgradeAll.visible());

if (configure.selectedSlot != null) {
addOne.visible(
Expand All @@ -1778,6 +1789,7 @@ && mayUpgradeAll(f)
removeOne.visible(false);
sell.visible(false);
upgradeAll.visible(false);
upgradeInfoToggle.visible(false);
}
} else {
addButton.visible(false);
Expand All @@ -1786,6 +1798,7 @@ && mayUpgradeAll(f)
removeOne.visible(false);
sell.visible(false);
upgradeAll.visible(false);
upgradeInfoToggle.visible(false);
}

splitButton.visible(own && control && secondary == null && fs.battleshipCount + fs.cruiserCount + fs.fighterCount + fs.vehicleCount > 1);
Expand All @@ -1800,6 +1813,7 @@ void updatePlanet() {

// -----------------------------
setTooltip(upgradeAll, "equipment.upgrade_planet.tooltip");
setTooltip(upgradeInfoToggle, "equipment.upgrade_toggle_info.tooltip");
// -----------------------------

PlanetStatistics ps = planet().getStatistics();
Expand All @@ -1810,6 +1824,7 @@ void updatePlanet() {
notYourPlanet.visible(!own);
noPlanetNearby.visible(false);
upgradeAll.visible(own && mayUpgradeAll(planet()));
upgradeInfoToggle.visible(upgradeAll.visible());

if (planetShown != planet() || lastSelection != player().selectionMode) {
planetShown = planet();
Expand Down

0 comments on commit fda5609

Please sign in to comment.