Workshop map updates, removal detection

This commit is contained in:
Anuken
2019-09-28 13:13:23 -04:00
parent a9edee1550
commit 438b3d9752
7 changed files with 156 additions and 40 deletions
+7 -1
View File
@@ -178,6 +178,7 @@ warning = Warning.
confirm = Confirm
delete = Delete
view.workshop = View In Workshop
workshop.listing = Edit Workshop Listing
ok = OK
open = Open
customize = Customize Rules
@@ -215,7 +216,12 @@ map.nospawn.pvp = This map does not have any enemy cores for player to spawn int
map.nospawn.attack = This map does not have any enemy cores for player to attack! Add[SCARLET] red[] cores to this map in the editor.
map.invalid = Error loading map: corrupted or invalid map file.
map.publish.error = Error publishing map: {0}
map.update = Update Map
map.load.error = Error fetching workshop details: {0}
map.missing = This map has been deleted or moved.\n[lightgray]The workshop listing has now been automatically un-linked from the map.
map.publish.confirm = Are you sure you want to publish this map?\n\n[lightgray]Make sure you agree to the Workshop EULA first, or your maps will not show up!
map.menu = Select what you would like to do with this map.
map.changelog = Changelog (optional):
eula = Steam EULA
map.publish = Map published.
map.publishing = [accent]Publishing map...
@@ -1071,7 +1077,7 @@ block.core-foundation.description = The second version of the core. Better armor
block.core-nucleus.description = The third and final iteration of the core capsule. Extremely well armored. Stores massive amounts of resources.
block.vault.description = Stores a large amount of items of each type. An unloader block can be used to retrieve items from the vault.
block.container.description = Stores a small amount of items of each type. An unloader block can be used to retrieve items from the container.
block.unloader.description = Unloads items from a container, vault or core onto a conveyor or directly into an adjacent block. The type of item to be unloaded can be changed by tapping.
block.unloader.description = Unloads items from any nearby non-transportation block. The type of item to be unloaded can be changed by tapping.
block.launch-pad.description = Launches batches of items without any need for a core launch.
block.launch-pad-large.description = An improved version of the launch pad. Stores more items. Launches more frequently.
block.duo.description = A small, cheap turret. Useful against ground units.
@@ -37,6 +37,10 @@ public interface Platform{
/** Steam: View a map listing on the workshop.*/
default void viewMapListing(String mapid){}
/** Steam: View map workshop info, removing the map ID tag if its listing is deleted.
* Also presents the option to update the map. */
default void viewMapListingInfo(Map map){}
/** Steam: Open workshop for maps.*/
default void openWorkshop(){}
@@ -147,13 +147,13 @@ public class MapEditorDialog extends Dialog implements Disposable{
if(steam){
menu.cont.addImageTextButton("$editor.publish.workshop", Icon.linkSmall, () -> {
Map map = save();
if(editor.getTags().containsKey("steamid")){
platform.viewMapListing(editor.getTags().get("steamid"));
platform.viewMapListingInfo(map);
return;
}
Map map = save();
if(map == null) return;
if(map.tags.get("description", "").length() < 4){
@@ -167,7 +167,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
}
platform.publishMap(map);
}).padTop(-3).size(swidth * 2f + 10, 60f).update(b -> b.setText(editor.getTags().containsKey("steamid") ? "$view.workshop" : "$editor.publish.workshop"));
}).padTop(-3).size(swidth * 2f + 10, 60f).update(b -> b.setText(editor.getTags().containsKey("steamid") ? editor.getTags().get("author").equals(player.name) ? "$workshop.listing" : "$view.workshop" : "$editor.publish.workshop"));
menu.cont.row();
}
+4
View File
@@ -41,6 +41,10 @@ public class Bar extends Element{
}
public void reset(float value){
this.value = lastValue = blink = value;
}
public void set(Supplier<String> name, FloatProvider fraction, Color color){
this.fraction = fraction;
this.lastValue = fraction.get();
@@ -38,6 +38,7 @@ public class LoadingFragment extends Fragment{
}
public void setProgress(FloatProvider progress){
bar.reset(0f);
bar.visible(true);
bar.set(() -> ((int)(progress.get() * 100) + "%"), progress, Pal.accent);
}