Working on #13, engine constants fixed, but still not working. 2D tables pretty much done.

This commit is contained in:
nearwood 2015-05-16 14:07:28 -04:00
parent 60849eab9f
commit ccf24cb4bc
2 changed files with 26 additions and 7 deletions

View File

@ -135,7 +135,7 @@ class INI
break;
case "SettingContextHelp": //Any help text for our variable
$values[$currentSection][$key] = INI::defaultSectionHandler($value);
$values[$currentSection][$key] = INI::helpSectionHandler($value);
break;
//Whenever I do menu recreation these two will be used
@ -253,6 +253,11 @@ class INI
return $values + $globals;
}
public static function helpSectionHandler($value)
{
return trim($value);
}
//function constantSectionHandler($value)
public static function defaultSectionHandler($value)
{

View File

@ -144,10 +144,12 @@ class MSQ
* @param $value It's value
* @returns String HTML \<div\>
*/
private function msqConstant($constant, $value)
private function msqConstant($constant, $value, $help)
{
//var_export($constant);
//var_export($value);
return '<div class="constant">' . $constant . ': ' . $value . '</div>';
//var_export($help);
return '<div class="constant">' . $constant . ' (' . $help . '): ' . $value . '</div>';
}
/**
@ -192,6 +194,7 @@ class MSQ
$constants = $msqMap['Constants'];
$curves = $msqMap['CurveEditor'];
$helpTexts = $msqMap['SettingContextHelp'];
//$tables = $msqMap['TableEditor'];
$engineSchema = getEngineSchema();
@ -296,14 +299,25 @@ class MSQ
//}
//}
}
foreach ($constants as $key => $config)
{
$value = $this->findConstant($msq, $key);
//if (DEBUG) echo "<div class=\"debug\">Trying $key for engine data</div>";
if (array_key_exists($key, $engineSchema))
if ($value !== NULL)
{
if (DEBUG) echo "<div class=\"debug\">Found engine data: $key</div>";
$constant = $this->findConstant($msq, $key);
$engine[$key] = trim($constant, '"');
$value = trim($value, '"');
if (array_key_exists($key, $engineSchema))
{
if (DEBUG) echo "<div class=\"debug\">Found engine data: $key => $value</div>";
$engine[$key] = $value;
}
if (array_key_exists($key, $helpTexts))
$help = $helpTexts[$key];
$this->msqConstant($key, $value, $help);
}
}
}