Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
1. Navigate to your Cyberpunk install
1. Go to the directory `bin/x64/plugins/cyber_engine_tweaks/mods`
1. copy the `cyberessentials` folder into the `mods` folder
1. Launch Cyberpunk 2077 and then open the Cyber Engine Tweaks Console, if you see "[CyberEssentials] Mod activated..." in the console you know it worked.
1. Launch Cyberpunk 2077 and then open the Cyber Engine Tweaks Console, if you see "[CyberEssentials] : Mod activated Press [F1] to open menu..." in the console you know it worked.

## Commands

Expand Down Expand Up @@ -56,3 +56,14 @@
**Description:** This command is a shorter and more succinct way to get your current in game coordinates.
**Usage:** `WhereAmI()`

### Help()
**Description:** This command will list all commands and their usages and descriptions.
**Usage:** `Help()`

### HelpAdd()
**Description:** This command will list usage and description for SetWarp().
**Usage:** `HelpAdd()`

### HelpRemove()
**Description:** This command will list usage and description for RemoveWarp().
**Usage:** `HelpRemove()`
121 changes: 113 additions & 8 deletions cyberessentials/cyberessentials.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function ListWarps()
end
end

print("[CyberEssentials] " .. warp_list)
print("[CyberEssentials] : " .. warp_list)
print("Warp()")
end

function RemoveWarp(warp_name)
Expand All @@ -31,12 +32,12 @@ function RemoveWarp(warp_name)
for warp_number, warp_data in pairs(current_warps) do
if warp_data.name == warp_name then
repo:RemoveWarp(current_warps, warp_number)
print("[CyberEssentials] Removed the warp \"" .. warp_name .. "\".")
print("[CyberEssentials] : Removed the warp \"" .. warp_name .. "\".")
return
end
end

print("[CyberEssentials] No warp named \"" .. warp_name .. "\" to remove.")
print("[CyberEssentials] : No warp named \"" .. warp_name .. "\" to remove.")
end

function SetWarp(warp_name, xCoord, yCoord, zCoord)
Expand All @@ -50,13 +51,13 @@ function SetWarp(warp_name, xCoord, yCoord, zCoord)

for warp_number, warp_data in pairs(current_warps) do
if warp_data.name == warp_name then
print("[CyberEssentials] A warp with the name \"" .. warp_name .. "\" already exists, please pick a different name.")
print("[CyberEssentials] : A warp with the name \"" .. warp_name .. "\" already exists, please pick a different name.")
return
end
end

repo:AddWarp(current_warps, warp_name, xCoord, yCoord, zCoord)
print("[CyberEssentials] Set the warp \"" .. warp_name .. "\".")
print("[CyberEssentials] : Set the warp \"" .. warp_name .. "\".")
end

function Warp(warp_name)
Expand All @@ -65,14 +66,14 @@ function Warp(warp_name)

for warp_number, warp_data in pairs(current_warps) do
if warp_data.name == warp_name then
print("[CyberEssentials] Warping player to \"" .. warp_data.name .. "\".")
print("[CyberEssentials] : Warping player to \"" .. warp_data.name .. "\".")
previousPosition = my_player
game.TeleportPlayerToPosition(warp_data.x, warp_data.y, warp_data.z)
return
end
end

print("[CyberEssentials] Warp \"" .. warp_name .. "\" not found.")
print("[CyberEssentials] : Warp \"" .. warp_name .. "\" not found.")
end

function MoveForward(amount)
Expand Down Expand Up @@ -104,7 +105,7 @@ function Back()
local my_player = player:getPlayerInfo()

if (not previousPosition) then
print("[CyberEssentials] There is no previous position to move you to.")
print("[CyberEssentials] : There is no previous position to move you to.")
else
game.TeleportPlayerToPosition(previousPosition.xCoord, previousPosition.yCoord, previousPosition.zCoord)
previousPosition = my_player
Expand All @@ -119,3 +120,107 @@ function WhereAmI()
print("z: " .. my_player.zCoord)
print("yaw: " .. my_player.yaw)
end

function Help()

print(" ")
print("[CyberEssentials] : Commands List (Tip: You can click a line in the console to copy it directly) ")
print(" ")
print("SetWarp()")

print("-Note!: To use this command, you must put quotes around the name of the warp you want to create!")

print("--Description:")
print("--This command allows you to create a new warp based on your current position or a set of coordinates that you can teleport to using the Warp() command.")

print("---Usages:")
print("--- SetWarp(My new warp)")
print("--- SetWarp(Peralezes' Apartment, -75.815399, -113.607819, 111.161728)")

print(" ")
print("[CyberEssentials] : ")
print("Warp()")

print("-Note!: To use this command, you must put quotes around the name of the warp you want to go to!")

print("--Description:")
print("--This command allows you to teleport to any previously created warp locations.")

print("---Usage: Warp(V's Apartment)")
print(" ")
print("[CyberEssentials] : ")
print("RemoveWarp()")

print("-Note!: To use this command, you must put quotes around the name of the warp you want to remove!")

print("--Description:")
print("--This command allows you to remove a previously created warp.")

print("---Usage: RemoveWarp(V's Apartment)")

print(" ")
print("[CyberEssentials] : ")
print("MoveForward()")

print("--Description:")
print("--This command will move you in the direction you're looking by the specified distance.")

print("---Usage: MoveForward(10)")

print(" ")
print("[CyberEssentials] : ")
print("Back()")

print("--Description:")
print("--This command will move you to the players last location before using any of the movement commands.")

print("---Usage: Back(10)")

print(" ")
print("[CyberEssentials] : ")
print("GoUp()")

print("--Description: ")
print("--This command will move you up by the specified distance.")

print("---Usage: GoUp(10)")

print(" ")
print("[CyberEssentials] : ")
print("GoDown()")

print("--Description:")
print("--This command will move you down by the specified amount.")

print("---Usage: GoDown(10)")


end

function HelpAdd()
print(" ")
print("[CyberEssentials] : Add New Warp Usage")
print("SetWarp()")

print("-Note!: To use this command, you must put quotes around the name of the warp you want to create!")

print("--Description:")
print("--This command allows you to create a new warp based on your current position or a set of coordinates that you can teleport to using the Warp() command.")

print("---Usages:")
print("--- SetWarp(My new warp)")
print("--- SetWarp(Peralezes' Apartment, -75.815399, -113.607819, 111.161728)")
end

function HelpRemove()
print(" ")
print("[CyberEssentials] : Remove Warp Usage")
print("RemoveWarp()")

print("-Note!: To use this command, you must put quotes around the name of the warp you want to remove!")

print("--Description:")
print("--This command allows you to remove a previously created warp.")

print("---Usage: RemoveWarp(V's Apartment)")
end
88 changes: 86 additions & 2 deletions cyberessentials/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,88 @@
--UI key, default 0x23 for END
local hotkeyUI = 0x70 --F1

--Start CyberEssentials
dofile("cyberessentials/cyberessentials.lua")
registerForEvent("onInit", function()
dofile("cyberessentials/cyberessentials.lua")
print("[CyberEssentials] Mod activated...")
print("[CyberEssentials] : Mod activated Press [F1] to open menu...")
end)
registerForEvent("onUpdate", function(deltaTime)
--UIToggle
if (ImGui.IsKeyPressed(hotkeyUI, false)) then
showUI = not showUI
end
end)

--------
-- UI --
--------
registerForEvent("onDraw", function()
if (showUI) then
--Window Sizing
ImGui.SetNextWindowPos(0, 450, ImGuiCond.FirstUseEver)
ImGui.SetNextWindowSize(265, 175, ImGuiCond.Appearing)

-- Window Color Scheme
-- If you add/remove here, remember to set ImGui.PopStyleColor(Int) correctly down towards the bottom of the file if it's being used
ImGui.PushStyleColor(ImGuiCol.FrameBg, 0.56, 0.06, 0.03, 0.35)
--ImGui.PushStyleColor(ImGuiCol.WindowBg, 0.56, 0.06, 0.03, 0.35)
ImGui.PushStyleColor(ImGuiCol.Border, 0.56, 0.06, 0.03, 1)
ImGui.PushStyleColor(ImGuiCol.TitleBg, 0.56, 0.06, 0.03, 0.5)
ImGui.PushStyleColor(ImGuiCol.TitleBgActive, 0.56, 0.06, 0.03, 0.75)
ImGui.PushStyleColor(ImGuiCol.TitleBgCollapsed, 0.56, 0.06, 0.03, 0.25)
ImGui.PushStyleColor(ImGuiCol.Tab, 1, 0.2, 0.2, 0.5)
ImGui.PushStyleColor(ImGuiCol.TabHovered, 1, 0.2, 0.2, 0.85)
ImGui.PushStyleColor(ImGuiCol.TabActive, 1, 0.2, 0.2, 1)
ImGui.PushStyleColor(ImGuiCol.Button, 0.56, 0.06, 0.03, 0.50)
ImGui.PushStyleColor(ImGuiCol.ButtonHovered, 0.56, 0.06, 0.03, 0.75)
ImGui.PushStyleColor(ImGuiCol.ButtonActive, 0.56, 0.06, 0.03, 1)
ImGui.PushStyleColor(ImGuiCol.ResizeGrip, 0.56, 0.06, 0.03, 0.6)
ImGui.PushStyleColor(ImGuiCol.ResizeGripHovered, 0.56, 0.06, 0.03, 0.75)
ImGui.PushStyleColor(ImGuiCol.ResizeGripActive, 0.56, 0.06, 0.03, 1)

if (ImGui.Begin("[CyberEssentials]:")) then

--Button Sizes
local buttonHeight1 = 19
local buttonHeight2 = 30
local buttonWidth1 = 120
local buttonWidth2 = 159
local buttonWidth3 = 248
local buttonWidth4 = 492

if (ImGui.BeginTabBar("CETabs")) then



--CyberEssentials GUI Buttons
if (ImGui.BeginTabItem("CyberEssentials")) then
ImGui.Spacing()
ImGui.Text("CyberEssentials Usage")
ImGui.Spacing()
ImGui.PushItemWidth(250)
if(ImGui.Button("List Warps", buttonWidth1, buttonHeight1)) then
ListWarps()
end
ImGui.SameLine()
if (ImGui.Button("Where Am I?", buttonWidth1, buttonHeight1)) then
WhereAmI()
end
if(ImGui.Button("Add Warp", buttonWidth1, buttonHeight1)) then
HelpAdd()
end
ImGui.SameLine()
if(ImGui.Button("Remove Warp", buttonWidth1, buttonHeight1)) then
HelpRemove()
end
if(ImGui.Button("CyberEssentials Commands List", buttonWidth3, buttonHeight2)) then
Help()
end
ImGui.EndTabItem()
end
ImGui.EndTabBar()
end
end
ImGui.PopStyleColor(14) --Contains the PushStyleColors above to this menu's Window. Remove this line to push this color scheme to all windows
ImGui.End()
end
end)
5 changes: 4 additions & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ SetWarp("test_warp")
SetWarp("secondary", "-75.815399", "-113.607819", "111.161728")
ListWarps()
RemoveWarp("test_warp")
RemoveWarp("secondary")
RemoveWarp("secondary")
Help()
HelpAdd()
HelpRemove()