From: Mario Date: Tue, 18 Aug 2015 23:18:14 +0000 (+1000) Subject: Merge branch 'master' into Mario/ons_updates X-Git-Tag: xonotic-v0.8.2~2050^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=34095b88e7a8d82f83aca8ce1009f9622026d159;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into Mario/ons_updates # Conflicts: # qcsrc/client/waypointsprites.qc # qcsrc/common/constants.qh # qcsrc/common/stats.qh --- 34095b88e7a8d82f83aca8ce1009f9622026d159 diff --cc qcsrc/client/hud.qc index 06cf45334,8ea4155ae..414641228 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@@ -1980,169 -2016,9 +2019,170 @@@ void HUD_Timer(void // Radar (#6) // + +float HUD_Radar_Clickable() +{ + return hud_panel_radar_mouse && !hud_panel_radar_temp_hidden; +} + - void HUD_Radar_Show_Maximized(float show,float clickable) ++void HUD_Radar_Show_Maximized(bool doshow,float clickable) +{ - hud_panel_radar_maximized = show; ++ hud_panel_radar_maximized = doshow; + hud_panel_radar_temp_hidden = 0; + - if ( show ) ++ if ( doshow ) + { + if (clickable) + { + if(autocvar_hud_cursormode) + setcursormode(1); + hud_panel_radar_mouse = 1; + } + } + else if ( hud_panel_radar_mouse ) + { + hud_panel_radar_mouse = 0; + mouseClicked = 0; + if(autocvar_hud_cursormode) + if(!mv_active) + setcursormode(0); + } +} +void HUD_Radar_Hide_Maximized() +{ + HUD_Radar_Show_Maximized(false,false); +} + + +float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary) +{ + if(!hud_panel_radar_maximized || !hud_panel_radar_mouse || + autocvar__hud_configure || mv_active) + return false; + + if(bInputType == 3) + { + mousepos_x = nPrimary; + mousepos_y = nSecondary; + return true; + } + + if(nPrimary == K_MOUSE1) + { + if(bInputType == 0) // key pressed + mouseClicked |= S_MOUSE1; + else if(bInputType == 1) // key released + mouseClicked -= (mouseClicked & S_MOUSE1); + } + else if(nPrimary == K_MOUSE2) + { + if(bInputType == 0) // key pressed + mouseClicked |= S_MOUSE2; + else if(bInputType == 1) // key released + mouseClicked -= (mouseClicked & S_MOUSE2); + } + else if ( nPrimary == K_ESCAPE && bInputType == 0 ) + { + HUD_Radar_Hide_Maximized(); + } + else + { + // allow console/use binds to work without hiding the map + string con_keys; + float keys; + float i; + con_keys = strcat(findkeysforcommand("toggleconsole", 0)," ",findkeysforcommand("+use", 0)) ; + keys = tokenize(con_keys); // findkeysforcommand returns data for this + for (i = 0; i < keys; ++i) + { + if(nPrimary == stof(argv(i))) + return false; + } + + if ( getstati(STAT_HEALTH) <= 0 ) + { + // Show scoreboard + if ( bInputType < 2 ) + { + con_keys = findkeysforcommand("+showscores", 0); + keys = tokenize(con_keys); + for (i = 0; i < keys; ++i) + { + if ( nPrimary == stof(argv(i)) ) + { + hud_panel_radar_temp_hidden = bInputType == 0; + return false; + } + } + } + } + else if ( bInputType == 0 ) + HUD_Radar_Hide_Maximized(); + + return false; + } + + return true; +} + +void HUD_Radar_Mouse() +{ + if ( !hud_panel_radar_mouse ) return; + if(mv_active) return; + + if ( intermission ) + { + HUD_Radar_Hide_Maximized(); + return; + } + + if(mouseClicked & S_MOUSE2) + { + HUD_Radar_Hide_Maximized(); + return; + } + + if(!autocvar_hud_cursormode) + { + mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed; + + mousepos_x = bound(0, mousepos_x, vid_conwidth); + mousepos_y = bound(0, mousepos_y, vid_conheight); + } + + HUD_Panel_UpdateCvars(); + + + panel_size = autocvar_hud_panel_radar_maximized_size; + panel_size_x = bound(0.2, panel_size_x, 1) * vid_conwidth; + panel_size_y = bound(0.2, panel_size_y, 1) * vid_conheight; + panel_pos_x = (vid_conwidth - panel_size_x) / 2; + panel_pos_y = (vid_conheight - panel_size_y) / 2; + + if(mouseClicked & S_MOUSE1) + { + // click outside + if ( mousepos_x < panel_pos_x || mousepos_x > panel_pos_x + panel_size_x || + mousepos_y < panel_pos_y || mousepos_y > panel_pos_y + panel_size_y ) + { + HUD_Radar_Hide_Maximized(); + return; + } + vector pos = teamradar_texcoord_to_3dcoord(teamradar_2dcoord_to_texcoord(mousepos),view_origin_z); + localcmd(sprintf("cmd ons_spawn %f %f %f",pos_x,pos_y,pos_z)); + + HUD_Radar_Hide_Maximized(); + return; + } + + + const vector cursor_size = '32 32 0'; + drawpic(mousepos-'8 4 0', strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), cursor_size, '1 1 1', 0.8, DRAWFLAG_NORMAL); +} + void HUD_Radar(void) { + if(intermission == 2) return; if (!autocvar__hud_configure) { if (hud_panel_radar_maximized) diff --cc qcsrc/client/waypointsprites.qc index 671f05937,4a1ba2a1f..f0c2d5215 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@@ -166,10 -166,19 +166,16 @@@ vector drawspritetext(vector o, float a float spritelookupblinkvalue(string s) { + if(substring(s, 0, 4) == "wpn-") + if(get_weaponinfo(stof(substring(s, 4, strlen(s)))).spawnflags & WEP_FLAG_SUPERWEAPON) + return 2; + switch(s) { - case "ons-cp-atck-neut": return 2; - case "ons-cp-atck-red": return 2; - case "ons-cp-atck-blue": return 2; - case "ons-cp-dfnd-red": return 0.5; - case "ons-cp-dfnd-blue": return 0.5; + case "ons-cp-atck": return 2; + case "ons-cp-dfnd": return 0.5; + case "item_health_mega": return 2; + case "item_armor_large": return 2; case "item-invis": return 2; case "item-extralife": return 2; case "item-speed": return 2; @@@ -217,12 -234,21 +231,15 @@@ string spritelookuptext(string s case "keycarrier-red": return _("Key carrier"); case "keycarrier-yellow": return _("Key carrier"); case "redbase": return _("Red base"); + case "yellowbase": return _("Yellow base"); + case "neutralbase": return _("White base"); + case "pinkbase": return _("Pink base"); case "waypoint": return _("Waypoint"); - case "ons-gen-red": return _("Generator"); - case "ons-gen-blue": return _("Generator"); + case "ons-gen": return _("Generator"); case "ons-gen-shielded": return _("Generator"); - case "ons-cp-neut": return _("Control point"); - case "ons-cp-red": return _("Control point"); - case "ons-cp-blue": return _("Control point"); - case "ons-cp-atck-neut": return _("Control point"); - case "ons-cp-atck-red": return _("Control point"); - case "ons-cp-atck-blue": return _("Control point"); - case "ons-cp-dfnd-red": return _("Control point"); - case "ons-cp-dfnd-blue": return _("Control point"); + case "ons-cp": return _("Control point"); + case "ons-cp-atck": return _("Control point"); + case "ons-cp-dfnd": return _("Control point"); case "race-checkpoint": return _("Checkpoint"); case "race-finish": return _("Finish"); case "race-start": return _("Start"); diff --cc qcsrc/common/constants.qh index 4fb15af86,61c08bf86..2d32ebf3f --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@@ -115,8 -115,8 +115,10 @@@ const int ENT_CLIENT_TRIGGER_IMPULSE = const int ENT_CLIENT_SWAMP = 69; const int ENT_CLIENT_CORNER = 70; const int ENT_CLIENT_KEYLOCK = 71; +const int ENT_CLIENT_GENERATOR = 72; +const int ENT_CLIENT_CONTROLPOINT_ICON = 73; + const int ENT_CLIENT_VIEWLOC = 78; + const int ENT_CLIENT_VIEWLOC_TRIGGER = 79; const int ENT_CLIENT_HEALING_ORB = 80; diff --cc qcsrc/common/stats.qh index f461d8b62,eb6b0ea97..e6c44368c --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@@ -109,18 -109,17 +109,17 @@@ const int STAT_OK_AMMO_CHARGE const int STAT_OK_AMMO_CHARGEPOOL = 86; const int STAT_FROZEN = 87; const int STAT_REVIVE_PROGRESS = 88; - const int STAT_ROUNDLOST = 89; - // 90 empty? - // 91 empty? - // 92 empty? - // 93 empty? - // 94 empty? - // 95 empty? - // 96 empty? - // 97 empty? - // 98 empty? - // 99 empty? - + const int STAT_ARMOR_LARGE_TIME = 89; + const int STAT_HEALTH_MEGA_TIME = 90; + const int STAT_INVISIBLE_TIME = 91; + const int STAT_SPEED_TIME = 92; + const int STAT_EXTRALIFE_TIME = 93; + const int STAT_STRENGTH_TIME = 94; + const int STAT_SHIELD_TIME = 95; + const int STAT_FUELREGEN_TIME = 96; + const int STAT_JETPACK_TIME = 97; + const int STAT_SUPERWEAPONS_TIME = 98; -// 99 empty? ++const int STAT_ROUNDLOST = 99; /* The following stats change depending on the gamemode, so can share the same ID */ // IDs 100 to 104 reserved for gamemodes