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

Tooltips for server settings #519

Open
velhbxtyrj opened this issue Apr 9, 2018 · 69 comments
Open

Tooltips for server settings #519

velhbxtyrj opened this issue Apr 9, 2018 · 69 comments

Comments

@velhbxtyrj
Copy link
Collaborator

I offer for your consideration a few decorations for the admin panel: tooltips for server settings.
Who and what thinks about it?

1
default

Some code:

<style>
    .tooltip {border-bottom: 1px dotted #000000; color: #000000; outline: none; cursor: help; text-decoration: none; position: relative;}
    .tooltip span {margin-left: -999em; position: absolute;}
    .tooltip:hover span {font-family: Calibri, Tahoma, Geneva, sans-serif; position: absolute; left: 1em; top: 2em; z-index: 99; margin-left: 0; width: 250px;}
    .classic {padding: 0.8em 1em; background: #FFFFAA; border: 1px solid #FFAD33; border-radius: 5px 5px;}
</style>


	<tr>
		<td>Server Name <em class="tooltip">?<span class="classic">Name of your game server</span></em></td>
		<td><?php echo SERVER_NAME;?></td>
	</tr>
@iopietro
Copy link
Owner

iopietro commented Apr 9, 2018

I like it, it's a good idea :)!

@velhbxtyrj
Copy link
Collaborator Author

Is the code here okay? If the code is okay then I'll do it.

@iopietro
Copy link
Owner

iopietro commented Apr 9, 2018

I think that you should put that code in the main .css file (it should be compact.css).

@velhbxtyrj
Copy link
Collaborator Author

I know that. The main thing is that the code was not bad :) I'm asking about it :)

@iopietro
Copy link
Owner

iopietro commented Apr 9, 2018

I know a very little of css, but it seems fine to me.

@Shadowss
Copy link
Collaborator

You can make the change.

@velhbxtyrj
Copy link
Collaborator Author

Please tell me what the "Evasion Speed" and "Tourn Threshold" parameters mean in the settings.
And as I understand that the parameter "Natars Units Multiplier" is not implemented? Does it mean how strong will the troops of Natar be in the villages?

@iopietro
Copy link
Owner

Evasion speed: the time your troops spend to return home after an evasion.
Tourn Threshold: the total square after the tournament square begin to work (20 squares is the default value).
Natars Units Multiplier: it's used as a troops multiplier while creating Natars (through the "create_account.php" file).

@velhbxtyrj
Copy link
Collaborator Author

Natars Units Multiplier: it's used as a troops multiplier while creating Natars (through the "create_account.php" file).

Having looked at this file, I saw only that this parameter affects the number of sent scouts of the natars

$multiplier = NATARS_UNITS;
$sendspytroops = 1500 * $multiplier;

The number of warriors created in the villages of Natars depends on the speed of the server:

        if(SPEED > 3) {
            $speed = 5;
        } else {
            $speed = SPEED;
        }
        $q3 = "UPDATE " . TB_PREFIX . "units SET u41 = " . (64700 * $speed) . ", u42 = " . (295231 * $speed) . ", u43 = " . (180747 * $speed) . ", u44 = " . (20000 * $speed) . ", u45 = " . (364401 * $speed) . ", u46 = " . (217602 * $speed) . ", u47 = " . (2034 * $speed) . ", u48 = " . (1040 * $speed) . " , u49 = " . (1 * $speed) . ", u50 = " . (9 * $speed) . " WHERE vref = " . (int) $wid['wref'] . "";
			if(SPEED > 3) {
				$speed = 5;
			} else {
				$speed = SPEED;
			}
			if($size == 1) {
			    mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(1000, 2000) * $speed) . ", u42 = " . (rand(1500, 2000) * $speed) . ", u43 = " . (rand(2300, 2800) * $speed) . ", u44 = " . (rand(25, 75) * $speed) . ", u45 = " . (rand(1200, 1900) * $speed) . ", u46 = " . (rand(1500, 2000) * $speed) . ", u47 = " . (rand(500, 900) * $speed) . ", u48 = " . (rand(100, 300) * $speed) . " , u49 = " . (rand(1, 5) * $speed) . ", u50 = " . (rand(1, 5) * $speed) . " WHERE vref = " . (int) $wid . "");
			    mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 10, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = ".(int) $wid);
			} elseif($size == 2) {
			    mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(2000, 4000) * $speed) . ", u42 = " . (rand(3000, 4000) * $speed) . ", u43 = " . (rand(4600, 5600) * $speed) . ", u44 = " . (rand(50, 150) * $speed) . ", u45 = " . (rand(2400, 3800) * $speed) . ", u46 = " . (rand(3000, 4000) * $speed) . ", u47 = " . (rand(1000, 1800) * $speed) . ", u48 = " . (rand(200, 600) * $speed) . " , u49 = " . (rand(2, 10) * $speed) . ", u50 = " . (rand(2, 10) * $speed) . " WHERE vref = " . (int) $wid . "");
			    mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 20, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = ".(int) $wid);
			} elseif($size == 3) {
			    mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(4000, 8000) * $speed) . ", u42 = " . (rand(6000, 8000) * $speed) . ", u43 = " . (rand(9200, 11200) * $speed) . ", u44 = " . (rand(100, 300) * $speed) . ", u45 = " . (rand(4800, 7600) * $speed) . ", u46 = " . (rand(6000, 8000) * $speed) . ", u47 = " . (rand(2000, 3600) * $speed) . ", u48 = " . (rand(400, 1200) * $speed) . " , u49 = " . (rand(4, 20) * $speed) . ", u50 = " . (rand(4, 20) * $speed) . " WHERE vref = " . (int) $wid . "");
			    mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 20, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = ".(int) $wid);
			}
		}

@iopietro
Copy link
Owner

It's wrong then. It's not a problem though, Natars troops spawn will be reworked soon, their spawn will be based of top 100 best mains in the server.

@velhbxtyrj
Copy link
Collaborator Author

So it does not make sense to write tooltips for this Natars Units Multiplier since it will be deleted?

@Shadowss
Copy link
Collaborator

For evasion ( troops running from the attack ) cam be reworked to look more "beautiful" ?
eschiva

@velhbxtyrj
Copy link
Collaborator Author

So the question about the Evasion Speed. According to the standard, this is equal to 1. Ie if the player puts time 1 this equals one minute (in the attack the troops will be missing one minute). If we put 2 in the admin panel and the player sets 1 minute, will it be 2 minutes or 30 seconds (in the attack the troops will be missing 2 minutes or 30 seconds)?

@velhbxtyrj
Copy link
Collaborator Author

@phaze1G Can you take a look at the code specified in the first message?

@RevertIT
Copy link
Collaborator

I checked and it's good.

I did CSS for @Shadowss request in 2 posts above.
http://jsfiddle.net/EgLKV/9539/

@velhbxtyrj
Copy link
Collaborator Author

I'm thinking about what could remake the CSS for something more colorful. Maybe you can suggest something for this.

And in occasion of that that has offered @Shadowss that I think that it will look absolutely on another. This was taken from T4+ and there the withdrawal of troops works only for the capital. In our code as far as I understand it works for all villages.

@RevertIT
Copy link
Collaborator

@velhbxtyrj I don't like colorful things. I'm always sticking to 1-3 colors which are just small variants of the first one. for the tooltip maybe making it transparent and smaller?

http://jsfiddle.net/EgLKV/9553/

@iopietro
Copy link
Owner

@velhbxtyrj, the evasion speed should be (180 seconds / server speed)

@velhbxtyrj
Copy link
Collaborator Author

@iopietro @Shadowss I've implemented all the tooltips in the server settings for the administrator. Now it's the same for installation. I would like to know the opinion about how it looks. Continue the same, or maybe something needs to be changed?

@iopietro
Copy link
Owner

They look good! Good job :)! I think that you can continue the same.

@velhbxtyrj
Copy link
Collaborator Author

@iopietro I ran into a little problem. I started filling the configuration file during installation and found out that it was not connected to the language package ((
Could look at this. Or maybe it even makes sense to create a language pack for the installation and when loading the installer, we will have to select the language first before proceeding further?

@iopietro
Copy link
Owner

Mmh, I think that it would be more easy connecting the "Lang/en.php" file to the installation and in the future we could make a button for choosing the installation language.

@velhbxtyrj
Copy link
Collaborator Author

I tried to connect and it did not work :) Try it :)

@iopietro
Copy link
Owner

Ok, I'll try it.

@iopietro
Copy link
Owner

I tried it and it "works", but a lot of errors are displayed, so we should create a different language file for the installation, or we can just split the en.php file into specified files. For example we can create a folder for each language and put in it all languages file: GameEngine/Lang/en/building.php | GameEngine/Lang/en/installation.php etc. Let me know if you like it or not.

@velhbxtyrj
Copy link
Collaborator Author

I think can split the file into specified files. One for installation, one for the admin area, one for the game. Unless, of course, it does not take much time for this :)

@velhbxtyrj
Copy link
Collaborator Author

It looks great!

@Shadowss
Copy link
Collaborator

Who will update the GITHUB buttons ?

@RevertIT
Copy link
Collaborator

One more idea, we should replace the most of things we can with css instead of images. Rest of the stuff should be added as sprites css image. It would increase load speed by at least 30%.

@Shadowss
Copy link
Collaborator

Shadowss commented Apr 25, 2018

Can you do that ? I can give you access on the repository

@iopietro
Copy link
Owner

@phaze1G, They're awesome, great job :)!

@Shadowss
Copy link
Collaborator

@phaze1G : i give you an invitation for Collaborator. You can change now.

@RevertIT
Copy link
Collaborator

RevertIT commented Apr 25, 2018

I don't want to mess the code, I'm kinda new to GitHub functions.

PS: Changing images to CSS for buttons require editing every .php file and including text + class.

For example:

<input value="Login" name="s1" onclick="xy();" id="btn_login" class="button1" alt="login button">

@iopietro
Copy link
Owner

@phaze1G, Don't worry, github uses "git", every commit can be reverted without problems, edit as much code as you want. If you're not sure, you can fork this project, edit it from your fork and then create a pull request to this project, so we can look at the changes before committing them to the master branch.

@RevertIT
Copy link
Collaborator

@iopietro Can you explain me it a bit more, I just added CSS for new buttons and it added directly to master branch.

How should I edit and make pull requests? Should I do it with the desktop client or directly go to file in browser and edit?

@Shadowss
Copy link
Collaborator

Maybe you can reduced loads with 30% like you said

@iopietro
Copy link
Owner

@phaze1G, If you want to do pull requestes, you have to fork this project and then edit things in the fork you've made (you can fork it by clicking "Fork" here: https://github.com/Shadowss/TravianZ). After editing things in your fork you can open a pull request (from your fork) by clicking on "New pull request" in the main page of your fork.

If you want to commit many files at once, in different folders, etc. I advice you to use a git client, I personally use "TortoiseGit" (https://tortoisegit.org/), imho one of the simpler git client in circulation.

You can configure it simply by following this guide http://robertgreiner.com/2010/02/getting-started-with-git-and-tortoisegit-on-windows/ (the first I've found on google).

After configuring TortoiseGit (or any other git client), you have to clone your fork repository or this project repository. You can do that by openin the context menu in a folder you like, and then clicking on "Git Clone" (this is the procedure for TortoiseGit) and then pasting this repository or your fork git clone url (https://github.com/Shadowss/TravianZ.git).

You can obtain the "Git clone url" clicking on "Clone or download" in the main page of this project. For any doubts feel free to ask :) .

@velhbxtyrj
Copy link
Collaborator Author

It is necessary to decide.

  1. A slightly modified first option for displaying tooltips: https://jsfiddle.net/4ah7j674/

  2. Modified version in black: https://jsfiddle.net/1wnr9cc0/

@iopietro
Copy link
Owner

I prefer the second one.

@eliopinho
Copy link

agree

@velhbxtyrj
Copy link
Collaborator Author

I made the second option.

@iopietro I want to ask you to read and if necessary correct the texts. Link with the beginning of the texts below :)

https://github.com/Shadowss/TravianZ/blob/730378a84e91b18b4cd3455723deff03bb672bcc/GameEngine/Lang/en.php#L1252

@Shadowss
Copy link
Collaborator

@phaze1G you said : One more idea, we should replace the most of things we can with css instead of images. Rest of the stuff should be added as sprites css image. It would increase load speed by at least 30%.

Can you do that for us ? Reducing load with 30% is great for our servers and for our version.

@RevertIT
Copy link
Collaborator

There are dozen of images and ill need help from others too. Ill replace the much i can when i have free time

@Shadowss
Copy link
Collaborator

Great , thanks @phaze1G

@eliopinho
Copy link

friends , don't forget of include this in translation files 😃

really good job!

@velhbxtyrj
Copy link
Collaborator Author

Another one: https://jsfiddle.net/h1yzL6fs/

@iopietro
Copy link
Owner

I like it!

@eliopinho
Copy link

Really nice!
How about the blue color became green like the game ??

@velhbxtyrj
Copy link
Collaborator Author

@Shadowss @iopietro @phaze1G @eliopinho
I think it's worth to be determined definitively:

  1. https://jsfiddle.net/1wnr9cc0/

  2. https://jsfiddle.net/h1yzL6fs/1/

  3. https://jsfiddle.net/80kvj6vn/

@eliopinho
Copy link

I like 3 :)

@iopietro
Copy link
Owner

I like the third too, but i can't see it and the second from firefox.

@velhbxtyrj
Copy link
Collaborator Author

OK. Tomorrow I'll try to work on it and fix it for firefox.

@RevertIT
Copy link
Collaborator

Always keep font default or web safe. This one you used is not for web purposes.

@velhbxtyrj
Copy link
Collaborator Author

I have a little doubt that I would implement this. Does not work for old IE. And this browser is still used. The number of users is small, but we should not do what will be unpleasant for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants