コード例 #1
0
function DisplayStatsHeader($startbody = 1)
{
    global $mod, $mod_compare, $mods, $theaterfile, $theaterfile_compare, $theaters, $version, $version_compare, $versions, $theaterpath, $theaterpath_compare, $range, $range_unit, $range_units;
    // Are we comparing two different items?
    $compare = $version != $version_compare || $mod != $mod_compare || $theaterfile != $theaterfile_compare;
    startbody();
    echo "\n\t\t<form action='{$_SERVER['PHP_SELF']}' method='get'>\n\t\t<div style='margin: 5px;'>\n\t\t\t<h1>Insurgency Theater Parser</h1>\n\t\t\t<h2>Viewing {$theaterfile} from {$mod} {$version}</h2>\n";
    if ($compare) {
        echo "<h2>Comparing to {$theaterfile_compare} from {$mod_compare} {$version_compare}</h2>\n";
    }
    // Mod/version/theater
    echo "<div>\n";
    DisplayModSelection();
    // Comparison Mod/version/theater
    echo "<div class='beta' style='float: right;'><b>Compare to another theater:</b> \n";
    DisplayModSelection(1);
    echo "</div>\n";
    echo "</div>\n";
    // Select range and units of measure
    echo "<div>\n";
    DisplayRangeSelection();
    echo "</div>\n";
    // Submit button
    echo "\t\t\t\t<input type='submit' value='Parse'>\n\t\t\t</div>\n";
}
コード例 #2
0
function DisplayTheaterCreationMenu()
{
    global $mods, $snippets, $sections, $theaters, $theatername, $theaterfile, $version, $versions, $theater;
    //var_dump($mods);
    echo "<div><form action='theater.php' method='GET'>\n";
    echo "<div class='title'>Theater Generator</div>\n";
    echo "<div class='help'>\nThis tool is designed to give average users and server admins the ability to create custom theater files for their servers, without needing to understand how to\n modify them. Theater files are the way that Insurgency tracks practically all player/item/weapon stats and settings, allowing a good amount of customization and\n changing of gameplay to your tastes. The tool has several types of resources.<ul><li><b>Item Groups:</b> These are groups which can be modified to make changes to all player loadouts based on item grouping. So, it could be used to make a theater with only pistols and grenades, or give all players LMGs for example.</li><li><b>Mutators:</b> Simple scripts that change all settigs in a theater based upon rules. For example, \"Set all weapon weight to 0\".</li><li><b>Snippets:</b> Modulat theater files that make a tweak to gameplay in a more detailed manner,\n such as:<ul><li>Giving all players a specific kit</li><li>Removing the ability to slide</li><li>Adding new weapons</li><li>Adjusting team and player class composition</li></ul></li></ul>As more players use this tool, we will be accepting snippets and \nmutators from the community to increase the utility of this tool, so please feel free to <a href='http://steamcommunity.com/id/jballou'>add me on steam</a> if you \nwant to contribute.</div>\n";
    //Theater selection
    echo "<div class='theaterselect'>\n";
    echo "<div class='title'>Base Theater</div>\n";
    echo "Select the base theater file to use. This will be used as the starting point for the modifications you select.<br>\n";
    echo DisplayModSelection();
    echo "<br>\n<input type='checkbox' name='include_all_theaters'> Include all base theaters into one standalone theater? Will create a bigger theater, but it will have no dependencies.</div>\n";
    // Merge snippets
    foreach ($snippets as $sname => $sdata) {
        //Skip if this is a directory, since we will handle it later in the Theater Snippet section
        if (in_array($sname, $sections)) {
        } else {
            $name = isset($sdata['name']) ? $sdata['name'] : $sname;
            $desc = isset($sdata['desc']) ? "{$sdata['desc']}<br>" : '';
            $style = "";
            //style='display: none;'";
            echo "<div class='section toggle-section' id='header-section-{$sname}'>{$name}</div>\n<div class='desc'>{$desc}</div>\n<div id='section-{$sname}'{$style}>\n";
            switch ($sname) {
                case 'mutators':
                    foreach ($sdata['settings'] as $mutator => $mdata) {
                        $name = isset($mdata['name']) ? $mdata['name'] : $mutator;
                        $desc = isset($mdata['desc']) ? "{$mdata['desc']}<br>" : '';
                        echo "<div class='subsection toggle-section' id='header-section-{$sname}-{$mutator}'>{$name}</div>\n";
                        echo "<div class='desc'><input type='checkbox' name='mutator[{$mutator}]'>{$desc}</div>\n";
                        echo "<div id='section-{$sname}-{$mutator}'>\n";
                        foreach ($mdata['settings'] as $section => $sdata) {
                            echo "<ul>\n";
                            foreach ($sdata as $setting => $default) {
                                echo "<li>{$section}.{$setting}: <input type='text' name='setting[{$mutator}][{$section}][{$setting}]' value='{$default}'></li>";
                            }
                            echo "</ul>\n";
                        }
                        echo "</div>";
                    }
                    break;
                case 'item_groups':
                    foreach ($sdata['settings'] as $groupname => $group) {
                        echo "<div class='subsection'>{$groupname}: ";
                        ShowItemGroupOptions($groupname);
                        echo "</div>\n<ul>\n";
                        $group = ProcessItemGroup($group);
                        foreach ($group as $field => $items) {
                            if (!isset($theater[$field])) {
                                continue;
                            }
                            echo "<li>{$field}<br>\n";
                            echo "<ul>\n";
                            foreach ($items as $item) {
                                echo "<li>{$item}</li>";
                            }
                            echo "</ul>\n</li>\n";
                        }
                        echo "</ul>";
                    }
                    break;
                default:
                    break;
            }
            echo "</div>\n";
            //</div>\n";
        }
    }
    echo "<div class='toggle-section section' id='header-section-theater-snippets'>Theater Snippets</div>\n";
    echo "<div class='desc'>These are pieces of other mods that can be assembled into a finished theater file</div>\n";
    echo "<div id='section-theater-snippets'>\n";
    foreach ($sections as $section) {
        echo "<div class='toggle-section subsection' id='header-section-theater-snippets-{$section}'>{$section}</div>\n<div id='section-theater-snippets-{$section}'>\n";
        if ($display == 'select') {
            echo "<select name='section[{$section}]'>\n<option value=''>--None--</option>\n";
            foreach ($snippets[$section] as $sname => $sdata) {
                echo "<option>{$sname}</option>\n";
            }
            echo "</select>\n";
        } else {
            foreach ($snippets[$section] as $sname => $sdata) {
                /*
                					foreach ($sdata['settings'] as $sname => $sdata) {
                						$name = (isset($sdata['name'])) ? $sdata['name'] : $mutator;
                						$desc = (isset($sdata['desc'])) ? "{$sdata['desc']}<br>" : '';
                						echo "<div class='subsection toggle-section' id='header-section-{$section}-{$mutator}'>\n<input type='checkbox' name='mutator[{$mutator}]'>{$name}</div>\n<div id='section-{$section}-{$mutator}'>\n<div class='desc'>{$desc}</div>\n";
                						foreach ($sdata['settings'] as $section => $sdata) {
                							echo "<ul>\n";
                							foreach ($sdata as $setting => $default) {
                								echo "<li>{$section}.{$setting}: <input type='text' name='setting[{$mutator}][{$section}][{$setting}]' value='{$default}'></li>";
                							}
                							echo "</ul>\n";
                						}
                						echo "</div>";
                					}
                */
                echo "<span>\n";
                //				echo "<span class='toggle-section' id='header-section-{$section}-{$sname}'>\n";
                echo "<input type='checkbox' name='section[{$section}][{$sname}]'>\n";
                echo "<b>{$sname}:</b>\n";
                //				echo "</span>\n";
                //				echo "<span id='section-{$section}-{$sname}'>\n";
                echo str_replace("\n", "<br>\n", $sdata['desc']);
                //				echo "</span>\n";
                echo "</span>\n";
                echo "<br>\n";
            }
        }
        echo "</div>\n";
    }
    echo "</div>\n";
    echo "<div>\n<input type='submit' name='go' value='Generate Theater'\n></form>\n</div>\n</div>\n";
}
コード例 #3
0
                    echo "\t\t\t\t\t\t\t\t<div id='{$layername}-{$row['pos_type']}-{$row['pos_name']}-{$tclass}' class='obj {$mclass}_bg' style='position: absolute; left: {$row['pos_x']}px; top: {$row['pos_y']}px;'></div>\n";
                    echo "\t\t\t\t\t\t\t\t<div id='{$layername}-{$row['pos_type']}-{$row['pos_name']}-{$tclass}' class='obj {$mclass}_fg' style='position: absolute; left: {$row['pos_x']}px; top: {$row['pos_y']}px;'>{$row['pos_name']}</div>\n";
            }
        }
        if ($svg) {
            svg($svg, $layername);
            $svg = "";
        }
        echo "\t\t\t\t\t\t</div>\n";
    }
    echo "\t\t\t\t\t</div>\n";
}
// Right column
echo "\t\t\t\t\t<div id='key' class='key'>\n";
echo "\t\t\t\t\t\t\t\t<form>\n";
DisplayModSelection(0, 'map');
/*
Map: <select name='map'>";
	foreach ($maps as $mapname => $mapdata) {
		$sel = ($mapname == $map) ? ' SELECTED' : '';
		echo "<option{$sel}>{$mapname}</option>\n";
	}
	echo "</select>\n";
*/
echo "<input type='submit' value='Go'></form>\n";
if ($map) {
    ?>
						<h2>MAP OVERLAYS</h2>
						<form><input id='gametypes' type='button' value='ON' onclick="toggleButton(this)" />
						<select id='gametype' onchange='changeGTLayer()'>
<?php