Skip to content

Commit

Permalink
Merge pull request #66 from scardwell15/activators
Browse files Browse the repository at this point in the history
added activators to magiclib
  • Loading branch information
wispborne authored Feb 22, 2024
2 parents 2d9ce44 + d7001f2 commit 538182c
Show file tree
Hide file tree
Showing 30 changed files with 4,755 additions and 89 deletions.
Binary file added GitHub-Actions-Starsector.zip
Binary file not shown.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# README

The goal of MagicLib is to create a community-built library of useful (and well documented) scripts and plugins that can be leveraged and contributed to by every modder.
The goal of MagicLib is to create a community-built library of useful (and well documented) scripts and plugins that can
be leveraged and contributed to by every modder.

To get your stuff added to MagicLib, please contact Wisp

Expand All @@ -13,4 +14,19 @@ https://fractalsoftworks.com/forum/index.php?topic=25868.0
All contributions must be fully documented on the Wiki and given proper Javadocs:
https://starsector.wikia.com/wiki/MagicLib

View the Javadoc: https://magiclibstarsector.github.io/MagicLib/
View the Javadoc: https://magiclibstarsector.github.io/MagicLib/

## Combat Activators to MagicSubsystems Migration Guide

- Rename from Activators to MagicSubsystems.
- Change your imports from `activators` to `org.magiclib.subsystems`.
- Change `ActivatorManager` to `MagicSubsystemsManager`.
- Change `CombatActivator` to `MagicSubsystem`.
- (etc)
- `advance(float amount)` and `advanceEveryFrame()` are now a single method, `advance(float amount, boolean isPaused)`.
- All logic that was in `advanceEveryFrame` before should move to `advance`, which is now called even when paused.
- All logic that was in `advance` before should have `if (!isPaused)` added around it.
- `ActivatorManager.addActivator` has been renamed to `MagicSubsystemsManager.addSubsystemToShip`.
- Same with similar methods.

Bonus: Kotlin extension methods for adding/removing subsystems have been added on `ShipAPI`.
17 changes: 16 additions & 1 deletion data/config/LunaSettings.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,19 @@ fieldID,fieldName,fieldType,defaultValue,secondaryValue,fieldDescription,minValu
# MagicLib: toggle achievements
magiclib_enableAchievements,Enable Achievements,Boolean,true,,"Disabling achievements will not affect progress.",,,
magiclib_enablePaintjobs,Enable Paintjobs,Boolean,true,,"Disabling paintjobs will not affect unlocks.",,,
magiclib_enableBountyDeadlines,Enable Bounty Deadlines,Boolean,false,,"Enabling will cause bounties to have a deadline. After the deadline, the bounty will expire.",,,
magiclib_enableBountyDeadlines,Enable Bounty Deadlines,Boolean,false,,"Enabling will cause bounties to have a deadline. After the deadline, the bounty will expire.",,,

# MagicSubsystems
magiclib_subsystems_Header,MagicSubsystems,Header,Subsystems,,,,,
magiclib_subsystems_showInfoDefault,Show Extra Info,Boolean,true,,"Whether extra info will be displayed on the Subsystems widget when combat starts.",,,
# MagicSubsystems: UI settings
magiclib_subsystems_widgetOffsetX,Widget Offset - X,Int,0,,,,,
magiclib_subsystems_widgetOffsetY,Widget Offset - Y,Int,0,,,,,
# MagicSubsystems: Key indexes
magiclib_subsystems_InfoKeyBind,Info Keybind,Keycode,23,,"Keybind for viewing subsystem info in combat.",,,
magiclib_subsystems_KeyBindText,Description,Text,"Keybinds for subsystems. They are used in order. If any are empty they will be ignored and the next available keybind will be used.",,,,,
magiclib_subsystems_KeyBind1,Keybind 1,Keycode,56,,"First assigned keybind",,,
magiclib_subsystems_KeyBind2,Keybind 2,Keycode,46,,"Second assigned keybind",,,
magiclib_subsystems_KeyBind3,Keybind 3,Keycode,35,,"Third assigned keybind",,,
magiclib_subsystems_KeyBind4,Keybind 4,Keycode,36,,"Fourth assigned keybind",,,
magiclib_subsystems_KeyBind5,Keybind 5,Keycode,49,,"Fifth assigned keybind",,,
7 changes: 7 additions & 0 deletions data/config/modSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@
# Bounty provider classes for the Bounty Board.
"bountyProviders": [
"org.magiclib.bounty.intel.MagicBountyBoardProvider"
],

"subsystemInfoKey": "I",
"subsystemKeys": [
"T",
"G",
"H"
]
},
}
6 changes: 5 additions & 1 deletion data/config/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
"MagicTrailPlugin": "org.magiclib.plugins.MagicTrailPlugin",
"MagicAutoTrails": "org.magiclib.plugins.MagicAutoTrails",
"MagicAchievementCombatScript": "org.magiclib.achievements.MagicAchievementCombatScript",
"MagicSubsystemsCombatPlugin":"org.magiclib.subsystems.MagicSubsystemsCombatPlugin",

"old_ML_fakeBeamPlugin": "data.scripts.plugins.MagicFakeBeamPlugin",
"old_ML_spriteRenderManager": "data.scripts.plugins.MagicRenderPlugin",
"old_MagicCampaignTrailPlugin": "data.scripts.plugins.MagicCampaignTrailPlugin",
"old_MagicTrailPlugin": "data.scripts.plugins.MagicTrailPlugin",
"old_MagicAutoTrails": "data.scripts.plugins.MagicAutoTrails",
"old_MagicAutoTrails": "data.scripts.plugins.MagicAutoTrails"
#"MagicModuleRetreatFix":"org.magiclib.plugins.MagicModuleRetreatCleaner",
#"MagicNebula":"org.magiclib.plugins.MagicNebula",
},
Expand Down Expand Up @@ -48,6 +49,9 @@
"achievement_orange": "graphics/magic/icons/achievement_orange2.png",
"magicPaintjobs": "graphics/magic/hullmods/paintjob.png",
"magicLibIcon": "graphics/magic/icons/magicLibIcon.png",
},
"ui": {
"ship_arrow": "graphics/warroom/ship_arrow.png"
}
},
"ruleCommandPackages": [
Expand Down
20 changes: 20 additions & 0 deletions data/strings/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,5 +304,25 @@
"ml_mp_permanentTooltipRefit":"This paintjob is permanent and cannot be changed.",
"ml_mp_shiny":"This is a rare paintjob.",
"ml_mp_appliedRefit":"Applied: %s",

"subsystemTitleText": "SUBSYSTEMS",
"subsystemMoreInfoText": "PRESS %s FOR MORE INFO",
"subsystemLessInfoText": "PRESS %s FOR LESS INFO",
"subsystemHotkeyText": "HOTKEY: %s",
"subsystemHotkeyAutomaticText": "AUTOMATIC",
"subsystemBriefText": "BRIEF: %s",
"subsystemChargesText": "CHARGES: %s",
"subsystemDroneForgeText": "FORGE: %s",
"subsystemDroneForgeNoChargesText": "FORGE",
"subsystemDroneReservesFullText": "MAX",
"subsystemDroneCountText": "x%s",
"subsystemState_Ready": "READY",
"subsystemState_In": "ACTIVE",
"subsystemState_Active": "ACTIVE",
"subsystemState_Out": "ACTIVE",
"subsystemState_Cooldown": "",
"subsystemState_OutOfRange": "OUT OF RANGE",
"subsystemState_NoTarget": "NO TARGET",
"subsystemState_FluxCapped": "FLUX TOO HIGH",
}
}
Binary file modified jars/MagicLib-Kotlin.jar
Binary file not shown.
Binary file modified jars/MagicLib.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions magiclib.version
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"modVersion":
{
"major": "1",
"minor": "3",
"patch": "11"
"minor": "4",
"patch": "0"
}
}
2 changes: 1 addition & 1 deletion mod_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "Modding Community: Dark.Revenant, LazyWizard, Nicke, Originem, Rubi, Schaf-Unschaf, Snrasha, Tartiflette, Wisp, Wyvern...",
"utility": "true",
# Using the long version format lets the game correctly compare major/minor/patch versions.
"version": { "major": '1', "minor": '3', "patch": '11' },
"version": { "major": '1', "minor": '4', "patch": '0' },
"description": "A collection of classes to aid modding. Not a mod in itself, but required by other mods.",
"gameVersion": "0.97a-RC6",
"dependencies": [
Expand Down
3 changes: 3 additions & 0 deletions src/org/magiclib/LunaWrapper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ object LunaWrapper {

@JvmStatic
fun getBoolean(modID: String, fieldID: String): Boolean? = LunaSettings.getBoolean(modID, fieldID)

@JvmStatic
fun getInt(modID: String, fieldID: String): Int? = LunaSettings.getInt(modID, fieldID)
}

interface LunaWrapperSettingsListener {
Expand Down
3 changes: 3 additions & 0 deletions src/org/magiclib/Magic_modPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.lwjgl.util.vector.Vector2f;
import org.magiclib.achievements.MagicAchievementManager;
import org.magiclib.achievements.TestingAchievementSpec;
import org.magiclib.subsystems.MagicSubsystemsManager;
import org.magiclib.bounty.*;
import org.magiclib.kotlin.MagicKotlinModPlugin;
import org.magiclib.paintjobs.MagicPaintjobManager;
Expand Down Expand Up @@ -72,6 +73,8 @@ public void onApplicationLoad() throws ClassNotFoundException {

MagicAchievementManager.getInstance();
MagicAchievementManager.getInstance().onApplicationLoad();

MagicSubsystemsManager.initialize();
}

@Override
Expand Down
Loading

0 comments on commit 538182c

Please sign in to comment.