Skip to content

Commit

Permalink
Handle new influences, apply all the API changes for 3.9 patch
Browse files Browse the repository at this point in the history
  • Loading branch information
axelberardino committed Dec 21, 2019
1 parent 7c993d2 commit 0237cbe
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 40 deletions.
2 changes: 1 addition & 1 deletion data/template/parts/divinationcard.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{ $item := .Item }}
{{ $small := .Small }}
<div class="cardFace">
<img src="https://web.poecdn.com/image/gen/divination_cards/{{ $item.ArtFilename }}.png">
<img src="http://web.poecdn.com/image/divination-card//{{ $item.ArtFilename }}.png">
</div>
<div class="itemBoxContent">
<div class="itemHeader">
Expand Down
2 changes: 1 addition & 1 deletion data/template/parts/item.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</div>
<div class="socketPopups"></div>
<div class="iconContainer">
<div class="icon {{ if .IsElder }}elder{{ end }} {{ if .IsShaper }}shaper{{ end }}" {{ GenSpecialBackground . | attr }}>
<div class="icon {{ InfluenceName . }}" {{ GenSpecialBackground . | attr }}>
<img class="object-img" src="{{ .Icon }}" alt="" />

{{ if .Sockets }}
Expand Down
6 changes: 3 additions & 3 deletions data/template/parts/itemdesc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
{{ else }}

<div class="itemBoxContent">
<div class="itemHeader {{ ItemRarityHeight .FrameType }} {{ if .IsElder }}elder{{ end }} {{ if .IsShaper }}shaper{{ end }} {{ if .IsVeiled }}veiled{{ end }}">
<span class="l"></span>
<div class="itemHeader {{ ItemRarityHeight .FrameType }} {{ if .IsVeiled }}veiled{{ end }}">
<span class="l symbol {{ InfluenceName . }}"></span>
{{ if .Name }}
<div class="itemName">
<span class="lc">{{ .Name }}</span>
Expand All @@ -33,7 +33,7 @@
<span class="lc">{{ .Type }}</span>
</div>
{{ end }}
<span class="r"></span>
<span class="r symbol {{ InfluenceName . }}"></span>
</div>

<div class="content">
Expand Down
4 changes: 2 additions & 2 deletions data/template/parts/itemtext.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ Veiled
{{ .DescriptionText }}
{{- end }}

{{- if .IsElder }}
{{- if .Influences.Elder }}
--------
Elder Item
{{- end }}
{{- if .IsShaper }}
{{- if .Influences.Shaper }}
--------
Shaper Item
{{- end }}
Expand Down
32 changes: 24 additions & 8 deletions demo/all_stash_types/stash_15.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Quivers\/QuiverFire.png?scale=1&w=2&h=3&v=423d4bf842bf5cc10d42a4300b3f5725",
"league": "Standard",
"id": "b632720dc6aad589b5a5d1c065b7737f667b35a114a1dfa89862a80e20fbc3f6",
"shaper": true,
"influences": {
"shaper": true
},
"name": "Brood Needle",
"typeLine": "Fire Arrow Quiver",
"identified": true,
Expand Down Expand Up @@ -512,7 +514,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Weapons\/TwoHandWeapons\/Bows\/Bow2.png?scale=1&w=2&h=3&v=c6b09fe119e14b0a1af35c694e705bd3",
"league": "Standard",
"id": "ee5f72353b8e920b73ce0371c7c7aff343a29a7a31b0a2e7adebf8e5a4535c2e",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -633,7 +637,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Weapons\/OneHandWeapons\/OneHandMaces\/OneHandMace3.png?scale=1&w=1&h=3&v=0da211513b53dc8acc1a040ee18b6347",
"league": "Standard",
"id": "f4c6c02d7c864717c735c76c7cbe86e61c75bb626f73da8f96f03eadd6b81ba3",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -2086,7 +2092,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/Shields\/ShieldDex2.png?scale=1&w=2&h=2&v=958754f78c163c1a80befdca6e8ce7bf",
"league": "Standard",
"id": "25556a7e6fe68187f3a12d86ee4c479b9fa1f626dbca352629fe3c9d06305df2",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -2182,7 +2190,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Weapons\/TwoHandWeapons\/TwoHandMaces\/TwoHandMace2.png?scale=1&w=2&h=4&v=c013588ad91c15f8411b58f3d5b93300",
"league": "Standard",
"id": "78d2d324d85ad52bfc8fff00afb046183bcadc6694c7dcef7e283a3f1def41e1",
"elder": true,
"influences": {
"elder": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -2934,7 +2944,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/Helmets\/HelmetDex9.png?scale=1&w=2&h=2&v=e6a9c07a19f574356cad3d7fc7506641",
"league": "Standard",
"id": "cdfcea87a5ff9e064598e40d9bf972fbe4ca2b9739082e80c0e8c894195980f6",
"elder": true,
"influences": {
"elder": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -3012,7 +3024,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Weapons\/OneHandWeapons\/Wands\/Wand5.png?scale=1&w=1&h=3&v=1693f03dab28c272223acf156ce9107e",
"league": "Standard",
"id": "92f4d641d6e5fee14da4cfee12353983808e3b69e453444caf64cc6cb0313451",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -3120,7 +3134,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Belts\/Belt5.png?scale=1&w=2&h=1&v=5aa764352f06af8fd3231e6a52d710f5",
"league": "Standard",
"id": "06c70f32a60c4b3cab175de05f3c14e6749bbf8046619e7f66e57a090db15ad1",
"shaper": true,
"influences": {
"shaper": true
},
"name": "Horror Twine",
"typeLine": "Heavy Belt",
"identified": true,
Expand Down
60 changes: 45 additions & 15 deletions demo/all_stash_types/stash_16.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/Boots\/BootsInt4.png?scale=1&w=2&h=2&v=4808dffa0aa9745b57119af9319d0be3",
"league": "Standard",
"id": "523a1fbde99678667e50f9b71757d4a96120477025167a9048d7af752606a98b",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -452,7 +454,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Weapons\/OneHandWeapons\/Claws\/Claw6.png?scale=1&w=2&h=2&v=14ffba33f70a7825bc3b08f5f0ec6878",
"league": "Standard",
"id": "50b95526b96776695a648f8f70575b5fdca7d94d15b3cad1dfee6ebd707bf47e",
"elder": true,
"influences": {
"elder": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -586,7 +590,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/Gloves\/GlovesStr4.png?scale=1&w=2&h=2&v=b2997b2df11d3b19cbb6a4c3054acda6",
"league": "Standard",
"id": "90e41bf2acbbea6641ed0eb26e00ec53e04ad64f5457410c77d4cbd6984782eb",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -664,7 +670,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/Helmets\/HelmetStrDex6.png?scale=1&w=2&h=2&v=80d0b49dc84d2c96f40a4cb270d96748",
"league": "Standard",
"id": "b8f74d248e47d6ab739e504cf570b052fd66d161ba943ce40714031a400ea16a",
"elder": true,
"influences": {
"elder": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -767,7 +775,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Weapons\/OneHandWeapons\/OneHandSwords\/OneHandSword5.png?scale=1&w=2&h=3&v=20d0442f22b206975e82638308fbfe3b",
"league": "Standard",
"id": "58458ceca7525c90b22648d4c4941a716e0f291e828cc4de95d1131829c451d4",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -1022,7 +1032,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/Shields\/ShieldDex2.png?scale=1&w=2&h=2&v=958754f78c163c1a80befdca6e8ce7bf",
"league": "Standard",
"id": "7ff398d89e9c12807022675d2e83b1f706e128c5df6e7676692a38ba7751c353",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -1113,7 +1125,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/Helmets\/HelmetDexInt9.png?scale=1&w=2&h=2&v=f16dbb804ba232a15e23b3539c67b774",
"league": "Standard",
"id": "4f5feb6024b9aab5745e6b4d234ad97beedb7657d34263cbf017a7ded02b4f40",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -1314,7 +1328,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Weapons\/OneHandWeapons\/OneHandSwords\/OneHandSword2.png?scale=1&w=1&h=3&v=a94ce74a6007ca561bb3a4bfa3abe15b",
"league": "Standard",
"id": "e2dffd322a0d29942564c2f8a6142fab6c519ab6dbb9cfa0d557184b7a0836cd",
"elder": true,
"influences": {
"elder": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -1842,7 +1858,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Weapons\/TwoHandWeapons\/Staves\/Staff4.png?scale=1&w=2&h=4&v=8af1ab046fb7f7caae8c7ce5b186b63b",
"league": "Standard",
"id": "6fcde8409dd31328aadb82d29b22a85ebd490049fbcf348d1da0406211fd8fa2",
"elder": true,
"influences": {
"elder": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -2074,7 +2092,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/BodyArmours\/BodyStr4A.png?scale=1&w=2&h=3&v=f9314c7ebb635aa283be76640df8ff00",
"league": "Standard",
"id": "c25307f64aa8d817ebad85888574fdac67e044d2410ffd0387a634387296468b",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -2166,7 +2186,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/Gloves\/GlovesDexInt2.png?scale=1&w=2&h=2&v=8301a0119606f022ec99a9723749003d",
"league": "Standard",
"id": "4ba6eb66368405138f342eb5743d67535d6f4694fb75646933f9610f7d47c4f2",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -2281,7 +2303,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/Helmets\/HelmetStrInt5.png?scale=1&w=2&h=2&v=39a1f3a8764bd4fbe33230be7004c43b",
"league": "Standard",
"id": "dadc8bc691ae89aab26e01a9a538568180a675d9d15f60d7c6001677a3b4d3ce",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -2696,7 +2720,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/BodyArmours\/BodyStrInt2C.png?scale=1&w=2&h=3&v=da51dd4c9ab2a0ddb4ea9e2edc4fb6b3",
"league": "Standard",
"id": "e80cef36a374b488edfd71d75cf5bbfe31892174640a8815d879002eae678a91",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down Expand Up @@ -2800,7 +2826,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Belts\/Belt3.png?scale=1&w=2&h=1&v=a559821037f54c94dae053b90bcea363",
"league": "Standard",
"id": "b3311dc8a3de45507244e8b007443ac79e63bcb5ffe15ec83fa0441611d9b472",
"elder": true,
"influences": {
"elder": true
},
"name": "Empyrean Bind",
"typeLine": "Leather Belt",
"identified": true,
Expand Down Expand Up @@ -2843,7 +2871,9 @@
"icon": "https:\/\/web.poecdn.com\/image\/Art\/2DItems\/Armours\/BodyArmours\/BodyDex2C.png?scale=1&w=2&h=3&v=b03b38ea29d4757b2578adea2a86115d",
"league": "Standard",
"id": "1ac2b12359ec4a88c1fb418188cd90c1a488dcfcc87ccc5176a552461269b2e6",
"shaper": true,
"influences": {
"shaper": true
},
"sockets": [
{
"group": 0,
Expand Down
Empty file modified demo/all_stash_types/stash_5.json
100755 → 100644
Empty file.
40 changes: 36 additions & 4 deletions generate/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func LoadAllTemplates() (*template.Template, error) {
"ItemRarity": ItemRarity,
"ItemRarityType": ItemRarityType,
"ItemRarityHeight": ItemRarityHeight,
"InfluenceName": InfluenceName,
"GenSpecialBackground": GenSpecialBackground,
"ColorType": ColorType,
"AugmentedType": AugmentedType,
Expand Down Expand Up @@ -309,14 +310,45 @@ func ItemRarityHeight(frameType models.FrameType) string {
return heightClass
}

// InfluenceName returns the influence name.
func InfluenceName(item models.Item) string {
if item.IsSynthesised {
return "synthetic"
}
if item.IsVeiled {
return "veiled"
}

if item.Influences.Shaper {
return "shaper"
}
if item.Influences.Elder {
return "elder"
}
if item.Influences.Redeemer {
return "redeemer"
}
if item.Influences.Crusader {
return "crusader"
}
if item.Influences.Hunter {
return "hunter"
}
if item.Influences.Warlord {
return "warlord"
}

return ""
}

// GenSpecialBackground generates a special background
// like shaper or elder ones.
func GenSpecialBackground(item models.Item) string {
pattern := ""
if item.IsShaper {
if item.Influences.Shaper {
pattern = "style='background-image: url(\"https://www.pathofexile.com/image/inventory/ShaperBackground.png?w=%d&h=%d&x=%d&y=%d\");'"
}
if item.IsElder {
if item.Influences.Elder {
pattern = "style='background-image: url(\"https://www.pathofexile.com/image/inventory/ElderBackground.png?w=%d&h=%d&x=%d&y=%d\");'"
}
if pattern == "" {
Expand Down Expand Up @@ -679,10 +711,10 @@ func GenNaiveSearchIndex(item models.Item) string {
func itemCategoryAttribute(item models.Item) []string {
res := make([]string, 0, 5)

if item.IsShaper {
if item.Influences.Shaper {
res = append(res, "shaper")
}
if item.IsElder {
if item.Influences.Elder {
res = append(res, "elder")
}
if item.IsIdentified {
Expand Down
2 changes: 1 addition & 1 deletion misc/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package misc

// Version of the application.
const Version = "v0.7"
const Version = "v0.8"
Loading

0 comments on commit 0237cbe

Please sign in to comment.