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

Unable to fully display two .lua scripts at the same time in 2.6 #2600

Closed
ghost opened this issue Jan 30, 2021 · 3 comments
Closed

Unable to fully display two .lua scripts at the same time in 2.6 #2600

ghost opened this issue Jan 30, 2021 · 3 comments
Labels
Enhancement For feature requests or possible improvements re: Lua API/scripting Relating to EmuHawk's Lua API (not the Lua Console) Repro: Affects 2.6 Repro: Fixed/added in 2.9.2 dev

Comments

@ghost
Copy link

ghost commented Jan 30, 2021

1
2

As shown in the screenshots, in 2.6 it seems i cant run these .lua scripts togheter: whichever i open first will show on screen. So as it is now i have to enable and disable each

No errors on the console, and it looks like part of 1 script, at least some text, shows up: it kinda looks like one overrides the other one, following a layer logic. Same windows sizes, it works without issues till 2.5.2

I'll also leave the lua scripts linked, just in case, idk if it might be useful

Game: CTR NTSC-U (PSX)
Lua Scripts: https://mega.nz/folder/r4lihSzA#u3C3sxXbE8hFsMJOrwgLOQ

@YoshiRulz YoshiRulz self-assigned this Jan 30, 2021
@YoshiRulz YoshiRulz added re: Lua API/scripting Relating to EmuHawk's Lua API (not the Lua Console) Repro: Affects 2.6 labels Jan 30, 2021
@YoshiRulz
Copy link
Member

YoshiRulz commented Feb 5, 2021

I haven't tried, but looking at the code I think there's a simple fix for this. Is the old behaviour (drawing on the same surface, overwriting pixels) something we want to allow? I think this should be possible if both scripts use a noclobber mode, but that doesn't work: #2501.

edit: as a workaround, two scripts should be able to draw simultaneously if one uses the other surface (gui.use_surface("client"); gui.whatever(); gui.somethingelse()); or you can use the forms lib to create an additional window per script, with UI controls and/or gui-like drawing; or you can write ext. tools instead of scripts, they use their own windows like Lua forms would

@YoshiRulz YoshiRulz removed their assignment Feb 5, 2021
@YoshiRulz

This comment was marked as outdated.

@YoshiRulz YoshiRulz added Repro: Patch pending Potentially fixed in dev build, see readme for download and removed Repro: Patch pending Potentially fixed in dev build, see readme for download labels Feb 21, 2021
@YoshiRulz YoshiRulz added Enhancement For feature requests or possible improvements Waiting on dev consensus labels May 5, 2022
@CasualPokePlayer
Copy link
Member

CasualPokePlayer commented May 25, 2024

This should be fixed in the latest dev build.

A clearGraphics call will clear anything drawn, including by other scripts. Note that scripts run in the order listed in the Lua Console, so only the first should be clearing if that's needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For feature requests or possible improvements re: Lua API/scripting Relating to EmuHawk's Lua API (not the Lua Console) Repro: Affects 2.6 Repro: Fixed/added in 2.9.2 dev
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants