Sesu8642 / FeudalTactics

Strategy game with countless unique and challenging levels.
GNU General Public License v3.0
79 stars 20 forks source link

Ability to save/copy seed #62

Open Sesu8642 opened 1 year ago

Sesu8642 commented 1 year ago

Good suggestion i received via email. The suggestion was to make it copyable on click/tap. It should be somehow visible to the user, maybe there can be a copy button next to the random button. In the ingame menu where the seed is displayed, clicking the label could copy it. It would be even more comfortable to have the ability to save some seeds as favorites. Could be an option in the message when the game ends.

Mina928 commented 1 year ago

Hello @Sesu8642 ! I am a beginner interested in contributing to this project. Could I please have it assigned to me so I can have go?

Sesu8642 commented 1 year ago

Hi @Mina928, I appretiate it! I think the first step should be to copy the seed on tap/click. Let me know if you need any guidance 😃

Please make sure you agree with the CLA before starting any work and sign it in your PR.

Mina928 commented 1 year ago

Hello! I have mostly got this working. The only problem left is drawing a new sprite onto the new copy button. The textureAtlas.createSprite() method seems to be returning NULL. I looked at the texture.atlas file to try and add the new sprite details, but I cannot get it to work.

Let me know what you would like me to do.

Sesu8642 commented 1 year ago

Thanks! The texture atlas is built using the GDX texure packer GUI. The project file is this. But be warned: the tool tends to put your absolute paths in the project file sometimes. I can do this part for you if you want. Fist step would be to create the graphic itself though. Have you started with that?

Sesu8642 commented 1 year ago

I had a brief look at your branch. I think you can copy to the clipboard more easily using LibGDX framework functionality. Gdx.app.getClipboard().setContents("hello world");

Mina928 commented 1 year ago

Cool thanks! I will take a look at the GDX texture to pack to see if I can work it out, otherwise it would be great if you could do that part.

Yes, I did make some basic sprites, with a green tick for when the button is pressed, and the usual copy icon for when the button has not been pressed yet, however have not pushed those changes yet, will do that in the next commit. Feel free to change them or replace them, I am a newbie when working with sprites, so they could be improved.

Also, thanks so much for the suggestion with the clipboard copy alternative, will try implementing that :)

Mina928 commented 1 year ago

Good news a lot of it was a success!

Managed to make new textures files that include the new sprites. Ran into a new issue now where I cannot get the random seed button, and copy button to have different sprites. The random seed button has the sprites intended for the copy seed button. This may be due to the Skin, I tried initializing a new one but that lead to several errors.

I will make a PR with what I have for now so others can also try looking into fixing it. Will also continue to work on it while it stays unresolved.

Sesu8642 commented 2 months ago

Copying is implemented now. Leaving this open for the option to save seeds in the game.