1 file piaciuto
948 commenti
32 video
4 caricamenti
29 seguaci
11.947 downloads
@light_cone3716 Sorry if the pics were misleading. The pic previews are real mods, the full screen presentation images are wallpapers of image shot by professionals with real cars. I've never seen a C44 mod for GTA V.
Video was made with this script.
https://www.youtube.com/watch?v=O25ltEW5hhw&t=91s
@JoyLucien If you're interested, here is a snippet of code from the for loop, which illustrates the algorithm, but the entire code is over 200 LOCs not including the hundreds of lines to spawn the peds fully customized.
Vector3 textureRes = Function.Call<Vector3>(Hash.GET_TEXTURE_RESOLUTION, SpriteLibrary, spriteNames[i]);
float scaleX = textureRes.X / GTA.UI.Screen.Resolution.Width;
float scaleY = textureRes.Y / GTA.UI.Screen.Resolution.Height;
// Calculate the position of each sprite
int column = i % totalColumns; // Column index
int row = i / totalColumns; // Row index
// Calculate sprite positions
float spriteX = (column * (spriteBaseWidth + horizontalSpacing)) + (spriteBaseWidth / 2);
float spriteY = (row * (spriteBaseHeight + verticalSpacing)) + (spriteBaseHeight / 2);
@JoyLucien The algorithm itself is pretty imple. Your variables are the number of rows, the number of columns, the texture resolutions (width and height), the space between rows, and the space between the sprites in columns. That as simple as it gets. With respect to scrolling with the mouse wheel, well there are controls for that as well, but it entails replacing rows as you scroll. I'm sure it can be done with dot net as well. Lots of math, but none of it too complex.
I haven't done any research on z order in this context and I doubt there is any documentation. What I did, thanks to your suggestion, of creating this kind of menu isn't common - I've never seen it done before. Getting back to your question regarding sprites:
The sprites/images in a texture dictionary can be implemented in 3 ways. An existing vanilla ytd, a user defined ytd with the vanilla ytds, and finally a user created dlc.rpf. I've done and tested all 3. The default behavior for the mouse here is that it will correctly be in the foreground. I don't know if you noticed, but I changed the cursor style as it hits the target coordinates.
The sprites/images, external, on a HDD or SSD, in folders or subfolders, have an issue with the mouse. It goes underneath the sprite and consequently can't be seen. There is likely a way to change the z-order, I hope, but again I have not researched it because I'm not going any further with this menu approach. This script will never be mainstream, which is why I call it professional, because it requires work and the ability to edit text files which many here would not understand given they download the dumbest mods possible - mods to delete mods and mods to manage mods (nobody uses symbolic links except me????)
Once more thanks again for your suggestions and insights. Helps fuel creativity.
@JoyLucien Thanks. I cheated. I used a ytd library instead of external images. This is because I haven't found any documentation regarding z order. The ytd sprite and the external customsprite have very different behaviours. Aside from the z-order issue, the ytd (library) sprite uses 0 to 1, while the customsprite uses a 1280 x 720 base.
I don't have the energy to go back to this script, which is customsprite based, and figure out the z-order. Also, the code to space images vertically and horizontally is a huge PITA. Given that categories (subfolders) can have hundreds of images, this would require lots of math and lots of programming to handle different quantities etc. There are ways ofc, but I'm burned out from scripting right now - largely because I can't find any documentation and everything is done thru experimentation.
@JoyLucien Thank you for pushing me to create innovative sh*T.
https://www.youtube.com/watch?v=-qkaG5UaVQQ
So this is the proof of concept. A full version would have as many images necessary for a menu.
https://www.youtube.com/watch?v=kK3WzMd066c
@JoyLucien I just tried something and it works perfectly. Will post a video soon.
@JoyLucien Yes I thought of that, but do you realize how many menus it would take if you want to have many rows?
i think the best bet, if it's doable, is to use mouse clicks
float cursorX = Function.Call<float>(Hash.GET_CONTROL_NORMAL, 0, (int)Control.CursorX);
float cursorY = Function.Call<float>(Hash.GET_CONTROL_NORMAL, 0, (int)Control.CursorY);
// Check if cursor is in the expanded area
bool inArea = (cursorX >= areaX) && (cursorX <= areaX + areaWidth) &&
(cursorY >= areaY) && (cursorY <= areaY + areaHeight);
@MissySnowie Thank you for the stars.