-
Notifications
You must be signed in to change notification settings - Fork 134
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 "reward maker" ext #1194
base: develop
Are you sure you want to change the base?
add "reward maker" ext #1194
Conversation
# Conflicts: # app/Helpers/AssetHelpers.php # resources/views/admin/prompts/create_edit_prompt.blade.php # resources/views/prompts/_prompt_entry.blade.php
…pr/rewardmaker-core # Conflicts: # app/Helpers/Helpers.php
Could the tables included in this to be swapped over to a responsive div format? |
i just woke up so i might be short a few braincells ahahaha but i'm not getting what you're meaning by this, could you explain? |
In your code I saw a block looking like this, in
A sort-of equivalent would be this, for example, from
Basically: Use bootstrap for the rows and columns. |
OH RIGHT yeah i can do that for sure! 🫡 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small review for now will look in more detail later
|
||
foreach ($rewards as $reward) { | ||
switch ($reward->object_type) { | ||
case 'Questline': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely don't include questlines in this in the final PR
case 'Questline': | ||
$objmodel = 'App\Models\Questline\Questline'; | ||
break; | ||
case 'Prompt': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also dont need to do this at all and can instead use an object relation on the ObjectReward model
* Get the object. | ||
*/ | ||
public function object() { | ||
return $this->morphTo(__FUNCTION__, 'object_type', 'object_id'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the purpose of the __FUNCTION__
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of having an object reward model why not just have the stored assets array?
public function rewards() { | ||
return $this->hasMany(PromptReward::class, 'prompt_id'); | ||
public function objectRewards() { | ||
return $this->hasMany('App\Models\ObjectReward', 'object_id')->where([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally this would use the ::class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is pulled from claymores, why not just pull the migration filename so that the migration errors dont happen?
it's basically an ext that allows for easier rewarding for loot like through prompts, also replaces the existing prompt reward system to streamline it
worth noting that this is a very VERY rough draft because i wanted to get feedback and see what the general opinion was-- it's a bit of mix of the old default char rewards PR + my reward maker ext (edited + added reward_key so a model can theoretically have multiple different "reward sets"
things i believe i will have to edit/add:
this was a suggestion i got so i'm definitely feeling like i may have fumbled along the way somewhere, but like i said-- just looking for proper feedback so i can see where to take all of this (do we even want to replace prompt rewards with this or think it's a good idea???????)