diff --git a/platform/test_maps.pk3dir/maps/test_lightstyles.bsp b/platform/test_maps.pk3dir/maps/test_lightstyles.bsp index ef73d4d2..2e180c0b 100644 Binary files a/platform/test_maps.pk3dir/maps/test_lightstyles.bsp and b/platform/test_maps.pk3dir/maps/test_lightstyles.bsp differ diff --git a/platform/test_maps.pk3dir/maps/test_lightstyles.map b/platform/test_maps.pk3dir/maps/test_lightstyles.map index e5dbdd79..e9e4e229 100644 --- a/platform/test_maps.pk3dir/maps/test_lightstyles.map +++ b/platform/test_maps.pk3dir/maps/test_lightstyles.map @@ -4,57 +4,57 @@ "classname" "worldspawn" // brush 0 { -( 248 192 -64 ) ( 248 -192 -64 ) ( -264 192 -64 ) next/cracked1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 256 192 8 ) ( -256 192 8 ) ( 256 192 0 ) next/cracked1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 256 192 8 ) ( 256 192 0 ) ( 256 -192 8 ) next/cracked1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 -128 ) ( 256 -192 -128 ) ( -256 192 -128 ) next/cracked1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 0 ) ( -256 -192 8 ) ( 256 -192 0 ) next/cracked1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 0 ) ( -256 192 0 ) ( -256 -192 8 ) next/cracked1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 248 192 -64 ) ( 248 -192 -64 ) ( -264 192 -64 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 256 192 8 ) ( -256 192 8 ) ( 256 192 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 256 192 8 ) ( 256 192 0 ) ( 256 -192 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 -128 ) ( 256 -192 -128 ) ( -256 192 -128 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 0 ) ( -256 -192 8 ) ( 256 -192 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 0 ) ( -256 192 0 ) ( -256 -192 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 } // brush 1 { -( 248 192 192 ) ( 248 -192 192 ) ( -264 192 192 ) next/bunker1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 256 192 264 ) ( -256 192 264 ) ( 256 192 256 ) next/bunker1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 256 192 264 ) ( 256 192 256 ) ( 256 -192 264 ) next/bunker1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 128 ) ( 256 -192 128 ) ( -256 192 128 ) next/bunker1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 256 ) ( -256 -192 264 ) ( 256 -192 256 ) next/bunker1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 256 ) ( -256 192 256 ) ( -256 -192 264 ) next/bunker1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 248 192 192 ) ( 248 -192 192 ) ( -264 192 192 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 256 192 264 ) ( -256 192 264 ) ( 256 192 256 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 256 192 264 ) ( 256 192 256 ) ( 256 -192 264 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 128 ) ( 256 -192 128 ) ( -256 192 128 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 256 ) ( -256 -192 264 ) ( 256 -192 256 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 256 ) ( -256 192 256 ) ( -256 -192 264 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 } // brush 2 { -( 184 192 192 ) ( 184 -192 192 ) ( -328 192 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 192 192 264 ) ( -320 192 264 ) ( 192 192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 192 8 ) ( -256 192 0 ) ( -256 -192 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -768 -192 -128 ) ( -256 -192 -128 ) ( -768 192 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -320 -192 256 ) ( -320 -192 264 ) ( 192 -192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -320 -192 256 ) ( -320 192 256 ) ( -320 -192 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 184 192 192 ) ( 184 -192 192 ) ( -328 192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 192 192 264 ) ( -320 192 264 ) ( 192 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -256 192 8 ) ( -256 192 0 ) ( -256 -192 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -768 -192 -128 ) ( -256 -192 -128 ) ( -768 192 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -320 -192 256 ) ( -320 -192 264 ) ( 192 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -320 -192 256 ) ( -320 192 256 ) ( -320 -192 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 } // brush 3 { -( 760 192 192 ) ( 760 -192 192 ) ( 248 192 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 768 192 264 ) ( 256 192 264 ) ( 768 192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 320 192 8 ) ( 320 192 0 ) ( 320 -192 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -192 -192 -128 ) ( 320 -192 -128 ) ( -192 192 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 256 -192 256 ) ( 256 -192 264 ) ( 768 -192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 256 -192 256 ) ( 256 192 256 ) ( 256 -192 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 760 192 192 ) ( 760 -192 192 ) ( 248 192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 768 192 264 ) ( 256 192 264 ) ( 768 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 320 192 8 ) ( 320 192 0 ) ( 320 -192 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -192 -192 -128 ) ( 320 -192 -128 ) ( -192 192 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 256 -192 256 ) ( 256 -192 264 ) ( 768 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 256 -192 256 ) ( 256 192 256 ) ( 256 -192 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 } // brush 4 { -( 184 -192 192 ) ( 184 -576 192 ) ( -328 -192 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 192 -192 264 ) ( -320 -192 264 ) ( 192 -192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 320 96 8 ) ( 320 96 0 ) ( 320 -288 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -768 -576 -128 ) ( -256 -576 -128 ) ( -768 -192 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 272 -256 256 ) ( 272 -256 264 ) ( 784 -256 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -320 -576 256 ) ( -320 -192 256 ) ( -320 -576 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 184 -192 192 ) ( 184 -576 192 ) ( -328 -192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 192 -192 264 ) ( -320 -192 264 ) ( 192 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 320 96 8 ) ( 320 96 0 ) ( 320 -288 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -768 -576 -128 ) ( -256 -576 -128 ) ( -768 -192 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 272 -256 256 ) ( 272 -256 264 ) ( 784 -256 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -320 -576 256 ) ( -320 -192 256 ) ( -320 -576 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 } // brush 5 { -( 184 256 192 ) ( 184 -128 192 ) ( -328 256 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 192 256 264 ) ( -320 256 264 ) ( 192 256 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 320 544 8 ) ( 320 544 0 ) ( 320 160 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -768 -128 -128 ) ( -256 -128 -128 ) ( -768 256 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 272 192 256 ) ( 272 192 264 ) ( 784 192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -320 -128 256 ) ( -320 256 256 ) ( -320 -128 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 184 256 192 ) ( 184 -128 192 ) ( -328 256 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 192 256 264 ) ( -320 256 264 ) ( 192 256 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 320 544 8 ) ( 320 544 0 ) ( 320 160 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -768 -128 -128 ) ( -256 -128 -128 ) ( -768 256 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 272 192 256 ) ( 272 192 264 ) ( 784 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -320 -128 256 ) ( -320 256 256 ) ( -320 -128 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 } } // entity 1 @@ -68,8 +68,82 @@ // entity 3 { "classname" "light" -"origin" "192.000000 0.000000 64.000000" -"light" "100" +"origin" "192.000000 128.000000 64.000000" +"light" "50" "pattern" "abmcfgyzmnhpazcf" -"targetname" "foobar" +"targetname" "foobar1" +"style" "12" +} +// entity 4 +{ +"classname" "light" +"origin" "192.000000 -128.000000 64.000000" +"light" "50" +"targetname" "foobar2" +"style" "2" +} +// entity 5 +{ +"classname" "func_button" +"target" "foobar2" +// brush 0 +{ +( 88 -40 0 ) ( 88 -80 0 ) ( 48 -40 0 ) next/rusty7 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 88 -48 72 ) ( 48 -48 72 ) ( 88 -48 64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 80 -40 72 ) ( 80 -40 64 ) ( 80 -80 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 48 -80 -64 ) ( 88 -80 -64 ) ( 48 -40 -64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 40 -80 64 ) ( 40 -80 72 ) ( 80 -80 64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 48 -80 64 ) ( 48 -40 64 ) ( 48 -80 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +} +// entity 6 +{ +"classname" "func_button" +"target" "foobar1" +// brush 0 +{ +( 88 152 0 ) ( 88 112 0 ) ( 48 152 0 ) next/rusty7 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 88 144 72 ) ( 48 144 72 ) ( 88 144 64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 80 152 72 ) ( 80 152 64 ) ( 80 112 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 48 112 -64 ) ( 88 112 -64 ) ( 48 152 -64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 40 112 64 ) ( 40 112 72 ) ( 80 112 64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 48 112 64 ) ( 48 152 64 ) ( 48 112 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +} +// entity 7 +{ +"classname" "light" +"origin" "-192.000000 128.000000 64.000000" +"light" "25" +} +// entity 8 +{ +"classname" "light" +"origin" "-192.000000 -64.000000 64.000000" +"light" "25" +"style" "9" +} +// entity 9 +{ +"classname" "point_message" +"origin" "120.000000 128.000000 32.000000" +"message" "Custom pattern, toggable." +} +// entity 10 +{ +"classname" "point_message" +"origin" "120.000000 -64.000000 32.000000" +"message" "Preset pattern, toggable." +} +// entity 11 +{ +"classname" "point_message" +"origin" "-160.000000 -64.000000 32.000000" +"message" "Preset pattern, static." +} +// entity 12 +{ +"classname" "point_message" +"origin" "-160.000000 128.000000 32.000000" +"message" "No pattern, static." } diff --git a/src/client/entry.c b/src/client/entry.c index 7faf4d83..cf1a5a8a 100644 --- a/src/client/entry.c +++ b/src/client/entry.c @@ -341,6 +341,7 @@ CSQC_UpdateView(float w, float h, float focus) Scores_Draw(); } else if (focus == TRUE) { GameText_Draw(); + PointMessage_Draw(); if (getplayerkeyvalue(player_localnum, "*spec") != "0") { HUD_DrawSpectator(); diff --git a/src/gs-entbase/client/point_message.cpp b/src/gs-entbase/client/point_message.cpp index 3c01970b..ec72ed02 100644 --- a/src/gs-entbase/client/point_message.cpp +++ b/src/gs-entbase/client/point_message.cpp @@ -88,7 +88,6 @@ void PointMessage_Draw(void) vecPlayer = pSeat->m_vecPredictedOrigin; #endif -#ifdef WASTES string msg; float distance; for (entity eFind = world; (eFind = find(eFind, ::classname, "point_message"));) { @@ -101,9 +100,9 @@ void PointMessage_Draw(void) } if (PointMessage_Visible(m.origin, vecPlayer, getproperty(VF_ANGLES)) == TRUE) { - vector vTemp = project(m.origin) - [(stringwidth(msg, FALSE,[8,8]) / 2), 0]; - Gfx_String(vTemp, msg, [8,8], autocvar_hud_color, 1.0f, FNT_GAME); + drawfont = FONT_CON; + vector vTemp = project(m.origin) - [(stringwidth(msg, FALSE,[12,12]) / 2), 0]; + drawstring(vTemp, msg, [12,12], [1,1,1], 1.0f, 0); } } -#endif } diff --git a/src/gs-entbase/server/func_button.cpp b/src/gs-entbase/server/func_button.cpp index fde270e2..d759743c 100644 --- a/src/gs-entbase/server/func_button.cpp +++ b/src/gs-entbase/server/func_button.cpp @@ -375,6 +375,8 @@ func_button::SpawnKey(string strKey, string strValue) void func_button::func_button(void) { + m_flWait = 4.0f; + CBaseTrigger::CBaseTrigger(); if (m_strSndPressed) diff --git a/src/gs-entbase/server/light.cpp b/src/gs-entbase/server/light.cpp index 0495ce19..48a4d027 100644 --- a/src/gs-entbase/server/light.cpp +++ b/src/gs-entbase/server/light.cpp @@ -57,6 +57,7 @@ class light:CBaseTrigger { int m_iEnabled; float m_flStyle; + float m_flSwitchStyle; string m_strPattern; void(void) light; @@ -103,6 +104,9 @@ light::SpawnKey(string strKey, string strValue) case "pattern": m_strPattern = strValue; break; + case "switch_style": + m_flSwitchStyle = stof(strValue); + break; case "style": m_flStyle = stof(strValue); style = __NULL__; @@ -116,6 +120,11 @@ void light::light(void) { m_strPattern = "m"; CBaseTrigger::CBaseTrigger(); + + /* switch styles before 12 are builtins from Quake. */ + if (m_flSwitchStyle <= 11) { + m_strPattern = getlightstyle(m_flSwitchStyle); + } } CLASSEXPORT(light_spot, light) diff --git a/src/server/entry.c b/src/server/entry.c index 75e67ef7..234ae288 100644 --- a/src/server/entry.c +++ b/src/server/entry.c @@ -261,7 +261,7 @@ void worldspawn(void) lightstyle(2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba"); lightstyle(3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg"); lightstyle(4, "mamamamamama"); - lightstyle(5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj"); + lightstyle(5, "jklmnopqrstuvwxyzyxwvutsrqponmlkj"); lightstyle(6, "nmonqnmomnmomomno"); lightstyle(7, "mmmaaaabcdefgmmmmaaaammmaamm"); lightstyle(8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa");