-
Posts
2,392 -
Joined
-
Last visited
-
Days Won
62
Content Type
Profiles
Forums
Events
Everything posted by Sim
-
I'm aware of that hook. To alter the template with this simple modification, I'm having to check if traveled, why the global $traveled is in the userAction hook. Problem with what you mentioned is $traveled is never true in the template hooks. But no one should have to do this. As @Dayo stated something such as $page->alert("type", "text") should be included. Hooks are to to supposed to be make things simplier for the developer to.
-
It's alot easier to upload a folder, and if anyone has altered there travel page, no one has to do any editing.
-
new Hook("userAction", function ($action) { global $user, $db, $html, $page; global $traveled; $traveled = false; $dropPerc = 50; $dropReward = 2; //$rewardType = "money"; $rewardType = "points"; //$rewardType = "bullets"; if($action["module"] == "travel") { if($action["success"]) { $rand = mt_rand(1,100); if($dropPerc > $rand) { $traveled = true; // var_dump($page); debug(var_dump($html)); debug($dropReward . " " . $rewardType); } debug($action); } } }); So here's the main problem with the hooks system. Altering or displaying extra information into the template or page is not that simple. Adding any of these variations will not work, but should work $page->buildElement('info', array("text" => "You found " . $dropReward . " " . $rewardType . " during your travels")); Or $html .= $page->buildElement('info', array("text" => "You found " . $dropReward . " " . $rewardType . " during your travels")); The first spent even add the display message. The $html .= Displays the message before the whole template as the HTML is empty when the action hook is called. The purpose of this Mod was to reward players for traveling more, but displaying a message when rewarded for traveling is nearly impossible (and just not worth it).
-
I created school system. It is in marketplace.
-
With jQuery being so popular now-a-days, maybe add it as an option in json file to include?
-
Forgetting a script tag is definitely a first.
-
<table id="game"> <link href="DailyPlanner.css" rel="stylesheet" /> <body> <tr id="8" onclick="myFunction(this.id)"> <th>08:00</th> <td colspan="4" rowspan="2" class="stage-saturn">Welcome</td> </tr> <tr id="830" onclick="myFunction(this.id)"> <th>08:30</th> </tr> <tr id="9" onclick="myFunction(this.id)"> <th>09:00</th> <td id="9text" colspan="4" class="stage-earth">Speaker One <span>Earth Stage</span></td> </tr> <tr id="930" onclick="myFunction(this.id)">" > <th>09:30</th> <td id="930text" colspan="4" class="stage-earth">Speaker Two <span>Earth Stage</span></td> </tr> <tr id="10" onclick="myFunction(this.id)"> <th>10:00</th> <td colspan="4" class="stage-earth">Speaker Three <span>Earth Stage</span></td> </tr> <tr id="1030" onclick="myFunction(this.id)"> <th>10:30</th> <td colspan="4" class="stage-earth">Speaker Four <span>Earth Stage</span></td> </tr> <tr id="11"> <th>11:00</th> <td rowspan="5" class="stage-mercury">Speaker Five <span>Mercury Stage</span></td> <td rowspan="5" class="stage-venus">Speaker Six <span>Venus Stage</span></td> <td rowspan="5" class="stage-mars">Speaker Seven <span>Mars Stage</span></td> <td rowspan="2" class="stage-saturn">Lunch</td> </tr> <tr id="1130"> <th>11:30</th> </tr> <tr id="12"> <th>12:00</th> <td rowspan="3" class="stage-saturn">Break</td> </tr> <tr id="1230"> <th>12:30</th> </tr> <tr> <tr id="1"> <th>1</th> <td colspan="4" rowspan="2" class="stage-earth">Speaker Eight <span>Earth Stage</span></td> </tr> <tr id="2"> <th>2:00</th> </tr> <tr> <th>2:30</th> <tr> <th>3:00</th> </tr> <tr> <th>3:30</th> </tr> <tr> <th>4</th> </tr> <tr> <th>4:30</th> </tr> <tr> <th>5:00</th> </tr> <tr> <th>5:30</th> </tr> <tr> <th>6:00</th> </tr> <tr> <th>6:30</th> <td colspan="4" class="stage-earth">Speaker Nine <span>Earth Stage</span></td> </tr> <tr> <th>7:00</th> <td colspan="2" rowspan="2" class="stage-earth">Speaker Ten <span>Earth Stage</span></td> <td colspan="2" rowspan="2" class="stage-jupiter">Speaker Eleven <span>Jupiter Stage</span></td> </tr> <tr> <th>7:30</th> </tr> <tr> <th>20:00</th> <td colspan="2" class="stage-mars">Speaker Twelve <span>Mars Stage</span></td> <td class="stage-jupiter">Speaker Thirteen <span>Jupiter Stage</span></td> <td class="stage-jupiter">Speaker Fourteen <span>Jupiter Stage</span></td> </tr> <tr> <th>20:30</th> <td colspan="4" rowspan="2" class="stage-saturn">Drinks</td> </tr> <tr> <th>21:00</th> </tr> </body> $( function() { $( "#dialog" ).dialog({ autoOpen: false, show: { effect: "blind", duration: 1000 }, hide: { effect: "explode", duration: 1000 } }); } ); </script> <div id="dialog" title="Basic dialog"> <p>This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <script type="text/javascript"> var allowedActions = [ "Grand Theft Auto", "Hacking", "Robbery", "Mugging", "Forgery", "Randomness*" ]; var planner = [ "8", "830", "9", "930", "10", "1030", "11", "1130", "12", "1230, "1", "130", "2", "230", "3", "330", "4", "430", //THIS IS LINE 147 "5", "530", "6", "630", "7", "730" ]; for(var x = 0; x < planner.length; x++) { planner[x] = ""; } function myFunction(ID) { $( "#dialog" ).dialog( "open" ); alert(ID); //var IDRef = ID + "text"; var x = document.getElementById(ID + "text"); document.body.innerHTML = document.body.innerHTML.replace(x.innerHTML, 'Hello World'); } </script> Syntax Error Line 147: invalid or unexpected token.
-
I seen it before yo mentioned it. THANK YOU VERY MUCH!!
-
I never try to declare any cars or assign.
-
I only included the two jQuery files. No code
-
<script src"https://code.jquery.com/jquery-latest.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin="anonymous"></script> Then a bunch of HTML. This is the first time I've had this happen to me.
-
WTH are you talking about? I can do it in jQuery :). Whts is vanilla?
-
If I'm not mistaken GL has jQuery built into it?
-
I have that now. I didn't want to add to all the TR onclickMyFunctions. There's about 30 of them
-
So when a person clicks the TR I want to alert the I'd, but my code looks like this. There's a lot of TRs on the page. So is there a way to attach the function. This page is going to end up being. Module in gangster legends. So assigning to all TRs may cause an issue. I can't remember if GL theme has TRs . <table id="game"> <tr id="8" onclick="myFunction(this.id)"> <th>08:00</th> <td colspan="4" rowspan="2" class="stage-saturn">Welcome</td> </tr> <tr id="830" onclick="myFunction(this.id)"> <th>08:30</th> </tr> <tr id="9" onclick="myFunction(this.id)"> <th>09:00</th> <td colspan="4" class="stage-earth">Speaker One <span>Earth Stage</span></td> </tr>
-
-
H body { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 100vh; padding: 4rem 0; font-family: -system-ui, -apple-system, BlinkMacSystemFont, sans-serif; } table { width: 100%; max-width: 50rem; tr:nth-child(even) th { color: #ccc; font-weight: normal; } th, td { padding: 0.5rem 1rem; } th { font-weight: normal; border-top: thin dotted #ccc; } td { font-size: 0.8rem; font-weight: bold; line-height: 1.4; border-radius: 0.2rem; transition: opacity 0.3s ease; } td > span { font-size: 0.8em; font-weight: normal; display: block; width: 100%; } } .stage-earth {background-color: #FFA726}; .stage-mercury {background-color: #9CCC65}; .stage-venus {background-color: #FF8A65}; .stage-mars {background-color: #B3E5FC}; .stage-jupiter {background-color: #81D4FA}; .stage-saturn {background-color: #26C6DA}; If I use this css file for a module, is it going to apply to whole site. I think it will, so with that said, what is my easiest solution to fix so it wouldn't effect any other areas of the page. Edit: and the stage- classes don't seem to work <td colspan="4" rowspan="2" class="stage-saturn">Drinks</td> To make things a bit stranger the stage-earth one works.
-
A dialogue is like a pop up window. GL platform script? What's the platform script?
-
I understand that, show that cron example when got chance Should be,. Gooogle automated url brower or something similar. Should let you enter a url every X amount of time.
-
That a dialogue in last theme you posted?
-
That's what it's supposed to do. 🙂 I don't see how a cron class is more effective then a cron. Cron class has to check before executing "cronJobTypeCode". The cron automatically executes the "cronJobTypeCode" with nif statement check. Then calculating minute difference and updating the time in DB. I'm pretty sure that post makes sense @Dayo
-
I usually always type yo instead of you 😉
-
Man was I wrong. LoL.
-
A update will be coming soon. I fixed several small issues to have it working straight out the box, and there will be several new item types released.