Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable inventory items without removing them from config. #38

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion economy.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ type EconomySystem interface {
RewardCreate() *EconomyConfigReward

// RewardConvert transforms a wire representation of a reward into an equivalent configuration representation.
RewardConvert(contents *AvailableRewardsContents) *EconomyConfigRewardContents
RewardConvert(contents *AvailableRewards) *EconomyConfigReward

// RewardRoll takes a reward configuration and rolls an actual reward from it, applying all appropriate rules.
RewardRoll(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, rewardConfig *EconomyConfigReward) (*Reward, error)
Expand Down
1 change: 1 addition & 0 deletions inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type InventoryConfigItem struct {
ConsumeReward *EconomyConfigReward `json:"consume_reward,omitempty"`
StringProperties map[string]string `json:"string_properties,omitempty"`
NumericProperties map[string]float64 `json:"numeric_properties,omitempty"`
Disabled bool `json:"disabled,omitempty"`
}

// The InventorySystem provides a gameplay system which can manage a player's inventory.
Expand Down
3 changes: 3 additions & 0 deletions schemas/07-Hiro-Inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
}
},
"type": "object"
},
"disabled": {
"type": "boolean"
}
},
"required": [
Expand Down
Loading