Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Run this command in a CMD window [**as admin**](https://www.howtogeek.com/howto/

## Contributing

See [CONTRIBUTING](CONTRIBUTING.md).
See [CONTRIBUTING](https://github.com/Anuken/Mindustry/blob/master/CONTRIBUTING.md).

## Building

Expand Down
2 changes: 2 additions & 0 deletions core/assets/bundles/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,8 @@ setting.playerlimit.name = Player Limit
setting.chatopacity.name = Chat Opacity
setting.lasersopacity.name = Power Laser Opacity
setting.bridgeopacity.name = Bridge Opacity
setting.schemalpha.name = Schema Opacity
setting.placeopacity.name = Place Opacity
setting.playerchat.name = Display Player Bubble Chat
setting.showweather.name = Show Weather Graphics
setting.hidedisplays.name = Hide Logic Displays
Expand Down
2 changes: 2 additions & 0 deletions core/assets/bundles/bundle_et.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,8 @@ setting.playerlimit.name = Player Limit
setting.chatopacity.name = Vestlusakna läbipaistmatus
setting.lasersopacity.name = Power Laser Opacity
setting.bridgeopacity.name = Bridge Opacity
setting.schemalpha.name = Schema Opacity
setting.placeopacity.name = Place Opacity
setting.playerchat.name = Näita mängusisest vestlusakent
setting.showweather.name = Show Weather Graphics
setting.hidedisplays.name = Hide Logic Displays
Expand Down
2 changes: 2 additions & 0 deletions core/assets/bundles/bundle_eu.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,8 @@ setting.playerlimit.name = Player Limit
setting.chatopacity.name = Txataren opakotasuna
setting.lasersopacity.name = Energia laserraren opakutasuna
setting.bridgeopacity.name = Bridge Opacity
setting.schemalpha.name = Schema Opacity
setting.placeopacity.name = Place Opacity
setting.playerchat.name = Erakutsi jolas barneko txata
setting.showweather.name = Show Weather Graphics
setting.hidedisplays.name = Hide Logic Displays
Expand Down
2 changes: 2 additions & 0 deletions core/assets/bundles/bundle_fil.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,8 @@ setting.playerlimit.name = Player Limit
setting.chatopacity.name = Chat Opacity
setting.lasersopacity.name = Power Laser Opacity
setting.bridgeopacity.name = Bridge Opacity
setting.schemalpha.name = Schema Opacity
setting.placeopacity.name = Place Opacity
setting.playerchat.name = Ipakita Player Bubble Chat
setting.showweather.name = Show Weather Graphics
setting.hidedisplays.name = Hide Logic Displays
Expand Down
2 changes: 2 additions & 0 deletions core/assets/bundles/bundle_nl_BE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,8 @@ setting.playerlimit.name = Player Limit
setting.chatopacity.name = Chat Opacity
setting.lasersopacity.name = Power Laser Opacity
setting.bridgeopacity.name = Bridge Opacity
setting.schemalpha.name = Schema Opacity
setting.placeopacity.name = Place Opacity
setting.playerchat.name = Display In-Game Chat
setting.showweather.name = Show Weather Graphics
setting.hidedisplays.name = Hide Logic Displays
Expand Down
2 changes: 2 additions & 0 deletions core/assets/bundles/bundle_sv.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,8 @@ setting.playerlimit.name = Player Limit
setting.chatopacity.name = Chattgenomskinlighet
setting.lasersopacity.name = Power Laser Opacity
setting.bridgeopacity.name = Bridge Opacity
setting.schemalpha.name = Schema Opacity
setting.placeopacity.name = Place Opacity
setting.playerchat.name = Visa
setting.showweather.name = Show Weather Graphics
setting.hidedisplays.name = Hide Logic Displays
Expand Down
2 changes: 2 additions & 0 deletions core/assets/bundles/bundle_tk.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,8 @@ setting.playerlimit.name = Player Limit
setting.chatopacity.name = Chat Opacity
setting.lasersopacity.name = Power Laser Opacity
setting.bridgeopacity.name = Bridge Opacity
setting.schemalpha.name = Schema Opacity
setting.placeopacity.name = Place Opacity
setting.playerchat.name = Display In-Game Chat
setting.showweather.name = Show Weather Graphics
setting.hidedisplays.name = Hide Logic Displays
Expand Down
1 change: 1 addition & 0 deletions core/assets/features
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
* Shift click up/down in schematic tag list to send to top/bottom respectively
* Shift click delete in schematic tag list to delete tag without prompt
* Alt {pickupCargo} pick up buildings but not units
* Set schema/place opacity

# Credits
* Game by anuke, client by foo, buthed010203, Zxtej, SBytes, and BalaM314
13 changes: 9 additions & 4 deletions core/src/mindustry/input/DesktopInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,21 @@ public void drawBottom(){

var items = selectPlans.items;
int size = selectPlans.size;
var alpha = Core.settings.getInt("schemalpha", 100) / 100f;

var schemAlpha = Core.settings.getInt("schemalpha", 100) / 100f;

//draw schematic plans
for(int i = 0; i < size; i++){
var plan = items[i];
plan.animScale = 1f;
drawPlan(plan, plan.cachedValid = validPlace(plan.x, plan.y, plan.block, plan.rotation), alpha);
drawPlan(plan, plan.cachedValid = validPlace(plan.x, plan.y, plan.block, plan.rotation), schemAlpha);
}

//draw schematic plans - over version, cached results
for(int i = 0; i < size; i++){
var plan = items[i];
//use cached value from previous invocation
drawOverPlan(plan, plan.cachedValid, alpha);
drawOverPlan(plan, plan.cachedValid, schemAlpha);
}

// if(player.isBuilder()){
Expand All @@ -252,11 +253,15 @@ public void drawBottom(){
}
Draw.color();
boolean valid = validPlace(cursorX, cursorY, block, rot);
drawPlan(cursorX, cursorY, block, rot);

var placeAlpha = Core.settings.getInt("placeopacity", 100) / 100f;

drawPlan(cursorX, cursorY, block, rot, placeAlpha);
block.drawPlace(cursorX, cursorY, rot, valid);

if(block.saveConfig){
Draw.mixcol(!valid ? Pal.breakInvalid : Color.white, (!valid ? 0.4f : 0.24f) + Mathf.absin(Time.globalTime, 6f, 0.28f));
Draw.alpha(placeAlpha);
bplan.set(cursorX, cursorY, rot, block);
bplan.config = block.lastConfig;
block.drawPlanConfig(bplan, allPlans());
Expand Down
7 changes: 7 additions & 0 deletions core/src/mindustry/input/InputHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,13 @@ protected void drawPlan(int x, int y, Block block, int rotation){
block.drawPlan(bplan, allPlans(), validPlace(x, y, block, rotation));
}

/** Draws a placement icon for a specific block */
protected void drawPlan(int x, int y, Block block, int rotation, float alpha){
bplan.set(x, y, rotation, block);
bplan.animScale = 1f;
block.drawPlan(bplan, allPlans(), validPlace(x, y, block, rotation), alpha);
}

/** Remove everything from the queue in a selection. */
protected void removeSelection(int x1, int y1, int x2, int y2){
removeSelection(x1, y1, x2, y2, false);
Expand Down
6 changes: 6 additions & 0 deletions core/src/mindustry/ui/dialogs/SettingsMenuDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,12 @@ void addSettings(){
return s + "%";
});
graphics.sliderPref("bridgeopacity", 100, 0, 100, 5, s -> s + "%");
// this is really "schemaopacity" but leaving as "schemalpha" so as not to break any potential usages in mods
// as it was defined a long time ago but not placed in default settings menu
graphics.sliderPref("schemalpha", 100, 0, 100, 5, s -> s + "%");

// opacity of the object selected from the block menu
graphics.sliderPref("placeopacity", 100, 0, 100, 5, s -> s + "%");

if(!mobile){
graphics.checkPref("vsync", true, b -> Core.graphics.setVSync(b));
Expand Down