DinoDevs / GladiatusCrazyAddon

This was "A browser addon for the Gladiatus browser game."
https://gladiatus.dinodevs.com
GNU General Public License v3.0
41 stars 30 forks source link

Gladiatus fixes optional #402

Closed FrutyX closed 2 years ago

FrutyX commented 2 years ago

When I have done some Gladiatus site style fixes, I knew about it, and then Thanos also mentioned - these can backfire, I am aware of it, so, I was thinking and I believe it would be wise, to be able to turn them off if they cause any troubles (but I think they can stay enabled by default).

Now, this pull request isn't complete, it's missing the script itself, that's the job for the Greek Javascript gods, I was looking into some options on stackoverflow and into GCA scripts, but I am 100% sure, that even if I somehow made it, Thanos would rework the code (which is by the way, completely understandable), so I end up with this.

I need you, to implement this into global.js, basically the script should apply this set of CSS rules when enabled, it should probably be easy for you. I have prepared the basics to save you the time.

I've marked the CSS with ID #glfix (but you can also use class, it depends on your implementation), under the locales and settings, it's known as "gladiatus_site_fixes". Well, you can see the changes made for yourself.

Thank you for the help 😄

GramThanos commented 2 years ago

Some info:

To add a new option/setting, you need to add the default value underthe corresponding section inside the "gca.data.js" and then following the same approach do the same at "settings.js". That will also create a new translation for the en.js language.

Then for page wide css edit, we add a new class on the page's HTML element. This can be done inside the preload function at the top of the "global.js". (the preload is called as soon as possible, while the load is called after the page elements have loaded, thus by adding all these css changes on the preload, the page will be rendered directly with the changed css applied.

I will have a look at it, but now today.

FrutyX commented 2 years ago

Yes Thanos, like I've said, I have done some basics (check file changes), just take a look at it when you have the time and the mood for it, no rush.

But what you wrote - I'll extract it and use it for the dev docs (if it's not already there).

FrutyX commented 2 years ago

I got 2 more CSS improvements ready once this is implemented, hehehe.

FrutyX commented 2 years ago

How many people are in line for the Thanos magic? :D

I think this would be easier with jQuery, but I can't figure out the right setup, I mean, it's more complicated, you need to give them the class first, and then manipulate with it... And all that from a CSS file.

FrutyX commented 2 years ago

You know how to get to me - patience.

I was scavenging GCA scripts again and found what I needed, appears to be extremely simple in the end, I am not sure if it's missing something, I don't see any problem or error. The main script is implemented now.

FrutyX commented 2 years ago

That's fine, I'll just.... implement it, review it, and merge it, lol.

It's not like you can't do some changes in master later anyway, right.