-
Notifications
You must be signed in to change notification settings - Fork 87
Add leather addon #1720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ottml
wants to merge
77
commits into
Return-To-The-Roots:master
Choose a base branch
from
ottml:leather_addon
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add leather addon #1720
Changes from 66 commits
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
ed52f31
Adding ware workflow, buildings and menus for leather addon
ottml 0a375f0
Add distribution tab for ham and make gui more general
ottml 1d64203
Add compatibilty code
ottml 8ba2b06
Add direct transport route
ottml 8f6442e
Add fixed animations from leather_bobs.lst
ottml eca0f39
Skinner goes out to get skins from carcass if he has no pigs (natural…
ottml cecf2f6
LeatherAddon military (1): Add SetArmorAllowed game command
ottml 128de04
LeatherAddon military (2): Add logic for armor in military building a…
ottml 0733fba
LeatherAddon military (3): Add armor gui elements to military building
ottml 05a95fc
Add test for SetArmorAllowed
ottml 0d71a79
Add compatibility code for ChangeDistribution and increase game comma…
ottml 71956d7
Add new transportation type leatherworking and compatibility code for…
ottml 73b6b1e
Fix wrong default build order
ottml db98d2c
Solider has 30 percent chance to not die if he has an armor and is hi…
ottml f014783
Reduce search range for skinner to hunter distance
ottml c95526e
Do not show tabs for goods in distribution gui having only one entry
ottml ef84e6a
Add correct default values
ottml 8c03a76
Fix build after rebase
ottml d39cb65
Add new base class for armored people
ottml ddbb198
Use same render code for fighting and armored people
ottml 7d90817
Add armor base class to trade donkey too
ottml beb3744
Add armored soldiers to inventory and add enums for it
ottml 7d75f28
Add logic for counting armored soldiers in inventory and compatibilit…
ottml e69bcc1
Add and remove armored soldiers to global inventory add missing adds …
ottml ed3a831
Add tooltip to inventory to show number of armored soldiers
ottml 96e5307
Show amored soldiers on ship (debug only)
ottml ec99c8a
Avoid crash in sorted container
ottml a5ce0b4
Adjust comperators to take armor into account
ottml 74104d8
Avoid crash/inconsisent state due to new comperator including armor
ottml 6b07609
Fix formatting
ottml a24272c
Handle real inventory correct (Part 1)
ottml a4d232b
Fix formatting and constexpr
ottml 86133b6
Handle real inventory correct (Part 1)
ottml e2f6385
Add armored soldiers to reserve
ottml ea7a78b
Add real for orderJob
ottml 163be20
Use correct lst file (seems to be broken due to fixup from git)
ottml bb5683e
Handle armor correct when building is destroyed or captured and when …
ottml 8931dcd
Add and remove armored figures correct to visual inventory
ottml bf5feae
Remove code duplication and draw +1 only if HITPOINTS addon is activa…
ottml 32b04e4
Add addons to disable armor by default and behaviour for armor delive…
ottml 6ab9d28
Add function to avoid code duplication
ottml cf4330b
Fix clang-tidy warnings
ottml 86d1fbd
Add test for trading and warehouse
ottml afed411
Add test for soldier losing armor in fight instead of hitpoint
ottml 07c684d
Add replay compatibility for ChangeBuildOrder and SetAllInventorySett…
ottml 8aed2e2
Add comment about GC changes
ottml 5ff5195
Fix circular dependency during deserialization
ottml 60dcde4
Increase minor replay version to be able to set the correct initial d…
ottml 53dab5d
Code review
ottml 41fe745
Code review
ottml 4b9f458
Code review
ottml 121fa8d
Code review
ottml 294c90c
Code review
ottml ec7bfcb
Code review
ottml 15cf161
Code review: Remove comment
ottml ae9b390
Code review: Remove comment
ottml e799396
Apply suggestions from code review
ottml ead692b
Code review: fix clang tidy warning
ottml 3fdc1d1
Code review: Improve unit test
ottml 10b02a5
Code review: Move addon check functions for unused Ware/Jobs/Building…
ottml eb21c3f
Code review: Move addon check functions for unused Ware/Jobs/Building…
ottml 9fbe2a5
Code review: Move addon check functions for unused Ware/Jobs/Building…
ottml 67263fc
Code review: Inline functions
ottml 9587714
Code review: Use CamelCase and rename enum class
ottml 5d95f9e
Code review: Rename IsArmorDisabled to IsArmorAllowed
ottml cafb78f
Code review: Use consistent cast and parse argument as reference. Rem…
ottml 78acaf3
Code review: Remove Invalid state from enum and throw exception when …
ottml 32217de
Code review: Rename functions, remove auto return type and capture ad…
ottml d7204ff
Code review: Add named constants for deserialization code for better …
ottml c05a293
Code review: Use checkedCast
ottml 650a826
Code review: Rewrite test and fold 4 cases into one
ottml a8dd2c8
Code review: Use switch
ottml 55b89ea
Code review: Rename variables and change type
ottml be76687
Code review: Use constants and rewrite counting of traded soldiers
ottml 31f7ed4
Code review
ottml cf8ea9a
Code review: Use clearer names for varibles
ottml a3d378e
Code review: Optimize code
ottml File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // Copyright (C) 2005 - 2025 Settlers Freaks (sf-team at siedler25.org) | ||
| // | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| #include "AddonHelperFunctions.h" | ||
| #include "GlobalGameSettings.h" | ||
| #include "world/GameWorld.h" | ||
| #include <LeatherLoader.h> | ||
| #include <WineLoader.h> | ||
| #include <addons/Addon.h> | ||
|
|
||
| auto isUnusedBuilding(GamePlayer const& player) -> std::function<bool(BuildingType const& type)> | ||
| { | ||
| return [&player = player](BuildingType const& bld) { | ||
| if(!wineaddon::isAddonActive(player.GetGameWorld()) && wineaddon::isWineAddonBuildingType(bld)) | ||
| return true; | ||
| if(!player.GetGameWorld().GetGGS().isEnabled(AddonId::CHARBURNER) && bld == BuildingType::Charburner) | ||
| return true; | ||
| if(!leatheraddon::isAddonActive(player.GetGameWorld()) && leatheraddon::isLeatherAddonBuildingType(bld)) | ||
| return true; | ||
| return false; | ||
| }; | ||
| } | ||
|
|
||
| auto isUnusedWare(GamePlayer const& player) -> std::function<bool(GoodType const& type)> | ||
| { | ||
| return [&player = player](GoodType const& type) { | ||
| if(!wineaddon::isAddonActive(player.GetGameWorld()) && wineaddon::isWineAddonGoodType(type)) | ||
| return true; | ||
| if(!leatheraddon::isAddonActive(player.GetGameWorld()) && leatheraddon::isLeatherAddonGoodType(type)) | ||
| return true; | ||
| return false; | ||
| }; | ||
| } | ||
|
|
||
| auto isUnusedJob(GamePlayer const& player) -> std::function<bool(Job const& job)> | ||
| { | ||
| return [&](Job const& job) { | ||
| if(!wineaddon::isAddonActive(player.GetGameWorld()) && wineaddon::isWineAddonJobType(job)) | ||
| return true; | ||
| if(!player.GetGameWorld().GetGGS().isEnabled(AddonId::CHARBURNER) && job == Job::CharBurner) | ||
| return true; | ||
| if(!leatheraddon::isAddonActive(player.GetGameWorld()) && leatheraddon::isLeatherAddonJobType(job)) | ||
| return true; | ||
| return false; | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // Copyright (C) 2005 - 2025 Settlers Freaks (sf-team at siedler25.org) | ||
| // | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "GamePlayer.h" | ||
|
|
||
| auto isUnusedBuilding(GamePlayer const& player) -> std::function<bool(BuildingType const& type)>; | ||
| auto isUnusedWare(GamePlayer const& player) -> std::function<bool(GoodType const& type)>; | ||
| auto isUnusedJob(GamePlayer const& player) -> std::function<bool(Job const& job)>; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.