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

Window Controls #708

Merged
merged 57 commits into from
Aug 25, 2023
Merged

Window Controls #708

merged 57 commits into from
Aug 25, 2023

Conversation

CubesterYT
Copy link
Collaborator

@CubesterYT CubesterYT commented Jul 8, 2023

Resolves #360
Resolves #454
Resolves #590

Hello all! This is a PR that is in collaboration between me and BlueDome. Me and him have merged ours extensions together and made a even better one! This extension gives you control over everything we could think of. More blocks will be coming soon!

This is the current roster:
image
image

@LilyMakesThings
Copy link
Contributor

COLLAB EXTENSION REALLL

@LilyMakesThings
Copy link
Contributor

We should really be specifying this does not work in browser and only in electron applications. I can already imagine the issue statements.

@CubesterYT
Copy link
Collaborator Author

We should really be specifying this does not work in browser and only in electron applications. I can already imagine the issue statements.

@LilyMakesThings I will be making a documentation page specifying this. Also, after vigorous testing, some blocks do still work in browsers/html. Just the ones that don't affect the page state.

@GarboMuffin
Copy link
Member

put that ones that work in Electron only under a BlockType.LABEL, perhaps

@CubesterYT
Copy link
Collaborator Author

CubesterYT commented Jul 8, 2023

put that ones that work in Electron only under a BlockType.LABEL, perhaps

@GarboMuffin I could, but basically all of them work in electron only. So it could mess up the entire order. So I'll just define in documentation that most work in electron only.

@LilyMakesThings
Copy link
Contributor

LilyMakesThings commented Jul 8, 2023

put that ones that work in Electron only under a BlockType.LABEL, perhaps

@GarboMuffin I could, but basically all of them work in electron only. So it could mess up the entire order. So I'll just define in documentation that most work in electron only.

You need to make a label saying the blocks only work in electron. The kind of people who would be making issues about it not working in browser are the kind of people who don't read the documentation.

@CubesterYT
Copy link
Collaborator Author

CubesterYT commented Jul 8, 2023

put that ones that work in Electron only under a BlockType.LABEL, perhaps

@GarboMuffin I could, but basically all of them work in electron only. So it could mess up the entire order. So I'll just define in documentation that most work in electron only.

You need to make a label saying the blocks only work in electron. The kind of people who would be making issues about it not working in browser are the kind of people who don't read the documentation.

@LilyMakesThings Ahhhh like that one other extension I forgot the name of that had a label stating something important. Alright I will do that tomorrow with some more block additions and documentation and anything else. Then everything should be ready.

@UndermanReal
Copy link

Could this then help with #360?

@CubesterYT
Copy link
Collaborator Author

Could this then help with #360?

@UndermanReal Yes actually. I haven't added it yet because I'm outside. But I will be adding a block called "match stage size" that will change the window aspect ratio to match the canvas.

@CubesterYT
Copy link
Collaborator Author

@GarboMuffin @LilyMakesThings Wanted to update you guys on something. After further testing, Window Controls works perfectly in Electron AND Pop Up HTML. Only certain ones work in browser/browser HTML.

@CubesterYT
Copy link
Collaborator Author

@GarboMuffin, Window Controls is ready for review/ready to be merged.

@echoless3484
Copy link

I feel like these blocks need a spot, while deprecating the enter and exit fullscreen blocks
scratchblocks (1)

@CubesterYT
Copy link
Collaborator Author

CubesterYT commented Jul 14, 2023

I feel like these blocks need a spot, while deprecating the enter and exit fullscreen blocks
scratchblocks (1)

@echoless3484, let me explain some things. The set Fullscreen to true/false block doesn't make sense on how the Fullscreen API works. Fullscreen API is a tricky thing to explain, as the API uses different sets to make it function. Fullscreen API functions using the sub window API called "window.document" which has its own set of APIs. To enter Fullscreen, it uses ANOTHER SUB API within "window.document", which is "window.document.documentElement", and to enter Fullscreen, we use "document.documentElement.requestFullscreen()". This is because ".documentElement.requestFullscreen" can be added to any element within the window, not just the window. Meaning any element in a window can be Fullscreen by itself. Now for exiting, that doesn't even use "document.documentElement", but uses just "window.document" for some odd reason. So to exit we run "document.exitFullscreen()". So we don't just set Fullscreen to true or false. So enter/exit cannot be deprecated, nor can "set Fullscreen to true/false" be added. BUT... Based on the reporter named simply "Fullscreen" that most likely returns if the window is in Fullscreen or not IS POSSIBLE. There is an official API that returns true or false in correlation to the window being Fullscreen or not. And I actually did have plans to add a boolean named, "is window fullscreen?", but I had forgotten to add it. But I will be adding this in the next version of Window Controls.

You can find more details about the Fullscreen API in depth here: https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API

@creepersaur
Copy link

Oh wow, amazing. Is there a link or github page for the newest extension file?

@echoless3484
Copy link

Oh wow, amazing. Is there a link or github page for the newest extension file?

Go to the top and click on "Window Controls" in the "Window Controls > Master" boxes

@creepersaur
Copy link

Now what's left is to be able to fullscreen, get the width and height of the display/screen, and to minimize, maximize, and change the ability of a window to be resizeable.

Also imagine what we could do if we could open apps using scratch, like export 2 exe projects, and run the exe/open the project using scratch code.

@echoless3484
Copy link

Now what's left is to be able to fullscreen, get the width and height of the display/screen, and to minimize, maximize, and change the ability of a window to be resizeable.

Also imagine what we could do if we could open apps using scratch, like export 2 exe projects, and run the exe/open the project using scratch code.

this extension already has fullscreen supports

@CubesterYT
Copy link
Collaborator Author

Now what's left is to be able to fullscreen, get the width and height of the display/screen, and to minimize, maximize, and change the ability of a window to be resizeable.

Also imagine what we could do if we could open apps using scratch, like export 2 exe projects, and run the exe/open the project using scratch code.

@creepersaur This extension can already enter and exit fullscreen. It can also already get the width and height of the screen, hence the screen x/y reporters. I'm not exactly sure what you mean by setting the ability of a window to be resizeable. And finally, I already have plans to add blocks that can minimize and maximize the window, but they won't be added among a ton others once I fully have a list of which BrowserWindow apis I want GarboMuffin to add.

@creepersaur
Copy link

Now what's left is to be able to fullscreen, get the width and height of the display/screen, and to minimize, maximize, and change the ability of a window to be resizeable.
Also imagine what we could do if we could open apps using scratch, like export 2 exe projects, and run the exe/open the project using scratch code.

@creepersaur This extension can already enter and exit fullscreen. It can also already get the width and height of the screen, hence the screen x/y reporters. I'm not exactly sure what you mean by setting the ability of a window to be resizeable. And finally, I already have plans to add blocks that can minimize and maximize the window, but they won't be added among a ton others once I fully have a list of which BrowserWindow apis I want GarboMuffin to add.

Ohh. I wasn't using the latest extension file. Now I see the screen w,h and the fullscreen, etc. This is very cool. The window resizeability means that currently, the user can drag on the corners of the application to change the size (w,h) of the window. Which you may not want in all cases. So the ability to stop the user from doing that could help. And also I don't know if this is possible, but removing the window border (including the edges of the application window and the top bar) so you could just have a plain window application, and then add your own border and things if you want.

@CubesterYT
Copy link
Collaborator Author

Now what's left is to be able to fullscreen, get the width and height of the display/screen, and to minimize, maximize, and change the ability of a window to be resizeable.
Also imagine what we could do if we could open apps using scratch, like export 2 exe projects, and run the exe/open the project using scratch code.

@creepersaur This extension can already enter and exit fullscreen. It can also already get the width and height of the screen, hence the screen x/y reporters. I'm not exactly sure what you mean by setting the ability of a window to be resizeable. And finally, I already have plans to add blocks that can minimize and maximize the window, but they won't be added among a ton others once I fully have a list of which BrowserWindow apis I want GarboMuffin to add.

Ohh. I wasn't using the latest extension file. Now I see the screen w,h and the fullscreen, etc. This is very cool. The window resizeability means that currently, the user can drag on the corners of the application to change the size (w,h) of the window. Which you may not want in all cases. So the ability to stop the user from doing that could help. And also I don't know if this is possible, but removing the window border (including the edges of the application window and the top bar) so you could just have a plain window application, and then add your own border and things if you want.

@creepersaur Ahhh I see. I will try to add a block that counters window size change, but you can currently use a method where if the program detects the window size changes, then you can set the size back to the dimensions you want. And about window border, I'm not sure if it's possible, I thought of it, but from what I'm seeing, it may be only for .appx apps.

@BlueDome77
Copy link
Contributor

Now what's left is to be able to fullscreen, get the width and height of the display/screen, and to minimize, maximize, and change the ability of a window to be resizeable.
Also imagine what we could do if we could open apps using scratch, like export 2 exe projects, and run the exe/open the project using scratch code.

@creepersaur This extension can already enter and exit fullscreen. It can also already get the width and height of the screen, hence the screen x/y reporters. I'm not exactly sure what you mean by setting the ability of a window to be resizeable. And finally, I already have plans to add blocks that can minimize and maximize the window, but they won't be added among a ton others once I fully have a list of which BrowserWindow apis I want GarboMuffin to add.

Ohh. I wasn't using the latest extension file. Now I see the screen w,h and the fullscreen, etc. This is very cool. The window resizeability means that currently, the user can drag on the corners of the application to change the size (w,h) of the window. Which you may not want in all cases. So the ability to stop the user from doing that could help. And also I don't know if this is possible, but removing the window border (including the edges of the application window and the top bar) so you could just have a plain window application, and then add your own border and things if you want.

@creepersaur Ahhh I see. I will try to add a block that counters window size change, but you can currently use a method where if the program detects the window size changes, then you can set the size back to the dimensions you want. And about window border, I'm not sure if it's possible, I thought of it, but from what I'm seeing, it may be only for .appx apps.

Maybe this could help?

@LilyMakesThings
Copy link
Contributor

LilyMakesThings commented Aug 20, 2023

Why did you move TurboHook so far up?

Edit: Nevermind broski made a typo

@CubesterYT
Copy link
Collaborator Author

Still a couple more things to do, but I gotta wait till I get home.

@SillyCubeGuy
Copy link

The wonders of Meta Games begins here.

@CubesterYT
Copy link
Collaborator Author

Welp, Window Controls V.1.0.0 is officially, truly, done. Even though it already was, the new TW updates allowed me to make it better. Now Window Controls is ready for merging.

@GarboMuffin
Copy link
Member

In some regards I question how necessary some of these blocks are but okay, that''s fine, don't need to change

Last thing is making sure that people are aware that like half of these blocks won't work in the online editor, only desktop app and packaged projects as Electron

@CubesterYT
Copy link
Collaborator Author

In some regards I question how necessary some of these blocks are but okay, that''s fine, don't need to change

Last thing is making sure that people are aware that like half of these blocks won't work in the online editor, only desktop app and packaged projects as Electron

I thought of that, in the documentation at the top, I state the places it mainly works in.

@CubesterYT
Copy link
Collaborator Author

I'm going to change something later in this updated code, I'll explain why later.

@GarboMuffin
Copy link
Member

I am saying you need a more obvious reminder of that than one line in documentation pages that few read

@CubesterYT
Copy link
Collaborator Author

Then I think I have an idea, I'll have to test it though.

@CubesterYT
Copy link
Collaborator Author

CubesterYT commented Aug 25, 2023

Ok finished making the changes. Prettier is my new enemy, at least eslint let you keep your own style.
Window Controls is ready

@CubesterYT
Copy link
Collaborator Author

Wait, let me add an example Project

@CubesterYT
Copy link
Collaborator Author

Nevermind, I'll do example project later, so it's ready for now.

@GarboMuffin GarboMuffin merged commit 82d9eba into TurboWarp:master Aug 25, 2023
3 checks passed
@CubesterYT CubesterYT deleted the WindowControls branch August 26, 2023 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet