Skip to content

Commit

Permalink
Merge pull request #87 from mir-diablo-ii-tools/feature/disable-scrol…
Browse files Browse the repository at this point in the history
…l-of-inifuss-rect

Disable rectangle draw in Scroll of Inifuss screen
  • Loading branch information
IAmTrial authored Jun 26, 2022
2 parents 49766ca + e37a510 commit 716a452
Show file tree
Hide file tree
Showing 7 changed files with 476 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ set(CPP_FILES
"${PROJECT_DIR}/src/helper/glide3x_version.cc"
"${PROJECT_DIR}/src/helper/patch_address_and_size.cpp"
"${PROJECT_DIR}/src/helper/position_realignment.cc"
"${PROJECT_DIR}/src/patches/draw/d2client_disable_scroll_of_inifuss_rect_patch/d2client_disable_scroll_of_inifuss_rect_patch.cc"
"${PROJECT_DIR}/src/patches/draw/d2client_disable_scroll_of_inifuss_rect_patch/d2client_disable_scroll_of_inifuss_rect_patch_1_07.cc"
"${PROJECT_DIR}/src/patches/draw/d2client_draw_interface_bar_background_patch/d2client_draw_interface_bar_background.cc"
"${PROJECT_DIR}/src/patches/draw/d2client_draw_interface_bar_background_patch/d2client_draw_interface_bar_background_patch.cc"
"${PROJECT_DIR}/src/patches/draw/d2client_draw_interface_bar_background_patch/d2client_draw_interface_bar_background_patch_1_09d.cc"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/**
* SlashGaming Diablo II Free Resolution
* Copyright (C) 2019-2022 Mir Drualga
*
* This file is part of SlashGaming Diablo II Free Resolution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional permissions under GNU Affero General Public License version 3
* section 7
*
* If you modify this Program, or any covered work, by linking or combining
* it with Diablo II (or a modified version of that game and its
* libraries), containing parts covered by the terms of Blizzard End User
* License Agreement, the licensors of this Program grant you additional
* permission to convey the resulting work. This additional permission is
* also extended to any combination of expansions, mods, and remasters of
* the game.
*
* If you modify this Program, or any covered work, by linking or combining
* it with any Graphics Device Interface (GDI), DirectDraw, Direct3D,
* Glide, OpenGL, or Rave wrapper (or modified versions of those
* libraries), containing parts not covered by a compatible license, the
* licensors of this Program grant you additional permission to convey the
* resulting work.
*
* If you modify this Program, or any covered work, by linking or combining
* it with any library (or a modified version of that library) that links
* to Diablo II (or a modified version of that game and its libraries),
* containing parts not covered by a compatible license, the licensors of
* this Program grant you additional permission to convey the resulting
* work.
*/

#include "d2client_disable_scroll_of_inifuss_rect_patch.hpp"

#include <stddef.h>

#include <sgd2mapi.hpp>
#include "d2client_disable_scroll_of_inifuss_rect_patch_1_07.hpp"

namespace sgd2fr {
namespace d2client {

DisableScrollOfInifussRectPatch::DisableScrollOfInifussRectPatch()
: AbstractMultiversionPatch(IsApplicable(), InitPatch()) {
}

bool DisableScrollOfInifussRectPatch::IsApplicable() {
return true;
}

AbstractVersionPatch* DisableScrollOfInifussRectPatch::InitPatch() {
if (!IsApplicable()) {
return NULL;
}

::d2::GameVersion running_game_version = ::d2::game_version::GetRunning();

switch (running_game_version) {
case ::d2::GameVersion::k1_07Beta:
case ::d2::GameVersion::k1_07:
case ::d2::GameVersion::k1_08:
case ::d2::GameVersion::k1_09:
case ::d2::GameVersion::k1_09B:
case ::d2::GameVersion::k1_09D:
case ::d2::GameVersion::k1_10Beta:
case ::d2::GameVersion::k1_10SBeta:
case ::d2::GameVersion::k1_10:
case ::d2::GameVersion::k1_11:
case ::d2::GameVersion::k1_11B:
case ::d2::GameVersion::k1_12A:
case ::d2::GameVersion::k1_13ABeta:
case ::d2::GameVersion::k1_13C:
case ::d2::GameVersion::k1_13D:
case ::d2::GameVersion::kClassic1_14A:
case ::d2::GameVersion::kLod1_14A:
case ::d2::GameVersion::kClassic1_14B:
case ::d2::GameVersion::kLod1_14B:
case ::d2::GameVersion::kClassic1_14C:
case ::d2::GameVersion::kLod1_14C:
case ::d2::GameVersion::kClassic1_14D:
case ::d2::GameVersion::kLod1_14D: {
return new DisableScrollOfInifussRectPatch_1_07();
}
}
}

} // namespace d2client
} // namespace sgd2fr
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
* SlashGaming Diablo II Free Resolution
* Copyright (C) 2019-2022 Mir Drualga
*
* This file is part of SlashGaming Diablo II Free Resolution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional permissions under GNU Affero General Public License version 3
* section 7
*
* If you modify this Program, or any covered work, by linking or combining
* it with Diablo II (or a modified version of that game and its
* libraries), containing parts covered by the terms of Blizzard End User
* License Agreement, the licensors of this Program grant you additional
* permission to convey the resulting work. This additional permission is
* also extended to any combination of expansions, mods, and remasters of
* the game.
*
* If you modify this Program, or any covered work, by linking or combining
* it with any Graphics Device Interface (GDI), DirectDraw, Direct3D,
* Glide, OpenGL, or Rave wrapper (or modified versions of those
* libraries), containing parts not covered by a compatible license, the
* licensors of this Program grant you additional permission to convey the
* resulting work.
*
* If you modify this Program, or any covered work, by linking or combining
* it with any library (or a modified version of that library) that links
* to Diablo II (or a modified version of that game and its libraries),
* containing parts not covered by a compatible license, the licensors of
* this Program grant you additional permission to convey the resulting
* work.
*/

#ifndef SGD2FR_PATCHES_DRAW_D2CLIENT_DISABLE_SCROLL_OF_INIFUSS_RECT_D2CLIENT_DISABLE_SCROLL_OF_INIFUSS_RECT_PATCH_HPP_
#define SGD2FR_PATCHES_DRAW_D2CLIENT_DISABLE_SCROLL_OF_INIFUSS_RECT_D2CLIENT_DISABLE_SCROLL_OF_INIFUSS_RECT_PATCH_HPP_

#include "../../../helper/abstract_multiversion_patch.hpp"
#include "../../../helper/abstract_version_patch.hpp"

namespace sgd2fr {
namespace d2client {

class DisableScrollOfInifussRectPatch
: public AbstractMultiversionPatch {
public:
DisableScrollOfInifussRectPatch();

private:
static bool IsApplicable();
static AbstractVersionPatch* InitPatch();
};

} // namespace d2client
} // namespace sgd2fr

#endif // SGD2FR_PATCHES_DRAW_D2CLIENT_DISABLE_SCROLL_OF_INIFUSS_RECT_D2CLIENT_DISABLE_SCROLL_OF_INIFUSS_RECT_PATCH_HPP_
Loading

0 comments on commit 716a452

Please sign in to comment.