Skip to content

Commit

Permalink
1.3.0: Prepare project to go open source
Browse files Browse the repository at this point in the history
- Add MIT License.
- Change notes.md to README.md and make it more descriptive.
- Extract todos into TODO.md.
- Add .csproj to .gitignore, since it contains computer-specific
  information that is likely not helpful for others.
- Minor code cleanup: mainly replacing "VM" with "ViewModel".
- Re-arranging repo structure for clarity (putting additional things
  into /src/).
  • Loading branch information
amterp committed Apr 17, 2021
1 parent 71c75a7 commit b59c41e
Show file tree
Hide file tree
Showing 27 changed files with 159 additions and 397 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,7 @@ healthchecksdb
MigrationBackup/

# End of https://www.gitignore.io/api/visualstudio

# Additional for ArmyArrowCounter

**/*.csproj
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Alexander Terp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Army Arrow Counter

## Overview

This is the repo for a [Mount & Blade II: Bannerlord](https://store.steampowered.com/app/261550/Mount__Blade_II_Bannerlord/) mod named Army Arrow Counter. It's a simple utility mod which counts the amount of ammunition your army has remaining, updating a small UI counter element in the bottom left of the screen (example below). The mod is hosted and downloadable on Nexus Mods [here](https://www.nexusmods.com/mountandblade2bannerlord/mods/448), with over 10,000 downloads!
More about the mod and its gameplay effects/options can be read on the Nexus page - this repo focuses more on the development side.

<img src="repo-images/exact-fraction-example.PNG" alt="ui-example" width="250"/>

## Repository Structure

- When packaged, ArmyArrowCounter (AAC) has the following structure:
- `bin`
- `Win64_Shipping_Client`
- Contains all the DLL(s) for the mod.
- Is not located in this repo - these are generated when the project is built.
- `config`
- Contains custom AAC config.
- This corresponds exactly to the `/src/config` folder in this repository.
- `GUI`
- Contains Bannerlord xml files configuring the presence/positions/formatting, etc of the UI counter.
- This corresponds exactly to the `/src/GUI` folder in this repository.
- `SubModule.xml`
- Contains AAC mod/module metadata for Bannerlord to process.
- This corresponds exactly to the `/src/SubModule.xml` file in this repository.
- `/src/` (unsurprisingly) contains the source code, along with the above-mentioned folders/files.

## Contributions

### Issues / Bug Reports

These are more than welcome! I monitor both the Nexus "Bugs" and "Posts" tabs, but I am also happy to receive reports here on Github.

### Bug Fixes / Feature Implementations / Pull Requests

Happy to receive these as well! I apologize in advance for when you dive into the code - I am not a C# developer, so it's very likely that I am breaking a bunch of rules/conventions of C# and misusing features - I'd be ecstatic for these cases to be pointed out and corrected!
About pull-requests, I may ask questions around the in-game testing that has been done, and I may request code style/design changes if deemed necessary. For features which I have not endorsed, it's likely a good idea to contact me first before implementing them, to avoid any denials/reworks!
13 changes: 13 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Todo List

- Optionally support ModLib/OptionScreen/whatever is standard to provide in-game settings, instead of the `config.xml` file.
- Add toggle hotkey.
- Count only solders under your command (?)
- Add unit tests.
- Put tasks in this list into Github issues.

## Bug List

- Fix bug: Fleeing allies in hideouts don't subtract arrows when removed.
- Lost sieges sometimes end with non-0/0 counts?
- Team-killing an archer does not appear to get counted correctly.
57 changes: 0 additions & 57 deletions notes.md

This file was deleted.

Binary file added repo-images/exact-fraction-example.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 6 additions & 7 deletions src/ArmyArrowCounter/AacMissionBehavior.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using TaleWorlds.Core;
using System;
using TaleWorlds.Core;
using TaleWorlds.Library;
using TaleWorlds.MountAndBlade;
using System;

namespace ArmyArrowCounter
{
Expand All @@ -23,13 +23,12 @@ class AacMissionBehavior : MissionBehaviour
private ArrowCounter ArrowCounter;
private ArrowRecountTriggerer ArrowRecountTriggerer;
private AacUiApplier AacUiApplier;
//private EventLogger EventLogger;

public AacMissionBehavior() {
public AacMissionBehavior()
{
ArrowCounter = new ArrowCounter(this);
ArrowRecountTriggerer = new ArrowRecountTriggerer(this, ArrowCounter);
AacUiApplier = new AacUiApplier(this, AacVmFactory.Create(ArrowCounter));
//EventLogger = new EventLogger(this, ArrowCounter);
AacUiApplier = new AacUiApplier(this, AacViewModelFactory.Create(ArrowCounter));
}

public override MissionBehaviourType BehaviourType => MissionBehaviourType.Other;
Expand Down Expand Up @@ -125,7 +124,7 @@ public override void OnAgentShootMissile(Agent shooterAgent, EquipmentIndex weap
public override void OnItemPickup(Agent agent, SpawnedItemEntity item)
{
base.OnItemPickup(agent, item);

if (!IsActivated)
{
return;
Expand Down
7 changes: 1 addition & 6 deletions src/ArmyArrowCounter/AacUiApplier.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaleWorlds.Engine.GauntletUI;
using TaleWorlds.Engine.Screens;
using TaleWorlds.Engine.GauntletUI;
using TaleWorlds.Library;

namespace ArmyArrowCounter
Expand Down
Loading

0 comments on commit b59c41e

Please sign in to comment.