Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamepiaynmo committed Jul 31, 2020
1 parent 9557b2d commit 4c18ab8
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 16 deletions.
43 changes: 32 additions & 11 deletions BMLMod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ void BMLMod::OnLoadObject(CKSTRING filename, BOOL isMap, CKSTRING masterName, CK
GetLogger()->Info("Create BML Gui");
m_ingameBanner = new BGui::Gui();
m_ingameBanner->AddTextLabel("M_Use_BML", "Ballance Mod Loader " BML_VERSION, ExecuteBB::GAMEFONT_01, 0, 0, 1, 0.03f);
m_cheat[0] = m_ingameBanner->AddTextLabel("M_Use_Cheat", "Cheat Mode Enabled", ExecuteBB::GAMEFONT_03, 0, 0.9f, 1, 0.03f);
m_cheat[1] = m_ingameBanner->AddTextLabel("M_Use_Cheat", "Cheat Mode Enabled", ExecuteBB::GAMEFONT_03A, 0.001f, 0.901f, 1, 0.03f);
m_cheat[2] = m_ingameBanner->AddTextLabel("M_Use_Cheat", "Cheat Mode Enabled", ExecuteBB::GAMEFONT_03A, 0.002f, 0.902f, 1, 0.03f);
m_cheat = m_ingameBanner->AddTextLabel("M_Use_Cheat", "Cheat Mode Enabled", ExecuteBB::GAMEFONT_01, 0, 0.85f, 1, 0.05f);
//m_cheat[1] = m_ingameBanner->AddTextLabel("M_Use_Cheat", "Cheat Mode Enabled", ExecuteBB::GAMEFONT_03A, 0.001f, 0.901f, 1, 0.03f);
//m_cheat[2] = m_ingameBanner->AddTextLabel("M_Use_Cheat", "Cheat Mode Enabled", ExecuteBB::GAMEFONT_03A, 0.002f, 0.902f, 1, 0.03f);
m_fps = m_ingameBanner->AddTextLabel("M_Show_Fps", "", ExecuteBB::GAMEFONT_01, 0, 0, 0.2f, 0.03f);
m_srTitle = m_ingameBanner->AddTextLabel("M_Time_Counter_Title", "SR Timer", ExecuteBB::GAMEFONT_01, 0.03f, 0.8f, 0.2f, 0.03f);
m_srScore = m_ingameBanner->AddTextLabel("M_Time_Counter", "", ExecuteBB::GAMEFONT_01, 0.05f, 0.83f, 0.2f, 0.03f);
m_fps->SetAlignment(ALIGN_LEFT);
m_fps->SetVisible(m_showFPS->GetBoolean());
m_srTitle->SetAlignment(ALIGN_LEFT);
m_srTitle->SetVisible(false);
m_srScore->SetAlignment(ALIGN_LEFT);
m_srScore->SetVisible(false);
for (int i = 0; i < 3; i++)
m_cheat[i]->SetVisible(false);
m_cheat->SetVisible(false);
m_customMaps = m_ingameBanner->AddRightButton("M_Enter_Custom_Maps", 0.4f, 0.6238f, [this]() {
m_exitStart->ActivateInput(0);
m_exitStart->Activate();
Expand Down Expand Up @@ -536,6 +536,13 @@ void BMLMod::OnModifyConfig(CKSTRING category, CKSTRING key, IProperty* prop) {
m_oclinks[i]->SetOutBehaviorIO(m_oclinkio[i][m_overclock->GetBoolean()]);
}
}
if (prop == m_showFPS) {
m_fps->SetVisible(prop->GetBoolean());
}
if (prop == m_showSR && m_bml->IsIngame()) {
m_srScore->SetVisible(m_showSR->GetBoolean());
m_srTitle->SetVisible(m_showSR->GetBoolean());
}
}

void BMLMod::OnLoad() {
Expand All @@ -556,11 +563,19 @@ void BMLMod::OnLoad() {
m_overclock->SetComment("Remove delay of spawn / respawn");
m_overclock->SetDefaultBoolean(false);

m_showFPS = GetConfig()->GetProperty("Misc", "ShowFPS");
m_showFPS->SetComment("Show FPS at top-left corner");
m_showFPS->SetDefaultBoolean(true);

m_showSR = GetConfig()->GetProperty("Misc", "ShowSRTimer");
m_showSR->SetComment("Show SR Timer above Time Score");
m_showSR->SetDefaultBoolean(true);

GetConfig()->SetCategoryComment("Debug", "Debug Utilities");
m_suicide = GetConfig()->GetProperty("Debug", "Suicide");
m_suicide->SetComment("Suicide");
m_suicide->SetDefaultKey(CKKEY_R);

GetConfig()->SetCategoryComment("Debug", "Debug Utilities");
m_ballCheat[0] = GetConfig()->GetProperty("Debug", "BallUp");
m_ballCheat[0]->SetComment("Apply an upward force to the ball");
m_ballCheat[0]->SetDefaultKey(CKKEY_F1);
Expand Down Expand Up @@ -726,7 +741,8 @@ void BMLMod::OnProcess() {
}

m_msgLog->Process();
m_ingameBanner->Process();
if (!IsInTravelCam())
m_ingameBanner->Process();
if (m_currentGui)
m_currentGui->Process();
m_smHook->Process();
Expand Down Expand Up @@ -1021,8 +1037,10 @@ void BMLMod::OnPostResetLevel() {
void BMLMod::OnStartLevel() {
m_srtimer = 0.0f;
m_srScore->SetText("00:00:00.000");
m_srScore->SetVisible(true);
m_srTitle->SetVisible(true);
if (m_showSR->GetBoolean()) {
m_srScore->SetVisible(true);
m_srTitle->SetVisible(true);
}
SetParamValue(m_loadCustom, FALSE);
}

Expand Down Expand Up @@ -1095,8 +1113,7 @@ void BMLMod::AddIngameMessage(CKSTRING msg) {
}

void BMLMod::ShowCheatBanner(bool show) {
for (int i = 0; i < 3; i++)
m_cheat[i]->SetVisible(show);
m_cheat->SetVisible(show);
}

void BMLMod::ShowModOptions() {
Expand Down Expand Up @@ -1139,10 +1156,14 @@ void CommandTravel::Execute(IBML* bml, const std::vector<std::string>& args) {
if (m_mod->IsInTravelCam()) {
m_mod->ExitTravelCam();
m_mod->AddIngameMessage("Exit Travel Camera");
bml->GetGroupByName("HUD_sprites")->Show();
bml->GetGroupByName("LifeBalls")->Show();
}
else {
m_mod->EnterTravelCam();
m_mod->AddIngameMessage("Enter Travel Camera");
bml->GetGroupByName("HUD_sprites")->Show(CKHIDE);
bml->GetGroupByName("LifeBalls")->Show(CKHIDE);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion BMLMod.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class BMLMod : public IMod {
} m_msg[MSG_MAXSIZE];

BGui::Gui* m_ingameBanner = nullptr;
BGui::Label* m_cheat[3], * m_fps, * m_srScore, * m_srTitle = nullptr;
BGui::Label* m_cheat, * m_fps, * m_srScore, * m_srTitle = nullptr;
int m_fpscnt = 0, m_fpstimer = 0;
float m_srtimer = 0.0f;
bool m_sractive = false;
Expand All @@ -204,6 +204,8 @@ class BMLMod : public IMod {
IProperty* m_skipAnim;
IProperty* m_fullscreenKey;
IProperty* m_unlockRes;
IProperty* m_showFPS;
IProperty* m_showSR;

IProperty* m_ballCheat[2];
IProperty* m_suicide;
Expand Down
2 changes: 1 addition & 1 deletion BuildVer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define BML_MAJOR_VER 0
#define BML_MINOR_VER 3
#define BML_BUILD_VER 18
#define BML_BUILD_VER 24
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
# BallanceModLoader
Mod Loader for Ballance
# Ballance Mod Loader

![BML](figures/bml.png)

If you play Minecraft and have heard of Forge, then you would easily understand what BML means to Ballance.

![BML](image/bml.png)
Ballance Mod Loader is a free, open-source modding API used to extend the content of original Ballance game.

For more information, please read [The Wiki](wiki).

### Installing

Go to the Release page and download the latest build (Do not download the dev package unless you would like to develop your own mod). Extract all contents into your Ballance root folder. After that you can find the following files in your Ballance directory:

* BML.dll in BuildingBlocks directory;
* ModLoader directory.

Before launching the game please check if the compatibility mode of Player.exe is at least Windows XP (Windows 7, Windows 8, etc.). If everything goes well, then you can see the message of BML on the top.

![Hello World](figures/HelloWorld.png)

### Uninstalling

Go to Ballance root folder, and delete BML.dll in BuildingBlocks directory. If you would like to remove the entire data of BML (installed mods, maps, configs etc.), delete the ModLoader folder as well.

### Troubleshooting

If your game crashes after installing BML, or you have met bugs playing with BML, please raise a new Issue at GitHub, with the following information:

* Describe the condition you met in detail;
* Screenshots to help explaining if possible;
* Paste the content of ModLoader.log (in ModLoader folder).
Binary file added figures/CheatMode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/bml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed image/bml.png
Binary file not shown.

0 comments on commit 4c18ab8

Please sign in to comment.