Introduced "default" parameter for default skins
This commit is contained in:
15
skins.py
15
skins.py
@@ -40,15 +40,19 @@ for raw in content:
|
||||
"display": raw["pattern"]["name"],
|
||||
"min_float": raw["min_float"],
|
||||
"max_float": raw["max_float"],
|
||||
"legacy": raw["legacy_model"]
|
||||
"legacy": raw["legacy_model"],
|
||||
"default": False
|
||||
}
|
||||
skins.append(skin)
|
||||
|
||||
default_weapons = ["weapon_knife_t", "weapon_knife", "t_gloves", "ct_gloves"]
|
||||
|
||||
for weapon in weapons.values():
|
||||
if weapon[4] == "Gloves" and not "Default" in weapon[2]:
|
||||
print("skip")
|
||||
continue
|
||||
|
||||
default = weapon[1] in default_weapons or ("weapon" in weapon[1] and not "knife" in weapon[1])
|
||||
|
||||
skin = {
|
||||
"weapon": weapon[0],
|
||||
"rarity": rarity["Stock"],
|
||||
@@ -56,12 +60,13 @@ for weapon in weapons.values():
|
||||
"display": "",
|
||||
"min_float": 0,
|
||||
"max_float": 0,
|
||||
"legacy": True
|
||||
"legacy": True,
|
||||
"default": default
|
||||
}
|
||||
skins.append(skin)
|
||||
|
||||
#for skin in skins:
|
||||
# cur.execute("INSERT INTO skins (weapon, rarity, paint_index, display, min_float, max_float, legacy) VALUES (%s, %s, %s, %s, %s, %s, %s)", (skin["weapon"], skin["rarity"], skin["paint_index"], skin["display"], skin["min_float"], skin["max_float"], skin["legacy"]))
|
||||
for skin in skins:
|
||||
cur.execute("INSERT INTO skins (weapon, rarity, paint_index, display, min_float, max_float, legacy, \"default\") VALUES (%s, %s, %s, %s, %s, %s, %s, %s)", (skin["weapon"], skin["rarity"], skin["paint_index"], skin["display"], skin["min_float"], skin["max_float"], skin["legacy"], skin["default"]))
|
||||
|
||||
conn.commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user