Skip to content

Commit 8428d01

Browse files
Recenter command
1 parent df4bb31 commit 8428d01

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ This is a mod that adds XP when killing enemies, levels and scaling of the playe
2828
- Gold bags give 100 gold base gold and is scaled with region distance.
2929
- You can only equip gear that is a maximum of 5 levels higher than your current level.
3030
- Gold drops are scaled by enemy level.
31+
- You can recenter the players region by typing `/recenter` in the chat.
3132

3233
## Installation
3334
Download the latest version of `PyroProgression_v.x.x.zip` from the latest release from [the release page](https://github.com/thetrueoneshots/PyroProgression/releases). If this `.zip` file includes a `CubeModLoader.fip` you will have to put that file in the same directory as your `cubeworld.exe`. If such a file is not added, you can get the latest modloader release from [the modloader release page](https://github.com/thetrueoneshots/Cube-World-Mod-Launcher/releases). You will have to create a new folder called mods in the folder where your `cubeworld.exe` is located if you do not have one already. You will have to put the `PyroProgression_v.x.x.dll` there. That is all there is to it! Enjoy playing
3435

3536
## Changelog
37+
- `[v.1.1]` Add level number formatting and recenter command
38+
- Levels are now formatted as: `xxx`, `x.xxK` and `x.xxM`.
39+
- With the command `/recenter` you can recenter the scaling region of the player.
3640
- `[v.1.0]` First official release for the PyroProgression mod.

main.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@ class Mod : GenericMod {
6363
* @return {int}
6464
*/
6565
virtual int OnChat(std::wstring* message) override {
66+
const wchar_t* str = message->c_str();
67+
if (!wcscmp(str, L"/recenter"))
68+
{
69+
cube::Game* game = cube::GetGame();
70+
cube::Creature* player = game->GetPlayer();
71+
if (!player)
72+
{
73+
game->PrintMessage(L"[Error] No local player found!\n", 255, 0, 0);
74+
return 1;
75+
}
76+
77+
player->entity_data.equipment.unk_item.region = player->entity_data.current_region;
78+
game->PrintMessage(L"[Notification] Correctly recentered player region.\n", 0, 255, 0);
79+
return 1;
80+
}
81+
6682
return 0;
6783
}
6884

0 commit comments

Comments
 (0)