Skip to content

Commit

Permalink
final cleanup, day 4
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitmel committed Mar 12, 2022
1 parent 6b13a7e commit fd24af1
Show file tree
Hide file tree
Showing 21 changed files with 248 additions and 158 deletions.
7 changes: 4 additions & 3 deletions ccloader-ui.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ declare global {
}
}

interface CCLoaderVersionGuiMixin {
interface TitleScreenGui {
ccloaderVersionGui: sc.TextGui;
}
interface PauseScreenGui {
ccloaderVersionGui: sc.TextGui;
}
interface TitleScreenGui extends CCLoaderVersionGuiMixin {}
interface PauseScreenGui extends CCLoaderVersionGuiMixin {}
}
}
2 changes: 0 additions & 2 deletions crosscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ import './impact-class-system-correct';
import './impact-core';
import './crosscode-external-scripts';
import './modules/__all__';

import './unsorted-el-types';
1 change: 1 addition & 0 deletions modules/game.feature.achievements.stats-model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ declare global {
new (): StatsModel;
}
var StatsModel: StatsModelConstructor;
var stats: StatsModel;
}
}
2 changes: 1 addition & 1 deletion modules/game.feature.combat.combat-action-steps.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export {};

declare global {
namespace ig {
namespace EVENT_STEP {
namespace ACTION_STEP {
namespace SET_TEMP_TARGET {
interface Settings {
kind:
Expand Down
2 changes: 1 addition & 1 deletion modules/game.feature.combat.combat-shield.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ declare global {
interface CombatShield extends ig.Class {
isActive(
this: this,
combatant: sc.BasicCombatant,
combatant: sc.PlayerBaseEntity,
attackingEntity: sc.BasicCombatant.DamagingEntity,
attackInfo: sc.AttackInfo,
receivingPart: sc.BasicCombatant.DamagingEntity | null | undefined,
Expand Down
2 changes: 1 addition & 1 deletion modules/game.feature.combat.entities.food-icon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare global {
sprites: ig.CubeSprite[];
icon: number;

setState(this: this, state: sc.FOOD_ICON_STATE, offset: number): void;
setState(this: this, state: sc.FOOD_ICON_STATE, offset?: Vec2 | null): void;
updateSprites(this: this): void;
}
interface FoodIconEntityConstructor extends ImpactClass<FoodIconEntity> {
Expand Down
2 changes: 1 addition & 1 deletion modules/game.feature.combat.model.combat-status.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare global {
id: number;
statusBarEntry: string;
offenseModifier: string;
defenseModifier: string;
defenseModifier: keyof typeof sc.MODIFIERS;
effects: ig.EffectSheet;
duration: number;
charge: number;
Expand Down
5 changes: 4 additions & 1 deletion modules/game.feature.menu.gui.map.map-worldmap.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export {};

declare global {
namespace sc {
interface AreaButton extends ig.FocusGui {}
interface AreaButton extends ig.FocusGui {
key: string;
area: sc.MapModel.Area;
}
interface AreaButtonConstructor extends ImpactClass<AreaButton> {}
var AreaButton: AreaButtonConstructor;

Expand Down
2 changes: 1 addition & 1 deletion modules/game.feature.menu.gui.shop.shop-list.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ declare global {
sortType?: sc.SORT_TYPE | null,
): void;
scrapSellList(this: this, shopItems: sc.ItemID[]): void;
scrapBuyList(this: this, shopItems: sc.ShopModel.ShopItem[]): void;
scrapBuyList(this: this, shopItems: ig.Database.ShopItem[]): void;
}
interface ShopListMenuConstructor extends ImpactClass<ShopListMenu> {}
var ShopListMenu: ShopListMenuConstructor;
Expand Down
4 changes: 2 additions & 2 deletions modules/game.feature.menu.gui.shop.shop-misc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ declare global {
): number;
sortList(
this: this,
items: sc.ShopModel.ShopItem[],
items: ig.Database.ShopItem[],
sortType: sc.SORT_TYPE,
): sc.ShopModel.ShopItem[];
): ig.Database.ShopItem[];
}
var ShopHelper: ShopHelper;
}
Expand Down
17 changes: 4 additions & 13 deletions modules/game.feature.menu.gui.stats.stats-gui-builds.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,16 @@ declare global {
}

namespace Stats {
type StatItemType =
| 'Percent'
| 'Separator'
| 'Time'
| 'KeyValue'
| 'KeyCurMax'
| 'List'
| 'Logs';

interface StatItem {
type?: StatItemType;
subtype?: StatItemType;
type?: keyof typeof sc.STATS_ENTRY_TYPE;
subtype?: keyof typeof sc.STATS_ENTRY_TYPE;
displayName?: string;
highlight?: { min: number } | boolean;
group?: string;
stat?: string;
map?: string;
max?(): number;
getSettings?(a: string): StatItem | null;
max?: () => number;
getSettings?: (key: string) => StatItem | null;
}
}
var STATS_BUILD: Record<sc.STATS_CATEGORY, Record<string, Stats.StatItem>>;
Expand Down
40 changes: 40 additions & 0 deletions modules/game.feature.menu.gui.stats.stats-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,43 @@
// requires game.feature.menu.gui.stats.stats-gui-builds
// requires game.feature.menu.gui.stats.stats-misc
// requires game.feature.menu.gui.synop.synop-misc

export {};

declare global {
namespace sc {
interface StatsBaseEntryGui extends ig.GuiElementBase {}
interface StatsBaseEntryGuiConstructor extends ImpactClass<StatsBaseEntryGui> {}
var StatsBaseEntryGui: StatsBaseEntryGuiConstructor;

namespace STATS_ENTRY_TYPE {
interface Time extends sc.StatsBaseEntryGui {}
interface TimeConstructor extends ImpactClass<Time> {}
var Time: TimeConstructor;

interface Percent extends sc.StatsBaseEntryGui {}
interface PercentConstructor extends ImpactClass<Percent> {}
var Percent: PercentConstructor;

interface KeyValue extends sc.StatsBaseEntryGui {}
interface KeyValueConstructor extends ImpactClass<KeyValue> {}
var KeyValue: KeyValueConstructor;

interface KeyCurMax extends sc.StatsBaseEntryGui {}
interface KeyCurMaxConstructor extends ImpactClass<KeyCurMax> {}
var KeyCurMax: KeyCurMaxConstructor;

interface KeyValuePercent extends sc.StatsBaseEntryGui {}
interface KeyValuePercentConstructor extends ImpactClass<KeyValuePercent> {}
var KeyValuePercent: KeyValuePercentConstructor;

interface Separator extends sc.StatsBaseEntryGui {}
interface SeparatorConstructor extends ImpactClass<Separator> {}
var Separator: SeparatorConstructor;

interface Logs extends sc.StatsBaseEntryGui {}
interface LogsConstructor extends ImpactClass<Logs> {}
var Logs: LogsConstructor;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ declare global {
getConditionType(this: this): string;
}
interface StatusViewCombatArtsEntryConstructor extends ImpactClass<StatusViewCombatArtsEntry> {
new (artLevel: number, action: sc.PlayerAction): void;
new (artLevel: number, action: sc.PlayerAction): StatusViewCombatArtsEntry;
}
var StatusViewCombatArtsEntry: StatusViewCombatArtsEntryConstructor;
}
Expand Down
25 changes: 25 additions & 0 deletions modules/game.feature.player.player-model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ export {};

declare global {
namespace sc {
enum PLAYER_MSG {
ELEMENT_MODE_CHANGE = 1,
CREDIT_CHANGE = 2,
EXP_CHANGE = 3,
LEVEL_CHANGE = 4,
EQUIP_CHANGE = 5,
CP_CHANGE = 6,
SKILL_CHANGED = 7,
SKILL_BRANCH_SWAP = 8,
RESET_PLAYER = 9,
ITEM_OBTAINED = 10,
SET_PARAMS = 11,
CONFIG_CHANGED = 12,
ITEM_USED = 13,
STATS_CHANGED = 14,
ITEM_REMOVED = 15,
ITEM_BLOCK_FINISH = 16,
ITEM_FAVORITES_CHANGED = 17,
ITEM_EQUIP_UPDATE = 18,
ITEM_CONSUME_START = 19,
ITEM_CONSUME_END = 20,
CORE_CHANGED = 21,
ITEM_TOGGLED = 22,
}

enum PLAYER_CORE {
MOVE = 1,
CHARGE = 2,
Expand Down
15 changes: 9 additions & 6 deletions modules/game.feature.trade.gui.trade-icon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,25 @@ export {};

declare global {
namespace sc {
namespace TradeIconGui {
interface Entry {
require: sc.TradeItem[];
gui: sc.TextGui & { tradeName: string } & sc.TextGui.LevelDrawData;
}
}
interface TradeIconGui extends ig.BoxGui {
numberGfx: ig.Image;
tradeInfo: any; // TODO
tradeInfo: sc.TradeModel.Trader;
tradeIcon: unknown;
lineGui: ig.ColorGui;
entries: Array<{
require: any; // TODO
gui: sc.TextGui & { tradeName: string } & sc.TextGui.LevelDrawData;
}>;
entries: sc.TradeIconGui.Entry[];

setIconState(this: this, state: sc.INTERACT_ENTRY_STATE): void;
isActive(this: this, state: sc.INTERACT_ENTRY_STATE): boolean;
_createContent(this: this): void;
_createStatic(this: this): void;
_updateTexts(this: this): void;
_hasMissingItem(this: this, require: any): boolean | undefined;
_hasMissingItem(this: this, require: sc.TradeModel.TradeItem): boolean | undefined;
remove(this: this): void;
}
interface TradeIconGuiConstructor extends ImpactClass<TradeIconGui> {
Expand Down
24 changes: 23 additions & 1 deletion modules/game.feature.trade.trade-model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,32 @@ declare global {
area: ig.LangLabel;
time: number;
}

interface TradeItem {
id: sc.ItemID;
amount: number;
}

interface TradeOption {
get: TradeItem[];
require: TradeItem[];
scale?: number;
cost?: number;
}

interface Trader {
name: ig.LangLabel.Data;
order: number;
area: string;
noTrack?: boolean;
options: TradeOption[];
upgradeTo?: string;
child?: string;
}
}

interface TradeModel extends ig.GameAddon, sc.Model {
traders: Record<string, TradeModel.Trader>;
traders: Record<string, sc.TradeModel.Trader>;

getFoundTrader(this: this, key: string): sc.TradeModel.FoundTrader;
}
Expand Down
17 changes: 17 additions & 0 deletions modules/impact.base.animation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ declare global {
}
var AnimationState: AnimationStateConstructor;

// A virtual interface, common methods should go here.
interface BaseAnimationSet extends ig.Class {}

interface SingleDirAnimationSet extends ig.BaseAnimationSet {}
interface SingleDirAnimationSetConstructor extends ImpactClass<SingleDirAnimationSet> {}
var SingleDirAnimationSet: SingleDirAnimationSetConstructor;

interface MultiDirAnimationSet extends ig.BaseAnimationSet {}
interface MultiDirAnimationSetConstructor extends ImpactClass<MultiDirAnimationSet> {}
var MultiDirAnimationSet: MultiDirAnimationSetConstructor;

function getRoundedFaceDir(faceX: number, faceY: number, numDirs: number, dest: Vec2): Vec2;

interface AnimationSheet extends ig.JsonLoadable {
anims: Array<ig.MultiDirAnimationSet | ig.SingleDirAnimationSet>;
}
interface AnimationSheetConstructor extends ImpactClass<AnimationSheet> {}
var AnimationSheet: AnimationSheetConstructor;
}
}
23 changes: 22 additions & 1 deletion modules/impact.feature.database.database.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ declare global {
interface Data {
areas: { [name: string]: sc.MapModel.Area };
enemies: { [id: string]: EnemyData };
shops: { [id: string]: sc.ShopModel };
shops: { [id: string]: ShopData };
traders: { [id: string]: sc.TradeModel.Trader };
}

interface EnemyData {
Expand All @@ -24,6 +25,26 @@ declare global {
text: ig.LangLabel.Data;
condition?: string | null;
}

interface ShopData {
name: ig.LangLabel.Data;
shopType: keyof typeof sc.MENU_SHOP_TYPES;
sellScale: number;
maxOwn?: number;
content?: unknown[][];
pages: ShopPage[];
}

interface ShopPage {
title: ig.LangLabel.Data;
content: ShopItem[];
}

interface ShopItem {
item: sc.ItemID;
condition?: string;
price?: number;
}
}
interface Database extends ig.SingleLoadable {
data: ig.Database.Data;
Expand Down
Loading

0 comments on commit fd24af1

Please sign in to comment.