1 | <?php |
---|
2 | define('MPATH', 'mods/signature_generator/signatures/default/'); |
---|
3 | $im = imagecreatefrompng(MPATH.'default.png'); |
---|
4 | |
---|
5 | $red = imagecolorallocate($im, 255, 10, 10); |
---|
6 | $orange = imagecolorallocate($im, 150, 120, 20); |
---|
7 | $blue = imagecolorallocate($im, 0, 0, 200); |
---|
8 | $white = imagecolorallocate($im, 255, 255, 255); |
---|
9 | $black = imagecolorallocate($im, 0, 0, 0); |
---|
10 | |
---|
11 | $grey_trans = imagecolorallocatealpha($im, 50, 50, 50, 50); |
---|
12 | $greyred_trans = imagecolorallocatealpha($im, 50, 10, 10, 50); |
---|
13 | |
---|
14 | $name = $pilot->getName(); |
---|
15 | |
---|
16 | $list = new KillList(); |
---|
17 | $list->setOrdered(true); |
---|
18 | $list->setLimit(1); |
---|
19 | $list->setPodsNoobships(false); |
---|
20 | $list->addInvolvedPilot($pilot); |
---|
21 | $kill = $list->getKill(); |
---|
22 | |
---|
23 | // corp |
---|
24 | $box = imagettfbbox(10, 0, MPATH.'GUNSHIP2.TTF', $corp->getName()); |
---|
25 | $width = $box[4]; |
---|
26 | imagettftext($im, 10, 0, 319-$width, 71, $black, MPATH.'GUNSHIP2.TTF', $corp->getName()); |
---|
27 | imagettftext($im, 10, 0, 318-$width, 70, $red, MPATH.'GUNSHIP2.TTF', $corp->getName()); |
---|
28 | |
---|
29 | // player |
---|
30 | $box = imagettfbbox(16, 0, MPATH.'GUNSHIP2.TTF', $name); |
---|
31 | $width = $box[4]; |
---|
32 | imagettftext($im, 16, 0, 319-$width, 91, $black, MPATH.'GUNSHIP2.TTF', $name); |
---|
33 | imagettftext($im, 16, 0, 318-$width, 90, $red, MPATH.'GUNSHIP2.TTF', $name); |
---|
34 | |
---|
35 | // time, victim, victim corp and ship killed |
---|
36 | imagettftext($im, 11, 0, 39, 16, $black, MPATH.'spaceage.ttf', $kill->getTimeStamp()); |
---|
37 | imagettftext($im, 11, 0, 38, 15, $white, MPATH.'spaceage.ttf', $kill->getTimeStamp()); |
---|
38 | imagettftext($im, 11, 0, 39, 26, $black, MPATH.'spaceage.ttf', $kill->getVictimName()); |
---|
39 | imagettftext($im, 11, 0, 38, 25, $white, MPATH.'spaceage.ttf', $kill->getVictimName()); |
---|
40 | imagettftext($im, 11, 0, 39, 36, $black, MPATH.'spaceage.ttf', $kill->getVictimCorpName()); |
---|
41 | imagettftext($im, 11, 0, 38, 35, $white, MPATH.'spaceage.ttf', $kill->getVictimCorpName()); |
---|
42 | |
---|
43 | imagettftext($im, 11, 0, 6, 46, $black, MPATH.'spaceage.ttf', $kill->getVictimShipName()); |
---|
44 | imagettftext($im, 11, 0, 5, 45, $white, MPATH.'spaceage.ttf', $kill->getVictimShipName()); |
---|
45 | |
---|
46 | // ship |
---|
47 | $sid = $kill->getVictimShipExternalID(); |
---|
48 | $img = imagecreatefrompng("img/ships/64_64/".$sid.".png"); |
---|
49 | imagecopyresampled($im, $img, 5, 5, 0, 0, 30, 30, 64, 64); |
---|
50 | |
---|
51 | // player portrait |
---|
52 | |
---|
53 | if (!$pid) |
---|
54 | { |
---|
55 | $pid = 0; |
---|
56 | } |
---|
57 | $img = imagecreatefromjpeg("cache/portraits/".$pid."_256.jpg"); |
---|
58 | imagefilledrectangle($im, 318, 18, 392, 92, $greyred_trans); |
---|
59 | imagecopyresampled($im, $img, 320, 20, 0, 0, 70, 70, 256, 256); |
---|
60 | imagedestroy($img); |
---|
61 | ?> |
---|