Skip to content

Commit

Permalink
Revision 09/01/2024
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinzuerio committed Jan 9, 2024
1 parent 261da8f commit 0a66278
Show file tree
Hide file tree
Showing 29 changed files with 335 additions and 219 deletions.
22 changes: 22 additions & 0 deletions CHANGES.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
## A new major updates to Prop Hunt: X has been released.
Note: Prop Hunt X will change it's version to "X2Z" following with date-formatted revisions.

## Revision 09.01.2024 (January 2024 Hotfix)
These patch are mainly fixes due to December 2023/January 2024 Garry's Mod update.
- HotFix: Fixed Lua Error when suicide occurs on all team due to December 2023/January 2024 patch. This affects to `GAMEMODE:AddDeathNotice` rule changes
- HotFix: Fixed Hunters when respawning too early during blind time will have them longer blindfold time. This is now cut shorter and will be soon released once blindfold time is over
- Fixed typos GetGlobalBool's `BlindStatus -> PHX.BlindStatus`
- Minor Improvements and Changed `MapVote` Global variable into `local MapVote = PHX.MV` table, so that you can use original fretta-like MapVote addon. To make it work you must use `ph_custom_mv_func "MapVote.Start()"` in order to work (or use any Map Votes addon you like)
- Changed ULX Category for Prop Menu & MapVote commands and removed `gamemodes/ulx/modules/sh` directory
- Renamed ConVar `lps_start_random` to `lps_start_random_round` with default value to `0` (Request)
- Changed default value `ph_custom_mv_func` from `MapVote.PHXStart()` to `PHX.StartMapVote()`
- Fixed Prop AutoTaunt HUD would overlap with Hunter's Weapon HUD upon respawn after switching team
- Minor Improvements for Hunter's Weapon Loadout
- Added new hook `PH_OnHunterLoadOut` (Arg: `player Ply`): Adds or Overrides Hunter's Weapon Loadout after blindfold is over. Using `return true` will remove default weapon loadout (crowbar, 357 and shotgun). **CAUTION: using `return true` in an addon _Will Also_ overrides other addons too that uses this hook!**
- Added Turkish Language (Submission by: Talha Berkay A. aka Matt, Nova Diablox, Fat Fox Talha)
- Added `/config/maps/ph_lttp_kakariko_b2.lua`: Remove invalid sprite entities to prevent console from spamming
- Removed `cl_targetid.lua` and merged into `cl_init.lua` instead
- Removed uneccessary global variables (e.g. `x` variable inside HUD hook, it should meant to `local x`)
- Deprecated: PHX's eChat will soon replaced/removed on future update. A warning message will appear if you use PHX's eChat feature.

#### Known Issues
- Linux 64-bit only (with CEF patch): Player's Prop Entity (`ph_prop`) `SetupDataTables` **will not** get called and causes prop to stay in place. This may caused internally by the game and still looking forward for workaround.
- December 2023/January 2024 update: Strange weapon tracer behaviour. This would affect to Last Prop Standing weapons with their custom Tracers. This is currently being discussed at [Garry's Mod issue tracker #5684](https://github.com/Facepunch/garrysmod-issues/issues/5684)

## Revision 30.01.2023
- HotFix: Fixed Error for calling `PHInLastPropStanding` hook where is `Player` argument returns `nil`. This is **REQUIRED** if you use "AK47 LPS Weapon" addon.
- HotFix: Fixed Error when trying to run `ph_force_end_round` on Dedicated Server console.
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ So-chiru: Korean Translation
Pawelxxdd: Polish Translation
"Clã | BR | The Fire Fuchs": Portuguese/Brazil Translation
Ryo567 & Kurayashi: Spannish Translation
Talha Berkay A. aka Matt, Nova Diablox, Fat Fox Talha: Turkish Translation
Dralga: Discord Helper

Others (Support and others)
Expand Down
19 changes: 11 additions & 8 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
**"Prop Hunt: X" Was Originally given and created by Wolvindra-Vinzuerio and Only Available Exclusively for Garry's Mod.**

### Versioning
Version: X2Z, Revision: 30/01/2023 (dd/mm/yyyy)
Version: X2Z, Revision: 09/01/2024 (dd/mm/yyyy)

### Public Servers
- Server #1 [U.S]: **74.91.120.8:27015** (Public Stable Server)
- Server #2 [U.S]: **maelstrom94.duckdns.org:27016** (Public Dev Server)
- Server #2 [U.S]: **offline** (Public Dev Server)
- Other Servers: https://gmodgameservers.com/prophuntx/servers

### Support the PH:X2Z Development
Please help me to support the project by donating or buying me a coffee:
Buy me a coffee If you like Prop Hunt: X2Z ☕

- https://www.buymeacoffee.com/wolvindra/ (or)
- https://ko-fi.com/wolvindra

Any bits of your donation really helps me alot!
Any bits of your donation really helps me a lot!

### Contributing
- Feel free if you want to add, tweaks or enhance something to the Gamemode;
Expand Down Expand Up @@ -57,11 +57,15 @@ Visit the "[Releases](https://github.com/Wolvin-NET/prophuntx/releases)" page to

### Quick Steam Guide:
- Installing Prop Hunt: X
_(Coming Soon)_
See Wiki
- How to add Custom Taunt with Taunt Scanner:
https://steamcommunity.com/sharedfiles/filedetails/?id=2847440960
- List of ConVars and ConCommands:
https://steamcommunity.com/sharedfiles/filedetails/?id=2851968180
- How to add Weapons:
See Wiki
- Configuring MapVotes:
See Wiki

### Wiki
Read the manuals here: https://gmodgameservers.com/wiki/prophuntx/
Expand All @@ -75,7 +79,7 @@ https://gmodgameservers.com/prophuntx/
https://github.com/yobson1/glua-soundduration (yobson1)
- Using a forked MapVote system
https://github.com/willox/gmod-mapvote (Willox)
- Using a forked eChat for _Temporary ChatBox Replacement_
- Using a forked eChat for _(Obsolete, will get replaced/removed)_
https://github.com/Exho1/eChat (Exho1)
- May require of use of an additional game contents for specific maps & server-customized gamemodes.

Expand All @@ -85,8 +89,7 @@ See [`CONTRIBUTORS.TXT`](/CONTRIBUTORS.TXT)
### License & Rules

**Rules**
- This gamemode **Will No Longer support Single Player** because it's becoming useless. The reason is that there were some function that are made available only for Multiplayer Games.
If you want to use this to test with your Prop Hunt Map, consider creating a multiplayer server and use `sv_lan 1` in there.
- This gamemode **Will No Longer support Single Player** because it's intended for Multiplayer gameplay. If you want to use this to test with your Prop Hunt Map, create a multiplayer instance and use `sv_lan 1` in there.
- **Please keep the `cl_credits.lua` and `Contributors` table as original as possible.** Except if you want to add yourself as contributors.
- Any changes or modification you have made publicly available on Steam Workshop must include the license below and a link back to: https://gmodgameservers.com/prophuntx/rules or Prop Hunt: X's Repository Git Page
in your 'credits' page (e.g. Workshop Description, About, etc...)
Expand Down
4 changes: 2 additions & 2 deletions addons/phx_integrity_checker/lua/autorun/sh_phx_integrity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ if engine.ActiveGamemode() ~= "prop_hunt" then return end

local EnableChecker = false

local CheckCVar = CreateConVar( "phx_enable_checker", "1", FCVAR_REPLICATED + FCVAR_ARCHIVE + FCVAR_NOTIFY, "Enable PH:X Integrity Checker.", 0, 1 )
cvars.AddChangeCallback("phx_enable_checker", function(cvar,old,new)
local CheckCVar = CreateConVar( "phx_integrity_check", "1", FCVAR_REPLICATED + FCVAR_ARCHIVE + FCVAR_NOTIFY, "Enable PH:X Integrity Checker.", 0, 1 )
cvars.AddChangeCallback("phx_integrity_check", function(cvar,old,new)
if (new) && new ~= nil then
EnableChecker = tobool(new)
end
Expand Down
2 changes: 1 addition & 1 deletion cfg/ConVars Serverside.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ lps_start_delayed_rounds 0
lps_start_every_x_rounds 2

// Should LPS will begin Randomly? This will overrides 'lps_start_every_x_rounds' ConVar.
lps_start_random 1
lps_start_random_round 1

// Trail Color (use hex code)
lps_trail_color #FFFFFF
Expand Down
3 changes: 3 additions & 0 deletions gamemodes/fretta/gamemode/cl_deathnotice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ net.Receive( "NPCKilledNPC", RecvNPCKilledNPC )
--function GM:AddDeathNotice( victim, inflictor, attacker )
function GM:AddDeathNotice( Attacker, team1, Inflictor, Victim , team2 )

-- for some odd reason, Attacker == nil if inflictor == "suicide" in the base gamemode. wtf and WHEN DID THEY UPDATED THIS???
if Inflictor == "suicide" then Attacker = Victim; team1 = team2 end

if ( !IsValid( g_DeathNotify ) ) then return end

local pnl = vgui.Create( "GameNotice", g_DeathNotify )
Expand Down
4 changes: 2 additions & 2 deletions gamemodes/prop_hunt/gamemode/cl_autotaunt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ local function AutoTauntPaint()
if !isEnabled || !isProp || !started then return; end

if tweenTime < 1 then
x = outElastic(tweenTime, xStart, xEnd - xStart, 1, 1, 0.5)
local x = outElastic(tweenTime, xStart, xEnd - xStart, 1, 1, 0.5)
local cTime = CurTime()
tweenTime = tweenTime + (cTime - previousTime)
previousTime = cTime
Expand Down Expand Up @@ -117,7 +117,7 @@ local delayC = PHX:GetCVar( "ph_customtaunts_delay" )
local colText = color_white -- decoy
local function AutoTauntPaint_phx()

if IsValid(LocalPlayer()) && LocalPlayer():Alive() && isProp && started then
if IsValid(LocalPlayer()) && LocalPlayer():Alive() && LocalPlayer():Team()==TEAM_PROPS && started then
local timeLeft = math.ceil(TimeLeft())
local percentage = timeLeft / delay
local taunttext = ""
Expand Down
2 changes: 1 addition & 1 deletion gamemodes/prop_hunt/gamemode/cl_hud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ tbl.hp = {
{ x = xAdd, y = yAdd + 30 } -- d end
}

yArmorAdd = yAdd + 22.5
local yArmorAdd = yAdd + 22.5
tbl.Armor = {
{ x = xAdd - 10, y = yArmorAdd + 20 },
{ x = xAdd - 5, y = yArmorAdd + 15 },
Expand Down
110 changes: 93 additions & 17 deletions gamemodes/prop_hunt/gamemode/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ include("cl_menutypes.lua")
include("cl_menu.lua")
include("cl_menuadmacc.lua")
include("cl_tauntwindow.lua")
include("cl_targetid.lua")
include("cl_autotaunt.lua")
-- Credits and Contributors message
include("cl_credits.lua")
include("cl_credits.lua") -- Credits and Contributors message

-- /!\ Convars are now moved on sh_convars.lua.

Expand Down Expand Up @@ -427,7 +425,10 @@ function GM:CalcView(pl, origin, angles, fov)
return view
end

function HUDPaint()
local blindlock_time_left = 0
local blindlock_time_left_msg = nil

local function HUDPaint()
if (game.SinglePlayer()) then
draw.WordBox( 8, ScrW()/2, ScrH()/2, "[WARNING] Single Player Mode is not Supported! Please Host a Multiplayer to play!", "Trebuchet24",
Color(0,0,0,250), Color(220,10,10), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
Expand Down Expand Up @@ -455,7 +456,7 @@ function HUDPaint()
WordBoxCol.bg, WordBoxCol.spectator, TEXT_ALIGN_CENTER )
end

local blindlock_time_left = (PHX:GetCVar( "ph_hunter_blindlock_time" ) - (CurTime() - GetGlobalFloat("RoundStartTime", 0))) + 1
blindlock_time_left = (PHX:GetCVar( "ph_hunter_blindlock_time" ) - (CurTime() - GetGlobalFloat("RoundStartTime", 0))) + 1

if blindlock_time_left < 1 && blindlock_time_left > -6 then
blindlock_time_left_msg = PHX:FTranslate("HUD_UNBLINDED")
Expand Down Expand Up @@ -564,8 +565,60 @@ function HUDPaint()
end
hook.Add("HUDPaint", "PH_HUDPaint", HUDPaint)

function GM:HUDDrawTargetID()
local tr = util.GetPlayerTrace(LocalPlayer())
local trace = util.TraceLine(tr)

-- Don't show if 'Player Names above their head' is enabled.
if PHX:GetCVar( "ph_enable_plnames" ) && PHX:GetCLCVar( "ph_cl_pltext" ) then return end

if (!trace.Hit) then return end
if (!trace.HitNonWorld) then return end

local text = "ERROR"
local font = "TargetID"

if (trace.Entity:IsPlayer() && trace.Entity:Team() == LocalPlayer():Team()) then
text = trace.Entity:Nick()
else
return
end

surface.SetFont(font)
local w, h = surface.GetTextSize(text)
local MouseX, MouseY = gui.MousePos()

if (MouseX == 0 && MouseY == 0) then
MouseX = ScrW() / 2
MouseY = ScrH() / 2
end

local x = MouseX
local y = MouseY

x = x - w / 2
y = y + 30

draw.SimpleText(text, font, x + 1, y + 1, Color(0, 0, 0, 120))
draw.SimpleText(text, font, x + 2, y + 2, Color(0, 0, 0, 50))
draw.SimpleText(text, font, x, y, self:GetTeamColor(trace.Entity))

y = y + h + 5

local text = trace.Entity:Health().."%"
local font = "TargetIDSmall"

surface.SetFont(font)
local w, h = surface.GetTextSize(text)
local x = MouseX - w / 2

draw.SimpleText(text, font, x + 1, y + 1, Color(0, 0, 0, 120))
draw.SimpleText(text, font, x + 2, y + 2, Color(0, 0, 0, 50))
draw.SimpleText(text, font, x, y, self:GetTeamColor(trace.Entity))
end

-- After the player has been drawn
function PH_PostPlayerDraw(pl)
local function PH_PostPlayerDraw(pl)
-- Draw a line on hunters
if PHX:GetCLCVar( "ph_cl_spec_hunter_line" ) && (!LocalPlayer():Alive() || LocalPlayer():Team() == TEAM_SPECTATOR) and pl:Team() == TEAM_HUNTERS then
local eyepos = pl:GetShootPos()
Expand All @@ -590,7 +643,7 @@ hook.Add("PrePlayerDraw", "PHX.HidePlayer", function(ply)
end)

-- Draws halos on team members
function drawPropSelectHalos()
local function drawPropSelectHalos()
local halocol = IndicatorColor.ok

if PHX:GetCLCVar( "ph_cl_halos" ) and GetGlobalBool("InRound", false) then
Expand Down Expand Up @@ -1040,12 +1093,16 @@ function PHX:showLangPreview()
end

--Very First Tutorial - this will only show ONCE.
CreateClientConVar("ph_cl_show_first_tutorial","1",true,true,"Show a very first tutorial window on joining")
CreateClientConVar("ph_cl_show_introduction","1",true,true,"Show PH:X introduction.")
local function ShowVeryFirstTutorial()
local fh = {}

local WFix=ScrW()*0.8
local HFix=ScrH()*0.85
if WFix <= 1090 then WFix = 1090 end
if HFix <= 648 then HFix = 648 end

fh.frame = vgui.Create("DFrame")
fh.frame:SetSize(ScrW()*0.8,ScrH()*0.85)
fh.frame:SetSize( WFix, HFix )
fh.frame:Center()
fh.frame:SetTitle("Prop Hunt X2Z: Tutorial")

Expand All @@ -1060,18 +1117,33 @@ local function ShowVeryFirstTutorial()

fh.pBottom = vgui.Create("DPanel", fh.panel)
fh.pBottom:Dock(BOTTOM)
fh.pBottom:SetSize(0,40)
fh.pBottom:SetSize(0,56)
fh.pBottom:SetPaintBackground(false)

fh.center = vgui.Create("DPanel", fh.pBottom)
fh.center:Dock(FILL)
fh.center:SetSize(0,40)
fh.center:SetPaintBackground(false)

fh.btnSetting = vgui.Create("DLabel", fh.center)
fh.btnSetting:Dock(FILL)
fh.btnSetting:SetContentAlignment(5)
fh.btnSetting:SetText("Hint: To Change Settings such as Languages, Models, Admin & Host settings,\nAccess by pressing [F1] and click [Prop Hunt Menu] button.")
fh.btnSetting:SetFont( "PHX.TopBarFont" )
fh.btnSetting:SetTextColor( Color(238,185,12) )

fh.bOpenMenu = vgui.Create("DButton", fh.pBottom)
fh.bOpenMenu:Dock(RIGHT)
fh.bOpenMenu:SetSize(160,40)
fh.bOpenMenu:SetText( "Settings Menu" )
fh.bOpenMenu:SetFont( "RobotoInfo" )
fh.bOpenMenu.DoClick = function() RunConsoleCommand("ph_x_menu", ""); fh.frame:Close() end

fh.bnext = vgui.Create("DButton", fh.pBottom)
fh.bnext:Dock(RIGHT)
fh.bnext:SetSize(128,40)
fh.bnext:SetSize(132,40)
fh.bnext:SetText(PHX:FTranslate("MISC_NEXT"))
fh.bnext:SetFont( "RobotoInfo" )
fh.bnext.DoClick = function(pnl)
fh.helpImage.Count = fh.helpImage.Count + 1
if fh.helpImage.Count > 10 then
Expand All @@ -1082,8 +1154,9 @@ local function ShowVeryFirstTutorial()

fh.bprev = vgui.Create("DButton", fh.pBottom)
fh.bprev:Dock(LEFT)
fh.bprev:SetSize(128,40)
fh.bprev:SetSize(132,40)
fh.bprev:SetText(PHX:FTranslate("MISC_PREV"))
fh.bprev:SetFont( "RobotoInfo" )
fh.bprev.DoClick = function(pnl)
fh.helpImage.Count = fh.helpImage.Count - 1
if fh.helpImage.Count < 1 then
Expand All @@ -1093,13 +1166,16 @@ local function ShowVeryFirstTutorial()
end

fh.frame:MakePopup()
RunConsoleCommand("ph_cl_show_first_tutorial", "0")

print( fh.frame:GetTall(), fh.frame:GetWide() )

RunConsoleCommand("ph_cl_show_introduction", "0")
end

net.Receive("phx_showVeryFirstTutorial", function()
if GetConVar("ph_cl_show_first_tutorial"):GetBool() then
Derma_Query("Prop Hunt X2Z Introduces many new features. Would you like to see the tutorial window before playing?", "Prop Hunt X2Z",
if GetConVar("ph_cl_show_introduction"):GetBool() then
Derma_Query("Prop Hunt X2Z Introduces many new features.\nWould you like to see the Tutorial window & access [Prop Hunt Menu] before playing?", "Prop Hunt X2Z",
"Yes", function() ShowVeryFirstTutorial() end,
"No", function() RunConsoleCommand("ph_cl_show_first_tutorial", "0") end)
"No", function() RunConsoleCommand("ph_cl_show_introduction", "0") end)
end
end)
2 changes: 1 addition & 1 deletion gamemodes/prop_hunt/gamemode/cl_menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function PHX.UI.BaseMainMenu(ply, cmd, args)
surface.DrawRect(0,0,w,h)
end

draw.DrawText( text, font ,w*0.22,h*0.4, color, TEXT_ALIGN_LEFT )
draw.DrawText( text, font ,w*0.24,h*0.4, color, TEXT_ALIGN_LEFT )
end

item.Button:SetToolTip( text )
Expand Down
Loading

0 comments on commit 0a66278

Please sign in to comment.