Skip to content

Instantly share code, notes, and snippets.

Created July 21, 2013 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2ad603d3417fc1aaaf14 to your computer and use it in GitHub Desktop.
Save anonymous/2ad603d3417fc1aaaf14 to your computer and use it in GitHub Desktop.
Planetary Annihilation UI mod: Toggle settings panel in Planet Editor
diff -ruN PA/media/ui/alpha/system_editor/system_editor.html PA_MODDED/media/ui/alpha/system_editor/system_editor.html
--- PA/media/ui/alpha/system_editor/system_editor.html 2013-07-15 20:14:23.000000000 +0400
+++ PA_MODDED/media/ui/alpha/system_editor/system_editor.html 2013-07-21 07:10:19.000000000 +0400
@@ -10,12 +10,12 @@
<body>
<div id="version_info">
- <div class="div_version_info_cont">
+ <div class="div_version_info_cont" data-bind="click: hideSettings">
<span>ALPHA v.<span data-bind="text: buildVersion"></span></span>
</div>
</div>
-<div class="div_body_cont" style="width:400px; border-radius:4px; border-width:1px; margin-left:20px;">
+<div id="settings_panel" class="div_body_cont" style="width:400px; border-radius:4px; border-width:1px; margin-left:20px;">
<div class="div_back_btn" data-bind="click: navBack">
<a href="#">BACK</a>
</div>
diff -ruN PA/media/ui/alpha/system_editor/system_editor.js PA_MODDED/media/ui/alpha/system_editor/system_editor.js
--- PA/media/ui/alpha/system_editor/system_editor.js 2013-07-15 20:14:39.000000000 +0400
+++ PA_MODDED/media/ui/alpha/system_editor/system_editor.js 2013-07-21 08:16:34.767995439 +0400
@@ -30,6 +30,14 @@
console.log('lastSceneUrl invalid');
}
};
+
+ self.hideSettings = function() {
+ var div = document.getElementById('settings_panel');
+ if (div.style.display === 'block' || div.style.display === '')
+ div.style.display = 'none';
+ else
+ div.style.display = 'block'
+ }
self.blueprint = function () {
var bp = {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment