fionafibration / team-frotress-2

Controls smart sex toys based on kills, Uber, and more in Team Fortress 2
GNU General Public License v3.0
16 stars 0 forks source link

Mod only restricted to 1920x1080 resolution ? #8

Closed PoorPocketsMcNewHold closed 7 months ago

PoorPocketsMcNewHold commented 7 months ago

Hi there, I've been trying to try your mod on the native Linux version Team Fortress 2 (And saw that Linux support was difficult at best). I got an intriguing error, and would like an explanation on it. I'm an Ultrawide user. My moniyor has a ratio of 21:9 and a resolution of 3440x1440. Configuring everything well made the main.py stop working with an error about only supporting the 1920x1080 resolution. Why ? I did tried to manually change the game resolution in windowed to that one and even restarted it to be sure it would be catched by the script but it didn't changed anything. Do I do something wrong ? Did the script actively enforce the need of the custom HUD despite not wishing to get the medigun counter ? I'm fairly confused about it.

semper-lux commented 7 months ago

Good question! I'll look into this: iirc, the only time we do resolution dependent pixel checks is for medigun Uber charge. I'll see if this actually is the case and, if so, bypass the check with a warning that medic will not have full functionality.

Edit: The resolution check checks for monitor resolution and not game resolution, which should also be changed probably.

semper-lux commented 7 months ago

Okay, I've pushed a change which turns the check into a warning. I am not able to verify this did not break anything at the moment, so let me know if something no longer works.

Still planned is to make the resolution check happen for all platforms and to make the codebase surrounding that less jank.

PoorPocketsMcNewHold commented 7 months ago

Can confirm this pushed have worked. It's now just a warning.

❯ python3 main.py 
/home/pm/Documents/team-frotress-2/main.py:33: SyntaxWarning: invalid escape sequence '\*'
  subprocess.Popen('xrandr | grep "\*" | cut -d" " -f4', shell=True, stdout=subprocess.PIPE).communicate()[
/home/pm/Documents/team-frotress-2/main.py:150: SyntaxWarning: invalid escape sequence '\('
  name = re.match('"name" = "([^\n]+)" \( def. "unnamed" \)', name_response_text)
/home/pm/Documents/team-frotress-2/main.py:175: SyntaxWarning: invalid escape sequence '\d'
  if switch_match := re.match("""\d\d\/\d\d\/\d\d\d\d - \d\d:\d\d:\d\d: teamfrotress_(\w+)""", line):
/home/pm/Documents/team-frotress-2/main.py:188: SyntaxWarning: invalid escape sequence '\d'
  """\d\d\/\d\d\/\d\d\d\d - \d\d:\d\d:\d\d: ([^\n]{0,32}) killed ([^\n]{0,32}) with (\w+)\. ?(\(crit\))?""",
Detected incompatible resolution!                 Currently supported resolutions are:
1920x1080
Medic Uber Charge functionality will not work
Press enter to launch TF2!

It doesn't make me able to launch the game, however, but that would be reserved for another issue.

semper-lux commented 7 months ago

Oh, yeah. I forgot about that. For some ungodly reason, steam-runtime on linux (or at least on arch) has a maximum number of launch options. You'll have to grab the launch options from this codebase and manually add them to the launch options on steam-runtime. It'll work fine, its just mildly annoying. Go ahead an open a new issue and I'll give the launch options needed for the work around and add fixing this to the docket.