Travianz-Legacy icon indicating copy to clipboard operation
Travianz-Legacy copied to clipboard

Tooltips for server settings

Open velhbxtyrj opened this issue 6 years ago • 69 comments

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>

velhbxtyrj avatar Apr 09 '18 19:04 velhbxtyrj

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

iopietro avatar Apr 09 '18 19:04 iopietro

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

velhbxtyrj avatar Apr 09 '18 19:04 velhbxtyrj

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

iopietro avatar Apr 09 '18 19:04 iopietro

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

velhbxtyrj avatar Apr 09 '18 19:04 velhbxtyrj

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

iopietro avatar Apr 09 '18 20:04 iopietro

You can make the change.

Shadowss avatar Apr 10 '18 06:04 Shadowss

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?

velhbxtyrj avatar Apr 10 '18 20:04 velhbxtyrj

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).

iopietro avatar Apr 10 '18 22:04 iopietro

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);
			}
		}

velhbxtyrj avatar Apr 11 '18 08:04 velhbxtyrj

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.

iopietro avatar Apr 11 '18 09:04 iopietro

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

velhbxtyrj avatar Apr 11 '18 09:04 velhbxtyrj

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

Shadowss avatar Apr 11 '18 09:04 Shadowss

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 avatar Apr 11 '18 09:04 velhbxtyrj

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

velhbxtyrj avatar Apr 13 '18 11:04 velhbxtyrj

I checked and it's good.

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

RevertIT avatar Apr 13 '18 12:04 RevertIT

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.

velhbxtyrj avatar Apr 13 '18 12:04 velhbxtyrj

@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/

RevertIT avatar Apr 13 '18 13:04 RevertIT

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

iopietro avatar Apr 13 '18 13:04 iopietro

@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?

velhbxtyrj avatar Apr 21 '18 19:04 velhbxtyrj

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

iopietro avatar Apr 21 '18 20:04 iopietro

@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?

velhbxtyrj avatar Apr 21 '18 22:04 velhbxtyrj

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.

iopietro avatar Apr 22 '18 10:04 iopietro

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

velhbxtyrj avatar Apr 22 '18 14:04 velhbxtyrj

Ok, I'll try it.

iopietro avatar Apr 22 '18 14:04 iopietro

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.

iopietro avatar Apr 22 '18 23:04 iopietro

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 avatar Apr 23 '18 05:04 velhbxtyrj

I do not know much of php code, but would be simplier link whole game to en.php and all languages should be translated by these file, on the installation simply add some kind of function to rename the desired lang file to "en.php" avoiding the work to modify all game files to work properly.. But this only an idea. The experts on this matter have a final word :)

Or

Translate only the game itself, leave admin and installation in english (normally the admin have the skills to do anything in english, such has install apache php mysql etc.. all of those are english (no big deal))

eliopinho avatar Apr 23 '18 13:04 eliopinho

@eliopinho, Splitting en.php in more files isn't a problem nor having multiple languages files. The big "problem" is the huge amount of work needed to find every single not localized string in the game and put them in language files.

If you want, you can help us by doing so, don't worry, there's no hurry, if you'll accept you can do it without constrains or deadlines.

iopietro avatar Apr 23 '18 18:04 iopietro

@iopietro Friend i do not know how to identify and edit those codes :(

eliopinho avatar Apr 23 '18 22:04 eliopinho

Well, I can do it. But this requires a lot of time and the main thing is to solve the problem with how the files for translation will be implemented. After this question is solved, I will be able to change all the files.

P.S. In general, it would be interesting to implement translation with the help of .po and .mo files because they have a more flexible translation system. But editing requires special software.

velhbxtyrj avatar Apr 24 '18 05:04 velhbxtyrj