Skip to content

Commit

Permalink
Make the crosscode demo version compatible again
Browse files Browse the repository at this point in the history
  • Loading branch information
krypciak committed May 13, 2024
1 parent 63004a4 commit 4b2bcd6
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- Fixed aim analysis hint selection persisting when entering the quick menu
- Fixed hint selecting persisting after the upgrade field in Rhombus Dungeon was used
- Fixed sound selection persisting after switching categories in the Sound Glossary
- Made the demo version compatible again

## [0.6.0] 2024-04-20

Expand Down
6 changes: 3 additions & 3 deletions src/environment/interactables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class InteractableHandler {
/* in prestart */
SoundManager.continiousCleanupFilters.push('interact')
const self = this
ig.ENTITY.Chest.inject({
ig.ENTITY.Chest?.inject({
openUp() {
this.parent()
SoundManager.stopCondinious(self.getId(this))
Expand All @@ -47,10 +47,10 @@ export class InteractableHandler {
setState(state) {
this.parent(state)
if (this.entity instanceof ig.ENTITY.NPC && (this.entity.xenoDialog || this.entity.xenoDialogGui)) return
if (this.entity instanceof ig.ENTITY.Chest && this.entity.isOpen) return
if (ig.ENTITY.Chest && this.entity instanceof ig.ENTITY.Chest && this.entity.isOpen) return

/* this should be in init but if I do it in init then this.entity.propName is still uninitialized */
if (this.entity instanceof ig.ENTITY.Prop && HProp.getInteractLang(this.entity)) {
if (ig.ENTITY.Prop && this.entity instanceof ig.ENTITY.Prop && HProp.getInteractLang(this.entity)) {
const config = SoundManager.continious[self.getId(this.entity)]
if (config) {
if (!('paths' in config)) throw new Error('invalid pickContiniousSettingsPath settings: paths not included')
Expand Down
2 changes: 1 addition & 1 deletion src/hint-system/hints/chest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class HChest implements HintBase {
/* run in prestart */
HintSystem.customColors['Chests'] = sc.ANALYSIS_COLORS.GREEN
const self = this
ig.ENTITY.Chest.inject({
ig.ENTITY.Chest?.inject({
getQuickMenuSettings(): Omit<sc.QuickMenuTypesBaseSettings, 'entity'> {
return { type: 'Hints', hintName: self.entryName, hintType: 'Chests', disabled: !(Opts.hints && !this.isOpen) }
},
Expand Down
2 changes: 1 addition & 1 deletion src/hint-system/hints/prop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class HProp implements HintBase {
/* run in prestart */
const self = this

sc.PropInteract.inject({
sc.PropInteract?.inject({
init(prop, settings) {
this.parent(prop, settings)
this.iconType = settings.icon ?? 'INFO'
Expand Down
6 changes: 3 additions & 3 deletions src/hint-system/hints/rhombus-puzzle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class HOLPlatform implements HintBase {
constructor() {
/* run in prestart */
const self = this
ig.ENTITY.OLPlatform.inject({
ig.ENTITY.OLPlatform?.inject({
getQuickMenuSettings(): Omit<sc.QuickMenuTypesBaseSettings, 'entity'> {
return {
type: 'Hints',
Expand All @@ -41,7 +41,7 @@ export class HDynamicPlatform implements HintBase {
constructor() {
/* run in prestart */
const self = this
ig.ENTITY.DynamicPlatform.inject({
ig.ENTITY.DynamicPlatform?.inject({
getQuickMenuSettings(): Omit<sc.QuickMenuTypesBaseSettings, 'entity'> {
return {
type: 'Hints',
Expand Down Expand Up @@ -73,7 +73,7 @@ export class HBallChanger implements HintBase {
constructor() {
/* run in prestart */
const self = this
ig.ENTITY.BallChanger.inject({
ig.ENTITY.BallChanger?.inject({
init(x, y, z, settings) {
this.parent(x, y, z, settings)
this.settings = settings
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ export default class CrossedEyes implements PluginClass {
CrossedEyes.initPoststart.forEach(p => p())
await import('./misc/log-keybinding')

if (localStorage.getItem('crossedeyesDev') == 'true') TestMap.start()
if (!ig.isdemo && localStorage.getItem('crossedeyesDev') == 'true') TestMap.start()
}
}
4 changes: 3 additions & 1 deletion src/tts/gather/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ export class TextGather {
await import('./quick-menu')
await import('./save-menu')
await import('./tutorial-popup')
await import('./checkbox')

if (ig.isdemo) return
await import('./mod-manager')
await import('./equipment-menu')
await import('./checkbox')
await import('./inventory')
}
}

0 comments on commit 4b2bcd6

Please sign in to comment.