 Hello and welcome to part 3. So always let's go back to the things I got wrong from the previous videos And one thing I had no idea about is that when you select one of the menu buttons You don't always have to create the items from the code Actually, if you select them, you will see here that this button here appears and From here, I can create items and name them however. I want This was the about one. You can set all the other properties here. You can add as many as you like and Remove them as well. It's easy to miss like I did and it also happens with other notes, so just be mindful to check on this bar as well and Following another user suggestion I'm gonna add the save button for this and the title for the program So now if we go and test it we get here part 3 simple text editor We want to know, you know Just the path of the file that we are opening if we have an untitled file or all that information Get it on there. So let's start with the title. How can we do that? Let's first name create a variable. This is gonna be app name Which is gonna be text editor. This is gonna be the name of our app Then let's create another one which is gonna be Current file This will store the path of the file. Let's say Untitled now Let's Set the window Name To do that you can call the OS class and the set window title Function and then you pass a string We're gonna pass the app name Then we're gonna add the usual dash Then we're gonna add the current file So this is gonna change. Let's try it out. Yeah, text editor untitled This sounds good. If you don't want to set it from here the default on this window is gonna be set here from the project settings General config. This is the name of the app Before anything is loaded. So instead of calling it part 3 that's gonna do text editor and Loading You're probably not gonna be able to read that but again just in case you like you will see that it flickers a little bit there Just in case they have a super slow machine and they're running your program If your program like needs to load a lot of resources, yeah Then we go to untitled. Okay. So what we want to do now is that every time we open a file Or we save a file Let's save that path and update the Window title. So this we're gonna be calling this Many times. I'm gonna separate it in a function. It's gonna be update window title And here we Yeah, that's okay. No arguments for now. Let's go in Move this here and We're gonna call it from the ready Okay So we want to update this variable current file when we open a file so Here it's gonna be equal to the path that we currently running actually this print. We don't need it anymore It was for debugging before bye and Now we're gonna call the update window title and let's do the same on the save Okay, let's see if this is working We have an untitled. Let's gonna open The app.gd and we get the full path here. That's nice So then if I want to start over like we should also add a new file option Let's do that. Let's create a new file new file and Let's do funk new file Let's see. We want to set the current File to untitled again We want to update the window title then we want to get the text edit text and Equal to Nothing and that should be right. I would do everything we update the title and Yeah, okay, let's call this function now from here And if item Name is equal to new file Let's call it new file function and let's try it out File open. Let's see. Let's open the project one Okay, we get the title from the private one. Let's create a new file and yeah Seems like it is working. So have already the new file and the titles now that we are adding more things to the menus, let's add In the help a link to the God website You know, like you usually want to here you have community issues QA, you know, like if you want to add your website as a link You can create that very easily Let's go to the item help best function and if the name is equal to God at website Wow Web site Okay God at website Let's open a browser with the Website which in this case you can do it with shell open and now a string with the URL. I think it was HTTPS God at engine.org Or Or okay, I Think it's like that. Let's see if it opens help God website Yes, we have the website here Okay, so I think we have pretty much mastered these basic Elements, let's go now and do the save file instead of save us because you know you want to save it instead of Naming it all the time So let's go and create the save function Sorry save item name and now we have to create the function. We're just gonna be pretty similar to The save file of Save file dialogue, but with a couple of conditions So this is gonna be save file So for what we know the name of the file is gonna be stored in current file, so Current file is gonna be our path But we want to check first if pad is equal to entitled Which is basically like a new file that we never saved before We want to instead of continuing with this script. We want to trigger The pop-up for the save us so save as file dialogue pop up That means that if we haven't saved the file yet It's gonna ask for a name and things like that But if we already have like the path set and everything let's go ahead and do the same as we did here, which is saving Opening the file With the path that we already have from the current file. We stored the information. We close the file We update this. I don't think we need it because it's gonna be the same So we remove that and we update the window title So of course now we link that save function Right and then we will have to refactor all this. It's starting to look very very bad Okay, if save we can call the save file Okay Let's try it out Let's open a file Uh, let's see we're on the part three. Let's open this same file And we have the script here. Let's add a comment at the end Here and let's say Hello from our text editor Let's save it and we have it here It's been updated from our editor We know the path from here and everything so yeah Delete it save it again. We see the update. So it is working That's great That's it for today. See you in the next video. Thanks everyone for all the comments. I really really really appreciate it and On the next video, we're gonna cover the layouts and if we have enough time for that the custom themes Which is pretty exciting if you want to make your app to look a little bit better than the default But that's gonna be it for now. So Thanks again Remember to like share subscribe and all those all those things Okay, bye