mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 10:54:51 +00:00
Code cleanup
This commit is contained in:
@@ -74,7 +74,7 @@ public class OptionsView extends ViewWidget {
|
|||||||
AppSettings.getSettings().setVolume(val);
|
AppSettings.getSettings().setVolume(val);
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(new AudioEvents.ChangeVolume(val, VolumeControl.MASTERVOLUME))
|
.addPostEvent(new AudioEvents.ChangeVolume(val, VolumeControl.MASTERVOLUME))
|
||||||
.asyncPostEvent();
|
.postEvent();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ public class OptionsView extends ViewWidget {
|
|||||||
AppSettings.getSettings().setFxVolume(val);
|
AppSettings.getSettings().setFxVolume(val);
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(new AudioEvents.ChangeVolume(val, VolumeControl.FX))
|
.addPostEvent(new AudioEvents.ChangeVolume(val, VolumeControl.FX))
|
||||||
.asyncPostEvent();
|
.postEvent();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ public class OptionsView extends ViewWidget {
|
|||||||
AppSettings.getSettings().setMusicVolume(val);
|
AppSettings.getSettings().setMusicVolume(val);
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(new AudioEvents.ChangeVolume(val, VolumeControl.MUSIC))
|
.addPostEvent(new AudioEvents.ChangeVolume(val, VolumeControl.MUSIC))
|
||||||
.asyncPostEvent();
|
.postEvent();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -36,13 +36,13 @@ public class AppSettings {
|
|||||||
|
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(new AudioEvents.ChangeVolume(settingsData.volume, VolumeControl.MASTERVOLUME))
|
.addPostEvent(new AudioEvents.ChangeVolume(settingsData.volume, VolumeControl.MASTERVOLUME))
|
||||||
.asyncPostEvent();
|
.postEvent();
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(new AudioEvents.ChangeVolume(settingsData.fxVolume, VolumeControl.FX))
|
.addPostEvent(new AudioEvents.ChangeVolume(settingsData.fxVolume, VolumeControl.FX))
|
||||||
.asyncPostEvent();
|
.postEvent();
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(new AudioEvents.ChangeVolume(settingsData.musicVolume, VolumeControl.MUSIC))
|
.addPostEvent(new AudioEvents.ChangeVolume(settingsData.musicVolume, VolumeControl.MUSIC))
|
||||||
.asyncPostEvent();
|
.postEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SettingsAsset getPath() {
|
public static SettingsAsset getPath() {
|
||||||
|
|||||||
@@ -92,11 +92,6 @@ public class ResourceManager {
|
|||||||
return asset.getResource();
|
return asset.getResource();
|
||||||
}
|
}
|
||||||
|
|
||||||
// @SuppressWarnings("unchecked")
|
|
||||||
// public static <T extends BaseResource> ArrayList<ResourceMeta<T>> getAllOfType() {
|
|
||||||
// return (ArrayList<ResourceMeta<T>>) (ArrayList<?>) new ArrayList<>(assets.values());
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve all assets of a specific resource type.
|
* Retrieve all assets of a specific resource type.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -147,24 +147,6 @@ public class LocalizationAsset extends BaseResource implements LoadableResource,
|
|||||||
return this.baseName;
|
return this.baseName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
|
||||||
// * Extracts the base name from a file name.
|
|
||||||
// *
|
|
||||||
// * @param fileName the file name
|
|
||||||
// * @return base name without locale or extension
|
|
||||||
// */
|
|
||||||
// private String getBaseName(String fileName) {
|
|
||||||
// int dotIndex = fileName.lastIndexOf('.');
|
|
||||||
// String nameWithoutExtension = (dotIndex > 0) ? fileName.substring(0, dotIndex) :
|
|
||||||
// fileName;
|
|
||||||
//
|
|
||||||
// int underscoreIndex = nameWithoutExtension.indexOf('_');
|
|
||||||
// if (underscoreIndex > 0) {
|
|
||||||
// return nameWithoutExtension.substring(0, underscoreIndex);
|
|
||||||
// }
|
|
||||||
// return nameWithoutExtension;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extracts a locale from a file name based on the pattern "base_LOCALE.properties".
|
* Extracts a locale from a file name based on the pattern "base_LOCALE.properties".
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -69,9 +69,4 @@ public interface BundledResource {
|
|||||||
* @return the base name used to identify this bundled resource
|
* @return the base name used to identify this bundled resource
|
||||||
*/
|
*/
|
||||||
String getBaseName();
|
String getBaseName();
|
||||||
|
|
||||||
// /**
|
|
||||||
// Returns the name
|
|
||||||
// */
|
|
||||||
// String getDefaultName();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
executor.submit(() -> {
|
executor.submit(() -> {
|
||||||
for (int i = 0; i < EVENTS_PER_THREAD; i++) {
|
for (int i = 0; i < EVENTS_PER_THREAD; i++) {
|
||||||
var _ = new EventFlow().addPostEvent(HeavyEvent.class, "payload-" + i)
|
var _ = new EventFlow().addPostEvent(HeavyEvent.class, "payload-" + i)
|
||||||
.asyncPostEvent();
|
.postEvent();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user