Login   Register  
PHP Classes
elePHPant
Icontem

File: area_edit.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of JImmy Bo  >  Weller MUD Area Loader  >  area_edit.php  >  Download  
File: area_edit.php
Role: Example script
Content type: text/plain
Description: Example Area Editor for this class.
Class: Weller MUD Area Loader
Parse and manipulate Weller MUD map area files
Author: By
Last change: Object Editor added
Date: 1 year ago
Size: 3,835 bytes
 

Contents

Class file image Download
<?php
    ob_start
();
    
session_start();
    
    
// EXAMPLE USAGE of [class.weller.mud.php] and [class.weller.mud.render.php]

    // usage: Just RUN THIS FILE after generating a mud directory with [class.load.rom.area.php] or similar area to [weller mud area format] script
    
/*    
        Related:
        PHP Class :: MUDs :: Multi User Dungeons :: Multi User Dimensions :: MMORPG :: Internet Games :: RPG :: Role Playing Game 
        Simulation :: Game Development :: World :: Universe
        
        find this and other classes by this author at:
        http://www.phpclasses.org/browse/author/144301.html
        
        you can find [class.load.rom.area.php] here:
        http://www.phpclasses.org/package/8282-PHP-Load-ROM-MUD-area-map-files-into-arrays.html
*/
    

    
    // todo: when area is included you can choose the changes you want to implement and include them from the changes folder.
    
    
    // include supporting classes //
    
include_once('class.weller.mud.php');
    include_once(
'class.weller.mud.render.php');
    


    
// load weller_mud_world class
    
$wmud = new weller_mud_world('test_world/'); // make object and set world data directory

    // load weller_mud_world render class and attach the weller_mud object to it //
    
$wmud->load_render_engine($wmud); // add the render engine to the area reader. Pass the parent object while we are at it.
    

    
    
    // COMMAND PROCESSOR //
    
if(!empty($_GET['cmd']))
        switch(
$_GET['cmd'])
        {
            case 
'select_area':    
                die(
$wmud->render->set_area($_POST['area']));
            break;
            
            case 
'edit_mob':
                
$mob_vnum $_POST['mob_vnum'];
                
$area_name $_POST['area'];
                
$wmud->render->draw_mob_editor($mob_vnum$area_name);
            break;
            
            case 
'edit_obj':
                
$obj_vnum $_POST['obj_vnum'];
                
$area_name $_POST['area'];
                
$wmud->render->draw_obj_editor($obj_vnum$area_name);
            break;
            
            case 
'select_mob_list_area':
                    
$area_name $_GET['area_name'];
                    
$wmud->render->cur_area_name $area_name;
                    
// die(11111111111111111111);
                    
die($wmud->render->drop_down('mob_list_area','myMobList','[ area mobs ]'));
            break;
            
            case 
'select_obj_list_area':
                    
$area_name $_GET['area_name'];
                    
$wmud->render->cur_area_name $area_name;
                    
// die(11111111111111111111);
                    
die($wmud->render->drop_down('obj_list_area','myObjList','[ area objs ]'));
            break;
        }
    
    
# if anything comes through as a command let's have it kill ze output of ze further data
    
if(!empty($_GET['cmd']))
        die();


?>

<!doctype html>
<html>
    <head>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
        
        <link rel="stylesheet" href="area_edit.css" />
    </head>

    <body>
        <div class='exit_data' style='position:absolute;visibility:hidden;display:none;'></div>
    
        <div class='rooms'></div>
        
        <div class='debug'>
            <pre>
                <?php if(!empty($debug_str)) echo $debug_str?>
            </pre>
        </div>



        <div class='mob-editor'>
            <div class='title'>Mob Editor</div>
            <div class='content'></div>
            <div class='close'>X</div>
        </div>



        <div class='obj-editor'>
            <div class='title'>Object Editor</div>
            <div class='content'></div>
            <div class='close'>X</div>
        </div>







        <div class='navigate'>
            <div class='exit n'></div>
            <div class='exit e'></div>
            <div class='exit s'></div>
            <div class='exit w'></div>

            <div class='exit u'></div>
            <div class='exit d'></div>
        </div>


        <div class='menubar'>
            <div class='menu-item'><?php echo $wmud->render->drop_down('area_list','myAreaList','[ areas ]'); ?></div>
            <div class='menu-item menu-mob-list'></div>
            <div class='menu-item menu-obj-list'></div>
        </div>
        
        <div class='submenubar'>
            
            
        </div>
        
        <script src="area_edit.js"></script>
        
    </body>

</html>