-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new look is now customizable and minor behaviour fixes #26
base: master
Are you sure you want to change the base?
Conversation
+ui colors now customizable with a third tab in the menu named 'Customization' +seagull ragdoll spawn only once now (sometimes spawned multiple when killed) +bait hooking adjustments so they dont get stuck in displacements and nocollide +bait release timer so it does not reattach instantly +bait spawn height offset addition to avoid creating black holes of bait +removed broken cashreg model +stove cooking offset higher since some stuff were not cooked at their set positions +'b' now opens the menu if its bound to '+zoom' or not at all +could not buy bait if it was equal to the money player has. +equipping the fishingrod now messages the player of default bind +entities fishingrod, bobber and hook are no longer possible to "tool" and "property" (context menu) +added crosshair to see where the player is aiming (also customizable) +minor fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick read through, these are some of the biggest issues in my view. But from now on please never do another mega commit with multiple changes. It makes it almost impossible to review each change and suggest better implementations
@m4tsa mind reviewing these changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall there are a lot of inconsistencies namely:
- variable casing all over the place
- function casing all over the place
- unneeded checks
- unneeded parenthesis in ifs
- short and bad variable names, your variable names should be descriptive and not less than 3 characters unless its something widely known such as pos, x, y etc...
- lots of unneeded ifs that can be merged
- inconsistencies in spaces between operators, you've added spaces in some places but not others
My review is non-exhaustive, I'm not going to add a comment for each individual issues because they appear A LOT of times in your changes.
I'd rather just close the PR, currently it has more drawbacks and bad practices than benefits |
It might be salvageable but a lot of work needs to be done on it @0x098 @m4tsa |
I suggest we just close this and require every feature on the list to be done in it's own PR that can be independently reviewed. |
I don't see the point of creating a new PR for this, we're gonna lose all the relevant conversations, and what for? So it can look like a quick clean PR? |
This looks better, @m4tsa please review these changes |
Just because he actually tested his code and found some issues (there are probably more lurking around) instead of fixing the concerns posted does not make the PR any better in my eyes. |
I'd argue that usually if you test more and fix more issues it makes a contribution better though (?)
Which are? The changes you've requested have been made and so have mine. |
I am not able to review changes individually to see if they make sense. So far I have only been able to look quickly through and look for obvious errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TL:DR
- you have a lot of magic numbers that seem to be constants, make them actual constants and give them names
- you have a lot of inconsistencies with your variable naming and spacing of arguments
- you have unnecessary operations like *1
But all in all this is getting better
lua/fishing_mod/catch/stove.lua
Outdated
surface.DrawRect(0, 0, x, y) | ||
surface.DrawRect(3, 24, x-6, y-24-3) | ||
surface.DrawRect(3, 24, x - 6, y - 24 - 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if your -3 is a constant please make it a variable such as CONSTANT = 3, if not then just put the actual number instead of doing unnecessary operations
lua/fishing_mod/cl_init.lua
Outdated
text_height, text_width = surface.GetTextSize(string.Replace(string.Replace(data.text, "\t", ""), "\n", "")) | ||
text_height, text_width = text_height + 8, text_width + 8 | ||
surface.DrawRect(xy.x - text_height / 2 - pad, xy.y - text_width / 2 - 1 - pad + 16, text_height + pad * 2, text_width + pad * 1) | ||
surface.DrawRect(xy.x - text_height / 2 + 3 - pad, xy.y - text_width / 2 + 2 - pad + 16, text_height - 6 + pad * 2, text_width - 6 + pad * 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you multiply by 1?
lua/fishing_mod/cl_init.lua
Outdated
if IsValid(LocalPlayer():GetActiveWeapon()) and LocalPlayer():GetActiveWeapon():GetClass() == "weapon_fishing_rod" then | ||
surface.SetDrawColor(crosshair.r, crosshair.g, crosshair.b, crosshair.a) | ||
local xy = chpos:ToScreen() | ||
surface.DrawRect( xy.x, xy.y+5, 1, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inconsistent spacing between numbers and operators
lua/fishing_mod/cl_init.lua
Outdated
local force_b = 1 | ||
concommand.Add("fishing_mod_b_opens_always", function(ply, cmd, args) | ||
if isnumber(tonumber(args[1])) then | ||
force_b = math.Clamp(math.Round(args[1]),0,1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inconsistent spacing between commas and arguments
lua/fishing_mod/cl_shop_menu.lua
Outdated
if temp_data then | ||
for k, v in pairs(temp_data) do | ||
if k and v then | ||
if #tostring(k) < 4 then return end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that looks really wonky
lua/fishing_mod/cl_shop_menu.lua
Outdated
end | ||
surface.DrawRect(0, 0, w, h) | ||
end | ||
|
||
baitsbutton:SetPos(3 + (xpx - 6) / 2, 24) -- baits shop start of conf | ||
baitsbutton:SetSize((xpx - 6) / 2, 22) | ||
baitsbutton:SetPos(3 + (xpx - 6) / 3, 24) -- baits shop start of conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this was part of the original code but when you do operations with "magic numbers" please make them constants such as CONSTANT = 3 it greatly helps reading
lua/fishing_mod/cl_shop_menu.lua
Outdated
elseif not self.selected then | ||
baitsbutton:SetColor(button_not_selected) | ||
end | ||
if baitsbutton:IsHovered() then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your variables have switched from PascalCase to snake_case to whateverthisis
lua/fishing_mod/cl_shop_menu.lua
Outdated
self:SetVisible(false) | ||
function self:Think() | ||
x, y = self:GetParent():GetSize() | ||
self:SetSize(x - 6, y - 3 - 46) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is 3 ? Constant again ? Same comment as above
lua/fishing_mod/cl_shop_menu.lua
Outdated
savebutton.DoClick = function() | ||
if fishingmod.SaveUIColors then | ||
fishingmod.SaveUIColors() | ||
chat.AddText(Color(0, 255, 0, 255), "[Fishing Mod]", Color(255, 255, 255), ": Colors have been saved!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're gonna re-use colors, please store them instead of re-creating them, creating tables in lua is intensive. This can be avoided
@@ -326,19 +658,19 @@ function PANEL:Init() | |||
end | |||
|
|||
function PANEL:SetSale(multiplier) | |||
self.percent = math.Round((multiplier*-1+1)*100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just -multiplier ?
Is there still something major preventing merge? Considering this is the only fishingmod upgrade done for a long time I am inclined to just approve it for testing regardless of its prettyness. Easy to validate update requests get merged muuch faster. |
@Python1320 for me not really, but I think @m4tsa still has things to say |
gmod used to allow doing that
with a little seagull behaviour modification
+ui colors now customizable with a third tab in the menu named 'Customization'
+seagull ragdoll spawn only once now (sometimes spawned multiple when killed)
+bait hooking adjustments... so they dont get stuck in displacements and nocollide
+bait release timer so it does not reattach instantly
+bait spawn height offset addition to avoid creating black holes of bait
+removed broken cashreg model (it was the dod version i think)
+stove cooking offset higher since some stuff were not cooked at their set positions
+'b' now opens the menu if cvar fishing_mod_b_opens_always is 1 or greater
+could not buy bait if it was equal to the money player has.
+equipping the fishingrod now messages the player of default bind
+entities fishingrod, bobber and hook are no longer possible to "tool" and "property" (context menu)
+added crosshair to see where the player is aiming (also customizable color)
+minor fixes