Skip to content

Commit

Permalink
Now saving hotkeys.sco in modules folder (and removed use of fopen)
Browse files Browse the repository at this point in the history
  • Loading branch information
DMD authored and DMD committed Nov 5, 2020
1 parent f38b158 commit a8febee
Show file tree
Hide file tree
Showing 4 changed files with 369 additions and 376 deletions.
9 changes: 9 additions & 0 deletions TemplePlus/gamesystems/legacysystems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "turn_based.h"
#include "d20_race.h"
#include "ai.h"
#include <hotkeys.h>


//*****************************************************************************
Expand Down Expand Up @@ -868,6 +869,14 @@ D20System::~D20System() {
shutdown();
damage.Exit();
}
void D20System::LoadModule()
{
auto file = tio_fopen("hotkeys.sco", "rb");
if (file) {
hotkeys.LoadHotkeys(file);
tio_fclose(file);
}
}
void D20System::Reset() {
auto reset = temple::GetPointer<void()>(0x1004c9b0);
reset();
Expand Down
3 changes: 2 additions & 1 deletion TemplePlus/gamesystems/legacysystems.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,12 @@ class LevelSystem : public GameSystem {
const std::string &GetName() const override;
};

class D20System : public GameSystem, public ResetAwareGameSystem, public TimeAwareGameSystem {
class D20System : public GameSystem, public ResetAwareGameSystem, public TimeAwareGameSystem, public ModuleAwareGameSystem {
public:
static constexpr auto Name = "D20";
D20System(const GameSystemConf &config);
~D20System();
void LoadModule() override;
void Reset() override;
void AdvanceTime(uint32_t time) override;
const std::string &GetName() const override;
Expand Down
Loading

0 comments on commit a8febee

Please sign in to comment.