diff --git a/.classpath b/.classpath index 14be5bb..3b493cd 100644 --- a/.classpath +++ b/.classpath @@ -1,15 +1,42 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore index a3ac56a..c891c3d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,6 @@ tasks.xml .idea/libraries .idea/**/*.iml boot-settings.xml* + +.DS_Store +bin/main \ No newline at end of file diff --git a/.gradle/4.10/fileChanges/last-build.bin b/.gradle/4.10/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/4.10/fileChanges/last-build.bin differ diff --git a/.gradle/4.10/fileHashes/fileHashes.lock b/.gradle/4.10/fileHashes/fileHashes.lock new file mode 100644 index 0000000..a523a31 Binary files /dev/null and b/.gradle/4.10/fileHashes/fileHashes.lock differ diff --git a/.gradle/4.10/gc.properties b/.gradle/4.10/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.project b/.project index 9c12f4d..0120f71 100644 --- a/.project +++ b/.project @@ -10,8 +10,14 @@ + + org.eclipse.buildship.core.gradleprojectbuilder + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..e889521 --- /dev/null +++ b/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir= +eclipse.preferences.version=1 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index e1c4174..e31b571 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -16,9 +16,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -121,7 +121,7 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=true org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 diff --git a/Scelight-dev.launch b/Scelight-dev.launch index 883a7e0..ad60445 100644 --- a/Scelight-dev.launch +++ b/Scelight-dev.launch @@ -1,21 +1,22 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/Scelight.launch b/Scelight.launch index 61872f9..0357811 100644 --- a/Scelight.launch +++ b/Scelight.launch @@ -1,13 +1,14 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/scelight.iml b/scelight.iml new file mode 100644 index 0000000..048aa41 --- /dev/null +++ b/scelight.iml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src-app/hu/scelight/gui/page/repanalyzer/UsersComp.java b/src-app/hu/scelight/gui/page/repanalyzer/UsersComp.java index 92c5786..ab737f4 100644 --- a/src-app/hu/scelight/gui/page/repanalyzer/UsersComp.java +++ b/src-app/hu/scelight/gui/page/repanalyzer/UsersComp.java @@ -62,11 +62,11 @@ private void buildGui() { table.setRowHeightForProgressBar(); - final Vector< Object > columns = Utils.vector( "User Color", "Team", "Color", "Name", "Race", "Result", "Highest
League", "APM", "SPM", + final Vector< Object > columns = Utils.vector( "User Color", "Team", "Color", "Name", "Race", "Result", "Highest
League", "MMR", "APM", "SPM", "SQ", "Supply-
capped %", "Swarm
Levels", "Start
Dir", "Role", "Control", "Toon", "Slot", "Handicap" ); final List< Class< ? > > columnClasses = Utils.< Class< ? > > asNewList( Color.class, Integer.class, PlayerColor.class, String.class, - RenderablePair.class, RenderablePair.class, TableIcon.class, ProgressBarView.class, ProgressBarView.class, ProgressBarView.class, + RenderablePair.class, RenderablePair.class, TableIcon.class, Integer.class, ProgressBarView.class, ProgressBarView.class, ProgressBarView.class, ProgressBarView.class, ProgressBarView.class, Integer.class, Role.class, Controller.class, Toon.class, Integer.class, Integer.class ); final int userColorColIdx = 0; @@ -112,6 +112,9 @@ private void buildGui() { row.add( u.player == null ? null : new RenderablePair<>( u.player.getResult().ricon.get(), u.player.getResult().text + ( u.player.isResultDeduced() ? " (Deduced)" : "" ) ) ); row.add( u.uid == null ? null : u.uid.getHighestLeague().tableIcon ); + + row.add( u.mmr ); + row.add( new ProgressBarView( u.apm, maxApm ) ); row.add( new ProgressBarView( (int) ( u.spm * 100 ), (int) ( maxSpm * 100 ), Env.LANG.formatNumber( u.spm, 2 ) ) ); row.add( new ProgressBarView( u.sq, maxSq ) ); diff --git a/src-app/hu/scelight/sc2/rep/model/details/Player.java b/src-app/hu/scelight/sc2/rep/model/details/Player.java index 119de76..5191294 100644 --- a/src-app/hu/scelight/sc2/rep/model/details/Player.java +++ b/src-app/hu/scelight/sc2/rep/model/details/Player.java @@ -79,7 +79,7 @@ public Player( final Map< String, Object > struct, final int playerIdx ) { name = Utils.stripOffMarkupFormatting( get( F_NAME ).toString().replace( "<", "<" ).replace( ">", ">" ) ); raceString = get( F_RACE ).toString(); race = Race.fromLocalizedValue( raceString ); - recordedResult = Result.VALUES[ get( F_RESULT ) ]; + recordedResult = Result.VALUES[ (int) get( F_RESULT ) ]; team = get( F_TEAM_ID ); toon = new Toon( this.< Map< String, Object > > get( F_TOON ) ); diff --git a/src-app/hu/scelight/sc2/rep/model/initdata/userinitdata/UserInitData.java b/src-app/hu/scelight/sc2/rep/model/initdata/userinitdata/UserInitData.java index 457da52..b93deff 100644 --- a/src-app/hu/scelight/sc2/rep/model/initdata/userinitdata/UserInitData.java +++ b/src-app/hu/scelight/sc2/rep/model/initdata/userinitdata/UserInitData.java @@ -147,6 +147,11 @@ public Boolean getTestMap() { return get( F_TEST_MAP ); } + @Override + public Integer getMMR() { + return get( F_MMR ); + } + @Override public League getHighestLeague() { if ( highestLeague == null ) { diff --git a/src-app/hu/scelight/sc2/rep/repproc/User.java b/src-app/hu/scelight/sc2/rep/repproc/User.java index 271a0a9..062b5cd 100644 --- a/src-app/hu/scelight/sc2/rep/repproc/User.java +++ b/src-app/hu/scelight/sc2/rep/repproc/User.java @@ -108,6 +108,11 @@ public class User implements IUser { *

*/ public double spm; + + /** + * MMR of the user. + */ + public int mmr; // Derived data from tracker events @@ -158,8 +163,10 @@ public User( final RepProcessor repProc, final int slotIdx, final int playerIdx, this.uid = uid; this.player = player; - if ( uid != null ) + if ( uid != null ) { name = uid.name; + mmr = uid.getMMR(); + } else if ( player != null ) { String name_ = player.getName(); // Cut off clan name @@ -303,4 +310,8 @@ public PlayerColor getPlayerColor() { return playerColor; } + @Override + public int getMMR() { + return mmr; + } } diff --git a/src-app/hu/scelight/template/Symbol.java b/src-app/hu/scelight/template/Symbol.java index ca32423..9b80cab 100644 --- a/src-app/hu/scelight/template/Symbol.java +++ b/src-app/hu/scelight/template/Symbol.java @@ -274,7 +274,10 @@ public enum Symbol implements HasRIcon { Icons.F_DIRECTION, "startDirX", "1", - "Direction of the start location of the X-th player. It is a time hour value (e.g. 1 o'clock)" ); + "Direction of the start location of the X-th player. It is a time hour value (e.g. 1 o'clock)" ), + + /** Player's MMR */ + MMR( Icons.MY_SQ, "mmrX", "4500", "MMR of the X-th player." ); diff --git a/src-app/hu/scelight/template/TemplateEngine.java b/src-app/hu/scelight/template/TemplateEngine.java index 3a324e5..260fb98 100644 --- a/src-app/hu/scelight/template/TemplateEngine.java +++ b/src-app/hu/scelight/template/TemplateEngine.java @@ -622,6 +622,10 @@ private void processSymbol( final SymbolWithRange swr ) { if ( swr.param <= playerUsers.length ) vb.append( playerUsers[ swr.param - 1 ].getSq() ); break; + case MMR: + if ( swr.param <= playerUsers.length) + vb.append( playerUsers[swr.param - 1 ].getMMR() ); + break; case SUPPLY_CAPPED : if ( swr.param <= playerUsers.length ) vb.append( Env.LANG.formatNumber( playerUsers[ swr.param - 1 ].getSupplyCappedPercent(), 2 ) ); diff --git a/src-ext-mod-api/hu/scelightapi/sc2/rep/model/initdata/userinitdata/IUserInitData.java b/src-ext-mod-api/hu/scelightapi/sc2/rep/model/initdata/userinitdata/IUserInitData.java index 8c41e1e..bf64c86 100644 --- a/src-ext-mod-api/hu/scelightapi/sc2/rep/model/initdata/userinitdata/IUserInitData.java +++ b/src-ext-mod-api/hu/scelightapi/sc2/rep/model/initdata/userinitdata/IUserInitData.java @@ -67,10 +67,13 @@ public interface IUserInitData extends IStructView { /** Test map field name. */ String F_TEST_MAP = "testMap"; + /** MMR */ + String F_MMR = "scaledRating"; + /** * Returns the associated player id for this user init data (in {@link IDetails#getPlayerList()}) - * + * * @return the associated player id for this user init data (in {@link IDetails#getPlayerList()}) */ int getPlayerId(); @@ -180,4 +183,10 @@ public interface IUserInitData extends IStructView { */ ILeague getHighestLeague(); + /** + * Returns the MMR. + * + * @return MMR + */ + Integer getMMR(); } diff --git a/src-ext-mod-api/hu/scelightapi/sc2/rep/repproc/IUser.java b/src-ext-mod-api/hu/scelightapi/sc2/rep/repproc/IUser.java index 413770b..f3fd750 100644 --- a/src-ext-mod-api/hu/scelightapi/sc2/rep/repproc/IUser.java +++ b/src-ext-mod-api/hu/scelightapi/sc2/rep/repproc/IUser.java @@ -214,4 +214,11 @@ public interface IUser { */ IPlayerColor getPlayerColor(); + /** + * Returns the player MMR. + * + * @return the player MMR. + * @since ??? + */ + int getMMR(); }