-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin "Scoreboard": Include information on Machina #746
Conversation
🤖 Pull request artifacts
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imho the css width is wrong and should be styles some other way than with width in pixels - thats the only comment i thing should really be considered
Otherwise just some minor comments, but the code was bad long before this PR so... if it would be possible to improve the old code, would be nice, but that's imho nothing to block this PR for
plugins/scoreboard.js
Outdated
@@ -153,6 +170,7 @@ function displayScoreboard () { | |||
} else { | |||
dialog({ | |||
html: html, | |||
width: 400, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels very wrong.
Not all displays will handle that.
It's too static to look good at few places (we'd like it to look good everywhere/on every device)
But not sure what to suggest otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have copied this syntax from other default plugins where a constant integer number without any unit name is also passed as width property to the dialog() function. For mobile, this part of the code is not relevant (handled via useAppPanes instead)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a commit that uses "auto" instead of a concrete width. That works good in all tested browsers.
plugins/scoreboard.js
Outdated
}; | ||
} | ||
|
||
function makeTable (portals,linksCount,fieldsCount) { | ||
|
||
var html = ''; | ||
html += '<table>' | ||
+ '<colgroup><col><col class="enl"><col class="res"></colgroup>' | ||
+ '<colgroup><col><col class="enl"><col class="res"><col class="mac"></colgroup>' | ||
+ '<tr>' | ||
+ '<th>Metrics</th>' | ||
+ '<th class="enl">Enlightened</th>' | ||
+ '<th class="res">Resistance</th>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These names, and css classes used above are saved in constants similar to e.g. TEAM_MAC
Please use those instead of repeating the value
plugins/scoreboard.js
Outdated
+'<tr><td>Fields</td>' | ||
+'<td>'+fieldsCount.enl+'</td>' | ||
+'<td>'+fieldsCount.res+'</td></tr>'; | ||
+'<td>'+fieldsCount.res+'</td>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imho this whole table could be better rendered using some loops.
I know it was like this for years... but if its not too much trouble, could you rewrite it that way?
Just if you feel up to it and have time for it
Otherwise your changes are as good as the original so... 👍
I have improved the dialog width CSS issue. I might further improve the code quality and function of the plugin (e.g. auto update content when zooming or panning view) but only later on in another PR. |
Look of modified dialog: Additionally to Res and Enl portals and links Machina information is also shown. This is very useful for the currently "Shared Memory Global Challange" and will probably be useful for future challenges too to find out number of portals and/or links of a specific faction in a specific area. |
This adds information on Machina portals and links currently visible on the screen to the Scoreboard plugin window. (No to be confused with the regional scoring plugin)