ByMykel / CSGO-API

An unofficial JSON API for Counter-Strike 2 in multiples languages. List of skins, cases, stickers, collections, collectibles, agents, graffiti, keys, patches and music kits.
https://bymykel.github.io/CSGO-API/
MIT License
260 stars 31 forks source link

Graffiti colours missing #35

Closed xapolloandy closed 5 months ago

xapolloandy commented 1 year ago

Base Grade Graffitis all appear white, would love to have all the colours

ByMykel commented 1 year ago

I've been investigating this for a couple of days and I don't know how to implement this without hard-coding all the data.

For example some sprays have different colors and not all of them are the same 19 variants. I don't know how to figure out the exact colors without checking some wiki site.

If no one know some way to avoid hard-coding I think I will start adding some sprays little by little as there are too many.

piyanggoon commented 6 months ago

@ByMykel I think based on rarity if equal "rarity_common" will have 19 variants.

csgo_english.txt

  "Attrib_SprayTintValue_0"                   "Multicolor"
  "Attrib_SprayTintValue_1"                   "Brick Red"
  "Attrib_SprayTintValue_2"                   "Blood Red"
  "Attrib_SprayTintValue_3"                   "Tiger Orange"
  "Attrib_SprayTintValue_4"                   "Dust Brown"
  "Attrib_SprayTintValue_5"                   "Desert Amber"
  "Attrib_SprayTintValue_6"                   "Tracer Yellow"
  "Attrib_SprayTintValue_7"                   "Battle Green"
  "Attrib_SprayTintValue_8"                   "Jungle Green"
  "Attrib_SprayTintValue_9"                   "Frog Green"
  "Attrib_SprayTintValue_10"                  "Cash Green"
  "Attrib_SprayTintValue_11"                  "Wire Blue"
  "Attrib_SprayTintValue_12"                  "Monarch Blue"
  "Attrib_SprayTintValue_13"                  "SWAT Blue"
  "Attrib_SprayTintValue_14"                  "Violent Violet"
  "Attrib_SprayTintValue_15"                  "Monster Purple"
  "Attrib_SprayTintValue_16"                  "Bazooka Pink"
  "Attrib_SprayTintValue_17"                  "Princess Pink"
  "Attrib_SprayTintValue_18"                  "War Pig Pink"
  "Attrib_SprayTintValue_19"                  "Shark White"

itemsGame.graffiti_tints

  "graffiti_tints": {
        "brick_red": {
            "id": 1,
            "hex_color": "#874444"
        },
        "blood_red": {
            "id": 2,
            "hex_color": "#b14d4d"
        },
        "tiger_orange": {
            "id": 3,
            "hex_color": "#b87148"
        },
        "dust_brown": {
            "id": 4,
            "hex_color": "#8f7d5d"
        },
        "desert_amber": {
            "id": 5,
            "hex_color": "#ae833d"
        },
        "tracer_yellow": {
            "id": 6,
            "hex_color": "#d4c95b"
        },
        "battle_green": {
            "id": 7,
            "hex_color": "#789d53"
        },
        "jungle_green": {
            "id": 8,
            "hex_color": "#417a4a"
        },
        "frog_green": {
            "id": 9,
            "hex_color": "#488f80"
        },
        "cash_green": {
            "id": 10,
            "hex_color": "#a6c4a5"
        },
        "wire_blue": {
            "id": 11,
            "hex_color": "#6ba5b2"
        },
        "monarch_blue": {
            "id": 12,
            "hex_color": "#4e7fa9"
        },
        "swat_blue": {
            "id": 13,
            "hex_color": "#4c5b98"
        },
        "violent_violet": {
            "id": 14,
            "hex_color": "#af92df"
        },
        "monster_purple": {
            "id": 15,
            "hex_color": "#6e4f9f"
        },
        "bazooka_pink": {
            "id": 16,
            "hex_color": "#ba68b2"
        },
        "princess_pink": {
            "id": 17,
            "hex_color": "#9d567a"
        },
        "war_pig_pink": {
            "id": 18,
            "hex_color": "#e4ccd5"
        },
        "shark_white": {
            "id": 19,
            "hex_color": "#c1c1c1"
        }
    },
ByMykel commented 6 months ago

@piyanggoon but I still have to hardcode the different colors that one spray can have, right?

For example:

piyanggoon commented 6 months ago

What about image on CS2 per spray? we can use it for ref variants?

ByMykel commented 6 months ago

What about image on CS2 per spray? we can use it for ref variants?

I don't think so as I don't know exactly what images we have I just generate the url without knowing if it will work.

But other problem is that I don't think I have all the variant's color images. I have only the default.

piyanggoon commented 6 months ago

I still think base grade have 19 variants but on wiki maybe ref on they market or steam market.

piyanggoon commented 6 months ago

example: https://wiki.cs.money/graffiti/sealed-graffiti-recoil-sg-553-wire-blue

on cs.money wiki. CleanShot 2567-02-22 at 00 34 40@2x

on steam market. CleanShot 2567-02-22 at 00 35 23@2x

total on steam market CleanShot 2567-02-22 at 00 42 57@2x

on cs.money missing Tracer Yellow, ...

ByMykel commented 6 months ago

@piyanggoon Even though I don't mind to hardcode a couple of data, I still don't have the images of all colors.

piyanggoon commented 6 months ago

@ByMykel I think there should be a tool for fetching images and checking available items on the Steam Market to solve problems like this on futures.

ByMykel commented 5 months ago

I've made a small test adding Sealed Graffiti | 1G and Sealed Graffiti | 200 IQ.

https://bymykel.github.io/counter-strike-items/#/graffiti?q=1G https://bymykel.github.io/counter-strike-items/#/graffiti?q=200+IQ

I will upload the different images to the repo by hand.

Will try to have it done during the week.