From: Mario Date: Sun, 9 Aug 2020 12:49:56 +0000 (+1000) Subject: Merge branch 'master' into Lyberta/WaypointIcons X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ca2b4af3846cb6e38d166006cc3b32c89cf99142;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into Lyberta/WaypointIcons --- ca2b4af3846cb6e38d166006cc3b32c89cf99142 diff --cc qcsrc/common/items/item/armor.qh index 3591a66e8,e5ae8e36b..b5a784986 --- a/qcsrc/common/items/item/armor.qh +++ b/qcsrc/common/items/item/armor.qh @@@ -39,11 -39,10 +39,11 @@@ REGISTER_ITEM(ArmorSmall, Armor) this.m_sound = SND_ArmorSmall; #endif this.netname = "armor_small"; - this.m_name = "5 Armor"; + this.m_name = _("Small armor"); this.m_icon = "armor"; + this.m_waypoint_icon = "waypoint_armor"; #ifdef SVQC - this.m_itemid = IT_ARMOR_SHARD; + this.m_itemid = IT_RESOURCE; this.m_respawntime = GET(g_pickup_respawntime_short); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short); this.m_pickupanyway = GET(g_pickup_armorsmall_anyway); @@@ -78,11 -77,10 +78,11 @@@ REGISTER_ITEM(ArmorMedium, Armor) this.m_sound = SND_ArmorMedium; #endif this.netname = "armor_medium"; - this.m_name = "25 Armor"; + this.m_name = _("Medium armor"); this.m_icon = "armor"; + this.m_waypoint_icon = "waypoint_armor"; #ifdef SVQC - this.m_itemid = IT_ARMOR; + this.m_itemid = IT_RESOURCE; this.m_respawntime = GET(g_pickup_respawntime_medium); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_medium); this.m_pickupanyway = GET(g_pickup_armormedium_anyway); @@@ -117,13 -115,12 +117,13 @@@ REGISTER_ITEM(ArmorBig, Armor) this.m_sound = SND_ArmorBig; #endif this.netname = "armor_big"; - this.m_name = "50 Armor"; + this.m_name = _("Big armor"); this.m_icon = "armor"; this.m_color = '0 1 0'; - this.m_waypoint = _("Big armor"); + this.m_waypoint_text = _("Big armor"); + this.m_waypoint_icon = "waypoint_armor"; #ifdef SVQC - this.m_itemid = IT_ARMOR; + this.m_itemid = IT_RESOURCE; this.m_respawntime = GET(g_pickup_respawntime_long); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long); this.m_pickupanyway = GET(g_pickup_armorbig_anyway); @@@ -158,11 -155,10 +158,11 @@@ REGISTER_ITEM(ArmorMega, Armor) this.m_sound = SND_ArmorMega; #endif this.netname = "armor_mega"; - this.m_name = "100 Armor"; + this.m_name = _("Mega armor"); this.m_icon = "item_large_armor"; this.m_color = '0 1 0'; - this.m_waypoint = _("Mega armor"); + this.m_waypoint_text = _("Mega armor"); + this.m_waypoint_icon = "waypoint_armor_mega"; this.m_waypointblink = 2; #ifdef SVQC this.m_maxs = '16 16 70'; diff --cc qcsrc/common/items/item/health.qh index 8ceef1ea9,27f5dafc6..bc87eb7c4 --- a/qcsrc/common/items/item/health.qh +++ b/qcsrc/common/items/item/health.qh @@@ -39,11 -39,10 +39,11 @@@ REGISTER_ITEM(HealthSmall, Health) this.m_sound = SND_HealthSmall; #endif this.netname = "health_small"; - this.m_name = "5 Health"; + this.m_name = _("Small health"); this.m_icon = "health"; + this.m_waypoint_icon = "waypoint_health"; #ifdef SVQC - this.m_itemid = IT_5HP; + this.m_itemid = IT_RESOURCE; this.m_respawntime = GET(g_pickup_respawntime_short); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short); this.m_pickupanyway = GET(g_pickup_healthsmall_anyway); @@@ -78,11 -77,10 +78,11 @@@ REGISTER_ITEM(HealthMedium, Health) this.m_sound = SND_HealthMedium; #endif this.netname = "health_medium"; - this.m_name = "25 Health"; + this.m_name = _("Medium health"); this.m_icon = "health"; + this.m_waypoint_icon = "waypoint_health"; #ifdef SVQC - this.m_itemid = IT_25HP; + this.m_itemid = IT_RESOURCE; this.m_respawntime = GET(g_pickup_respawntime_short); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short); this.m_pickupanyway = GET(g_pickup_healthmedium_anyway); @@@ -117,13 -115,12 +117,13 @@@ REGISTER_ITEM(HealthBig, Health) this.m_sound = SND_HealthBig; #endif this.netname = "health_big"; - this.m_name = "50 Health"; + this.m_name = _("Big health"); this.m_icon = "health"; this.m_color = '1 0 0'; - this.m_waypoint = _("Big health"); + this.m_waypoint_text = _("Big health"); + this.m_waypoint_icon = "waypoint_health"; #ifdef SVQC - this.m_itemid = IT_25HP; + this.m_itemid = IT_RESOURCE; this.m_respawntime = GET(g_pickup_respawntime_medium); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_medium); this.m_pickupanyway = GET(g_pickup_healthbig_anyway); @@@ -158,11 -155,10 +158,11 @@@ REGISTER_ITEM(HealthMega, Health) this.m_sound = SND_HealthMega; #endif this.netname = "health_mega"; - this.m_name = "100 Health"; + this.m_name = _("Mega health"); this.m_icon = "item_mega_health"; this.m_color = '1 0 0'; - this.m_waypoint = _("Mega health"); + this.m_waypoint_text = _("Mega health"); + this.m_waypoint_icon = "waypoint_health_mega"; this.m_waypointblink = 2; #ifdef SVQC this.m_maxs = '16 16 70'; diff --cc qcsrc/common/items/item/jetpack.qh index c9387830e,962f16170..c8c30cb1c --- a/qcsrc/common/items/item/jetpack.qh +++ b/qcsrc/common/items/item/jetpack.qh @@@ -35,11 -35,10 +35,11 @@@ REGISTER_ITEM(Jetpack, Powerup) this.m_itemid = IT_JETPACK; #endif this.netname = "jetpack"; - this.m_name = "Jetpack"; + this.m_name = _("Jetpack"); this.m_icon = "jetpack"; this.m_color = '0.5 0.5 0.5'; - this.m_waypoint = _("Jetpack"); + this.m_waypoint_text = _("Jetpack"); + this.m_waypoint_icon = "waypoint_jetpack"; this.m_waypointblink = 2; #ifdef SVQC this.m_botvalue = 3000; @@@ -94,11 -93,10 +94,11 @@@ REGISTER_ITEM(JetpackRegen, JetpackRege this.m_model = MDL_JetpackRegen_ITEM; #endif this.netname = "fuel_regen"; - this.m_name = "Fuel regenerator"; + this.m_name = _("Fuel regenerator"); this.m_icon = "fuelregen"; this.m_color = '1 0.5 0'; - this.m_waypoint = _("Fuel regen"); + this.m_waypoint_text = _("Fuel regen"); + this.m_waypoint_icon = "waypoint_fuel_regen"; this.m_waypointblink = 2; #ifdef SVQC this.m_botvalue = 3000; diff --cc qcsrc/common/items/item/powerup.qh index 9e47a3d52,bf4727a79..b698ea414 --- a/qcsrc/common/items/item/powerup.qh +++ b/qcsrc/common/items/item/powerup.qh @@@ -40,13 -40,14 +40,15 @@@ REGISTER_ITEM(Strength, Powerup) this.m_respawnsound = SND_STRENGTH_RESPAWN; #endif this.netname = "strength"; - this.m_name = "Strength Powerup"; + this.m_name = _("Strength"); this.m_icon = "strength"; this.m_color = '0 0 1'; - this.m_waypoint = _("Strength"); + this.m_waypoint_text = _("Strength"); + this.m_waypoint_icon = "waypoint_strength"; this.m_waypointblink = 2; + #ifdef GAMEQC this.m_itemid = IT_STRENGTH; + #endif #ifdef SVQC this.m_iteminit = powerup_strength_init; #endif @@@ -77,13 -78,14 +79,15 @@@ REGISTER_ITEM(Shield, Powerup) this.m_respawnsound = SND_SHIELD_RESPAWN; #endif this.netname = "invincible"; - this.m_name = "Shield"; + this.m_name = _("Shield"); this.m_icon = "shield"; this.m_color = '1 0 1'; - this.m_waypoint = _("Shield"); + this.m_waypoint_text = _("Shield"); + this.m_waypoint_icon = "waypoint_shield"; this.m_waypointblink = 2; + #ifdef GAMEQC this.m_itemid = IT_INVINCIBLE; + #endif #ifdef SVQC this.m_iteminit = powerup_shield_init; #endif diff --cc qcsrc/common/mutators/mutator/instagib/items.qh index 13c61e6fc,4724eda17..6adda9e19 --- a/qcsrc/common/mutators/mutator/instagib/items.qh +++ b/qcsrc/common/mutators/mutator/instagib/items.qh @@@ -56,13 -56,14 +56,15 @@@ REGISTER_ITEM(ExtraLife, Powerup) this.m_sound = SND_ExtraLife; #endif this.netname = "extralife"; - this.m_name = "Extra life"; + this.m_name = _("Extra life"); this.m_icon = "item_mega_health"; this.m_color = '1 0 0'; - this.m_waypoint = _("Extra life"); + this.m_waypoint_text = _("Extra life"); + this.m_waypoint_icon = "waypoint_health_mega"; this.m_waypointblink = 2; - this.m_itemid = IT_NAILS; + #ifdef SVQC + this.m_itemid = IT_RESOURCE; + #endif } SPAWNFUNC_ITEM(item_extralife, ITEM_ExtraLife) @@@ -89,13 -90,14 +91,15 @@@ REGISTER_ITEM(Invisibility, Powerup) this.m_respawnsound = SND_STRENGTH_RESPAWN; #endif this.netname = "invisibility"; - this.m_name = "Invisibility"; + this.m_name = _("Invisibility"); this.m_icon = "strength"; this.m_color = '0 0 1'; - this.m_waypoint = _("Invisibility"); + this.m_waypoint_text = _("Invisibility"); + this.m_waypoint_icon = "waypoint_invisibility"; this.m_waypointblink = 2; + #ifdef GAMEQC this.m_itemid = IT_STRENGTH; + #endif #ifdef SVQC this.m_iteminit = powerup_invisibility_init; #endif @@@ -125,13 -127,14 +129,15 @@@ REGISTER_ITEM(Speed, Powerup) this.m_respawnsound = SND_SHIELD_RESPAWN; #endif this.netname = "speed"; - this.m_name = "Speed"; + this.m_name = _("Speed"); this.m_icon = "shield"; this.m_color = '1 0 1'; - this.m_waypoint = _("Speed"); + this.m_waypoint_text = _("Speed"); + this.m_waypoint_icon = "waypoint_speed"; this.m_waypointblink = 2; + #ifdef GAMEQC this.m_itemid = IT_INVINCIBLE; + #endif #ifdef SVQC this.m_iteminit = powerup_speed_init; #endif diff --cc qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index fd46a712f,bb6a68863..ae4db057a --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@@ -242,8 -238,8 +238,8 @@@ string spritelookuptext(entity this, st if(autocvar_g_waypointsprite_spam && waypointsprite_count >= autocvar_g_waypointsprite_spam) return "Spam"; // no need to translate this debug string if (s == WP_RaceStartFinish.netname) return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start"); - if (s == WP_Weapon.netname) return Weapons_from(this.wp_extra).m_name; - if (s == WP_Item.netname) return Items_from(this.wp_extra).m_waypoint_text; + if (s == WP_Weapon.netname) return REGISTRY_GET(Weapons, this.wp_extra).m_name; - if (s == WP_Item.netname) return REGISTRY_GET(Items, this.wp_extra).m_waypoint; ++ if (s == WP_Item.netname) return REGISTRY_GET(Items, this.wp_extra).m_waypoint_text; if (s == WP_Monster.netname) return get_monsterinfo(this.wp_extra).monster_name; if (MUTATOR_CALLHOOK(WP_Format, this, s)) { @@@ -261,10 -257,9 +257,10 @@@ string spritelookupicon(entity this, string s) { // TODO: needs icons! //if (s == WP_RaceStartFinish.netname) return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start"); - //if (s == WP_Weapon.netname) return Weapons_from(this.wp_extra).model2; - if (s == WP_Weapon.netname) return Weapons_from(this.wp_extra).m_waypoint_icon; - if (s == WP_Item.netname) return Items_from(this.wp_extra).m_waypoint_icon; - if (s == WP_Vehicle.netname) return Vehicles_from(this.wp_extra).m_icon; - if (s == WP_Weapon.netname) return REGISTRY_GET(Weapons, this.wp_extra).model2; - if (s == WP_Item.netname) return REGISTRY_GET(Items, this.wp_extra).m_icon; ++ //if (s == WP_Weapon.netname) return REGISTRY_GET(Weapons, this.wp_extra).model2; ++ if (s == WP_Weapon.netname) return REGISTRY_GET(Weapons, this.wp_extra).m_waypoint_icon; ++ if (s == WP_Item.netname) return REGISTRY_GET(Items, this.wp_extra).m_waypoint_icon; + if (s == WP_Vehicle.netname) return REGISTRY_GET(Vehicles, this.wp_extra).m_icon; //if (s == WP_Monster.netname) return get_monsterinfo(this.wp_extra).m_icon; if (MUTATOR_CALLHOOK(WP_Format, this, s)) { @@@ -427,17 -422,10 +423,17 @@@ vector drawsprite_TextOrIcon(bool is_te o.x += 0.5 * (w - sw); - if (is_text) - drawstring(o, str, sz, rgb, a, DRAWFLAG_NORMAL); - else - drawpic(o, str, sz, rgb, a, DRAWFLAG_NORMAL); + if (is_text) + { + drawstring(o, str, sz, rgb, a, DRAWFLAG_NORMAL); + } + else + { + drawpic(o, str, sz, rgb, a, DRAWFLAG_NORMAL); - // https://docs.gimp.org/en/gimp-tool-desaturate.html ++ // https://docs.gimp.org/2.8/en/gimp-tool-desaturate.html + //float gray = rgb.x * 0.21 + rgb.y * 0.72 + rgb.z * 0.07; + //drawpic(o, str, sz, '1 1 1', gray * a, DRAWFLAG_ADDITIVE); + } o.x += 0.5 * sw; o.y += 0.5 * h;