Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #21  
Old 02-05-2016, 04:58 PM
tahbikat's Avatar
tahbikat tahbikat is offline
Member
 
Join Date: Feb 2014
Location: Louisiana
Posts: 408
Gender: Female
Credits: 57,663
tahbikat is on a distinguished road
Default

@Ittermat In class_itemshop.php, you basically replace the whole public function display section. Clicking the first opening bracket next to 'public function display' should also highlight the closing bracket. So you take everything inside that, erase it, and replace with new code. Make sure to save your original code first.
Reply With Quote
  #22  
Old 02-05-2016, 04:59 PM
Ittermat's Avatar
Ittermat Ittermat is offline
The awesomesauce
 
Join Date: Feb 2016
Location: in front of my laptop
Posts: 272
Gender: Female
Credits: 38,508
Ittermat is on a distinguished road
Default

Okay so...Can we make this a bit easier?

We start at public display- and end at? where? XD
Reply With Quote
  #23  
Old 02-05-2016, 06:53 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 110,884
Kyttias is on a distinguished road
Default

End at the end of the display function. Brackets always line up. You'll have to see where that function ends. In a text editor meant for code, such as Sublime Text 2 or Notepad++, syntax highlighting will help you recognize where code ends and begins, and as Tahbikat said, if you click on a bracket, the closing bracket will highlight itself, showing where it ends.

Anyway, obviously one function must end before the next begins. Just look for the start of the next one?
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #24  
Old 02-05-2016, 07:08 PM
Ittermat's Avatar
Ittermat Ittermat is offline
The awesomesauce
 
Join Date: Feb 2016
Location: in front of my laptop
Posts: 272
Gender: Female
Credits: 38,508
Ittermat is on a distinguished road
Default

ohhh!! OKAY! See I didnt know that small bit of info... actually that will help alot and puts a main puzzle piece in place! thank you!
Reply With Quote
  #25  
Old 02-14-2016, 12:35 PM
Corsair's Avatar
Corsair Corsair is offline
Member
 
Join Date: Jan 2012
Posts: 128
Gender: Female
Credits: 13,300
Corsair is on a distinguished road
Default

For some reason tool tips will not work (in shop or inventory) even after following all the steps. I'm not sure if it's because I'm using the bookstore theme. I double checked the tootip.css, tooltip.js and the header file.
Reply With Quote
  #26  
Old 02-14-2016, 01:04 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 110,884
Kyttias is on a distinguished road
Default

Does that theme have jQuery? If not, include a link to the jQuery library. For the tooltips to work, its .js file must come after jQuery, as it is dependant on it. Keep in mind that this may break your profile pages since they come with their own link to jQuery and having two links to different versions will cause errors on that page!

This should have been covered in section 2, in the third code block.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 02-14-2016 at 02:35 PM.
Reply With Quote
  #27  
Old 02-14-2016, 04:24 PM
Corsair's Avatar
Corsair Corsair is offline
Member
 
Join Date: Jan 2012
Posts: 128
Gender: Female
Credits: 13,300
Corsair is on a distinguished road
Default

I did follow that part as well but no luck. So I thought i'd ask just in case. I'm going to go over it a third time to see if I missed something.

Last edited by Corsair; 02-14-2016 at 04:27 PM.
Reply With Quote
  #28  
Old 02-15-2016, 01:31 AM
Corsair's Avatar
Corsair Corsair is offline
Member
 
Join Date: Jan 2012
Posts: 128
Gender: Female
Credits: 13,300
Corsair is on a distinguished road
Default

Unrelated to my last post but I'm having a issue with key items being able to be sold in the inventory.

I saw:
Quote:
if($item->category !== "Key Items") {
So I assumed if the category was "Key Items" that would fix it but I got a error.
Quote:
Catchable fatal error: Argument 1 passed to GUIContainer::add() must be an instance of GUIComponent, null given, called in /home/monstari/public_html/view/inventoryview.php on line 72 and defined in /home/monstari/public_html/classes/class_guicontainer.php on line 361
I tried to I tried to figure it out but I am stumped. I am not to far along my php studies so maybe the fix is right in front of my face but I can't see it.
Reply With Quote
  #29  
Old 02-15-2016, 05:31 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 110,884
Kyttias is on a distinguished road
Default

About the Inventory - you're absolutely right, although... I was going off of existing code in class_itemtablehelper.php, which used if($item->category == "Key Items") return "N/A"; . . . . obviously, yeah, that'd only take effect if the item's category was "Key Items".

It'd probably be better to check for $item->function.

I updated the chunk of code above, but also here -
PHP Code:
    public function index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$document->setTitle($mysidia->lang->inventory);
        
        
$inventory $this->getField("inventory");
        
        
$document->add(new Comment(" <style>
                .sc_item {
                  display: inline-table;
                  padding: 5px;
                  text-align: center;
                  font-family: 'Trebuchet MS', Helvetica, sans-serif;
                  font-size: 14px;
                  margin-bottom: 3px;
                  width: 120px;
                }
                .s_panel {
                  border-radius: 2px;
                  border: 1px solid #CCC;
                  background-color: #FBFDF2;  
                }
            </style> "
FALSE));
        
$iids $inventory->getiids();
        for(
$i 0$i $iids->length(); $i++){
            
$item $inventory->getitem($iids[$i]);
                 
            
# Descriptions of the item functions
            
switch ($item->function) {
                case 
"Click1"$usage "<br/><b>use:</b> Feed a pet to give them {$item->value} EXP."; break;
                case 
"Click2"$usage "<br/><b>use:</b> Feed a pet to set their EXP to {$item->value}."; break;
                case 
"Click3"$usage "<br/><b>use:</b> Resets EXP earned today to 0."; break;
                case 
"Level1"$usage "<br/><b>use:</b> Raises the Level of your pet by {$item->value}."; break;
                case 
"Level2"$usage "<br/><b>use:</b> Sets the Level of your pet to {$item->value}."; break;
                case 
"Level3"$usage "<br/><b>use:</b> Makes your pet Level 0 again!"; break;
                case 
"Gender"$usage "<br/><b>use:</b> Swaps the gender of your pet to its opposite!"; break;            
                default;
                    
$usage ""; break;
            }  
# End item function descriptions        

            
            # Rendering items now
            
$document->add(new Comment("
            <div class=\"s_panel sc_item\">
            <img rel=\"tooltip\" title=\"
{$item->description} <em>{$usage}</em>\" src=\"{$item->imageurl}\"/><br/>
              <b>
{$item->itemname}</b><br> Own &times;{$item->quantity}<br/>"FALSE));

            
# If item is consumable, add use button
            
if($item->consumable == "yes") {
                
$useForm = new FormBuilder("useform""inventory/uses""post");
                
$useForm->setLineBreak(FALSE);
                
$useForm->buildPasswordField("hidden""action""uses")
                        ->
buildPasswordField("hidden""itemname"$item->itemname)
                        ->
buildButton("Use""use""use");
                
$document->add($useForm);
            }

            
# Add sellback button so long as the item is not a key item
            
$sellback $item->price 2;
            
$document->add(new Comment("<hr>{$sellback} {$mysidia->settings->cost} Each "FALSE));
            if(
$item->function !== "Key") {
                
$sellForm = new FormBuilder("sellform""inventory/sell""post");
                
$sellForm->setLineBreak(FALSE);
                
$sellForm->buildPasswordField("hidden""action""sell")
                         ->
buildPasswordField("hidden""itemname"$item->itemname);
                
                
$quantity = new TextField("quantity");
                
$quantity->setSize(3);
                
$quantity->setMaxLength(3);
                
$quantity->setLineBreak(FALSE);

                
$sell = new Button("Sell""sell""sell");
                
$sell->setLineBreak(FALSE);

                
$sellForm->add($quantity);
                
$sellForm->add($sell);
            }    
            
$document->add($sellForm);
            
$document->add(new Comment("</div>"FALSE));   

        } 
# END item for loop

    
# END index function 
If the problem persists, perhaps try changing it to "!=" instead of "!==".

Anyway, do the tooltips work on the Inventory, but not elsewhere? Do any of your item names or descriptions happen to have apostrophes or quotations in them (this might be relevant and would be good to know, I thought I'd caught all of this).
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #30  
Old 02-15-2016, 11:11 AM
Corsair's Avatar
Corsair Corsair is offline
Member
 
Join Date: Jan 2012
Posts: 128
Gender: Female
Credits: 13,300
Corsair is on a distinguished road
Default

I seem to be getting the same error even after changing the !== to !=

Quote:
Catchable fatal error: Argument 1 passed to GUIContainer::add() must be an instance of GUIComponent, null given, called in /home/monstari/public_html/view/inventoryview.php on line 72 and defined in /home/monstari/public_html/classes/class_guicontainer.php on line 361
As for tooltips they do show up in both shops and the inventory but as plan boxes. I did move the CSS to the main theme but I don't think that's it either.



I'm not sure if it's related but I've been noticing errors with drop downs and radio buttons related to this GUIContainer even in the admin panel where I have your bootstrap theme installed.
Reply With Quote
Reply

Tags
item display, item shop, npc, shop, shopkeeper


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mys v1.3.4 Shop Listing Display Kyttias Mys v1.3.x Mods 13 06-13-2016 03:31 PM
Item Bug? tahbikat Questions and Supports 4 11-24-2015 06:28 PM
Changing Shop and Item Display? Abronsyth Questions and Supports 2 12-16-2014 04:25 PM
Buy X of Item A to receive X of Item B AndromedaKerova Suggestions and Feature Requests 0 11-09-2014 09:17 PM


All times are GMT -5. The time now is 10:29 AM.

Currently Active Users: 639 (0 members and 639 guests)
Threads: 4,081, Posts: 32,031, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636