Workshop map updates, removal detection
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user