Skip to content
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

Merged
merged 6 commits into from
Aug 17, 2024

Conversation

NineBerry
Copy link
Contributor

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)

Copy link

github-actions bot commented Jul 19, 2024

🤖 Pull request artifacts

file commit
IITC_Mobile-test.apk ee0cc17
test-0.38.1.20240814.111418.zip ee0cc17

See build on website

Copy link
Contributor

@xscreach xscreach left a 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

@@ -153,6 +170,7 @@ function displayScoreboard () {
} else {
dialog({
html: html,
width: 400,
Copy link
Contributor

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

Copy link
Contributor Author

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)

Copy link
Contributor Author

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.

};
}

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>'
Copy link
Contributor

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

+'<tr><td>Fields</td>'
+'<td>'+fieldsCount.enl+'</td>'
+'<td>'+fieldsCount.res+'</td></tr>';
+'<td>'+fieldsCount.res+'</td>'
Copy link
Contributor

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... 👍

@NineBerry
Copy link
Contributor Author

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.

@NineBerry
Copy link
Contributor Author

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.

image

@NineBerry NineBerry requested a review from xscreach July 20, 2024 01:27
plugins/scoreboard.js Outdated Show resolved Hide resolved
@modos189 modos189 merged commit a60097b into IITC-CE:master Aug 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants