Skip to content

Commit

Permalink
updated to now support CCUILib, updated TS compiler/build options for…
Browse files Browse the repository at this point in the history
… release, v0.7.3
  • Loading branch information
elluminance committed Jan 20, 2024
1 parent bdb73f3 commit 76687b9
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Contains additions/fixes that are helpful to both normal players and modders ali

***Note: Support will not be provided unless you are using the [latest release](https://github.com/EL20202/el-crosscode-tweaks/releases/latest).***

*Readme is guaranteed accurate up to version 0.7.0. See changelog for more details.*
*Readme is guaranteed accurate up to version 0.7.3. See changelog for more details.*

 

Expand Down Expand Up @@ -85,7 +85,7 @@ Makes it so you cannot wear any equipment. Can you beat the game *naked*?

An item spawn menu, allowing you to add any item in the game to your inventory.

Item search functionality requires [CCInventorySearch](https://github.com/conorlawton/CCInventorySearch) (or any other mod adding the text input element) to be installed.
Item search functionality requires [CCUILib](https://github.com/conorlawton/CCUILib) to be installed.

## Uncapped Stats
*Before*
Expand Down
2 changes: 1 addition & 1 deletion ccmod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "el-tweaks",
"version": "0.7.2",
"version": "0.7.3",

"title": "EL's Tweaks",
"description": "A coremod full of useful functionality for modders, as well as many tweaks for players.",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "el-tweaks",
"displayName": "EL's Tweaks",
"version": "0.7.2",
"version": "0.7.3",
"description": "A coremod full of useful functionality for modders, as well as many tweaks for players.",

"plugin": "./dist/plugin.js",
Expand All @@ -15,6 +15,6 @@
"scripts": {
"build": "tsc --build",
"watch": "tsc --watch",
"make-ccmod": "tsc -b && zip -qr els-tweaks.ccmod ccmod.json package.json dist assets"
"make-ccmod": "tsc -b ./tsconfig.release.json && zip -qr els-tweaks.ccmod ccmod.json package.json dist assets"
}
}
18 changes: 15 additions & 3 deletions src/headers/other-mods.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
declare namespace ig {
/*
* While this is disingenuous of the input field's type...
* The point is not to make it accurate.
* It's to make it provide a minimum needed interface for the item spawner.
*
*/
namespace GuiTextInputField {
interface InputFieldType {}
}
interface GuiTextInputField extends ig.FocusGui {
onCharacterInput(): void;
onCharacterInput: () => void;
getValueAsString(this: this): string;
}
interface GuiTextInputFieldConstructor extends ImpactClass<GuiTextInputField> {
new (width: number, height: number, inputField_type?: GuiTextInputField.InputFieldType): ig.GuiTextInputField
new (width: number, height: number): GuiTextInputField
}
var GuiTextInputField: GuiTextInputFieldConstructor
var GuiTextInputField: GuiTextInputFieldConstructor | undefined;
}

declare namespace nax.ccuilib {
type InputField = ig.GuiTextInputField;
type InputFieldConstructor = ig.GuiTextInputFieldConstructor;
let InputField: InputFieldConstructor | undefined;
}
9 changes: 5 additions & 4 deletions src/prestart/menu/item-spawner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ function itemTypeToIndex(item: sc.Inventory.Item) {
//@ts-expect-error
sc.SORT_TYPE.ITEM_ID = 22135;



el.ItemSpawnerGui = sc.ModalButtonInteract.extend({
transitions: {
DEFAULT: {
Expand Down Expand Up @@ -124,7 +122,10 @@ el.ItemSpawnerGui = sc.ModalButtonInteract.extend({
//#region Filtering
this.filterButtongroup = new sc.ButtonGroup;

if(ig.GuiTextInputField) {

let textInput = nax.ccuilib.InputField || ig.GuiTextInputField;

if(textInput) {
this.searchActive = true;

this.searchText = new sc.TextGui(ig.lang.get("sc.gui.menu.elItemSpawner.search"), {
Expand All @@ -139,7 +140,7 @@ el.ItemSpawnerGui = sc.ModalButtonInteract.extend({
this.filterGui.addChildGui(line);
yOffset += 3;

this.inputField = new ig.GuiTextInputField(lineWidth, 20);
this.inputField = new textInput(lineWidth, 20);
this.inputField!.onCharacterInput = () => {
this._createList();
}
Expand Down
8 changes: 8 additions & 0 deletions tsconfig.release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"incremental": false,
"inlineSourceMap": false,
"inlineSources": false,
}
}

0 comments on commit 76687b9

Please sign in to comment.