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

Support SVG logos for get5 (API already does somewhat) #536

Closed
tuudik opened this issue Jun 2, 2020 · 4 comments
Closed

Support SVG logos for get5 (API already does somewhat) #536

tuudik opened this issue Jun 2, 2020 · 4 comments
Labels

Comments

@tuudik
Copy link
Contributor

tuudik commented Jun 2, 2020

Expected behavior

PR #498 has made it possible to use SVG logos for team.
get5 should check if SVG logo exists and use it or if it's missing it, download it.

Actual behavior

get5 works only with png (matchconfig.sp):

static void AddTeamLogoToDownloadTable(const char[] logoName) {
  if (StrEqual(logoName, ""))
    return;

  char logoPath[PLATFORM_MAX_PATH + 1];
  Format(logoPath, sizeof(logoPath), "resource/flash/econ/tournaments/teams/%s.png", logoName);
  LogDebug("Adding file %s to download table", logoName);
  AddFileToDownloadsTable(logoPath);
}

Sadly I'm very low experienced with SourcePawn, but I guess there should be same check as for API, if get5_use_svg is 1, it should check if SVG exists. I dont know how to share CVAR between two plugins. Separate question is then, where should the CVAR be located, which config.

  • Plugin version: 0.7.2-dev 8890db8
  • Sourcemod version: 1.10
@tuudik
Copy link
Contributor Author

tuudik commented Jun 2, 2020

@MoritzLoewenstein Perhaps you have time to check this issue too?

@MoritzLoewenstein
Copy link
Contributor

MoritzLoewenstein commented Jun 3, 2020

PR would look like this (cant try out right now):

#include "util.sp"
#define LOGO_PATH "materials/panorama/images/tournaments/teams/%s.png"
#define LEGACY_LOGO_PATH "resource/flash/econ/tournaments/teams/%s.svg"
[...after "char logoPath[PLATFORM_MAX_PATH + 1];"]
int useSvg = GetCvarIntSafe("get5_use_svg");
logoPath = useSvg == 1 ? LOGO_PATH : LEGACY_LOGO_PATH;
Format(logoPath, sizeof(logoPath), logoPath, logoName);

@splewis
Copy link
Owner

splewis commented Jun 4, 2020

Should be resolved by #538 now.

@splewis splewis closed this as completed Jun 4, 2020
@splewis splewis added the bug label Jun 4, 2020
@MoritzLoewenstein
Copy link
Contributor

MoritzLoewenstein commented Jun 4, 2020

Unless I am missing something this does not get solved via #538, because the legacy logo path is hardcoded in the Format(...), but the svg logos are in the normal path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants