mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
linux
This commit is contained in:
parent
752487a7ff
commit
21c514fd2b
@ -361,19 +361,29 @@ subprocess_run() {
|
||||
|
||||
if (_image_filename_changed) {
|
||||
update_image_filename(_image_filename, _image_filename_temp);
|
||||
override = true;
|
||||
}
|
||||
_image_filename_changed = false;
|
||||
|
||||
|
||||
if (override || have_event || install_label != prev_label) {
|
||||
redraw(install_label);
|
||||
override = false;
|
||||
XFillRectangle(_display, _window, _graphics_context, 12, _height - 18,
|
||||
(unsigned int)(install_progress * (_width - 24)), 7);
|
||||
|
||||
// Don't draw the progress bar unless we have some text in
|
||||
// install_label.
|
||||
if (!install_label.empty()) {
|
||||
XFillRectangle(_display, _window, _graphics_context, 12, _height - 18,
|
||||
(unsigned int)(install_progress * (_width - 24)), 7);
|
||||
}
|
||||
XFlush(_display);
|
||||
|
||||
} else if (install_progress != prev_progress) {
|
||||
XFillRectangle(_display, _window, _graphics_context, 12, _height - 18,
|
||||
(unsigned int)(install_progress * (_width - 24)), 7);
|
||||
if (!install_label.empty()) {
|
||||
XFillRectangle(_display, _window, _graphics_context, 12, _height - 18,
|
||||
(unsigned int)(install_progress * (_width - 24)), 7);
|
||||
}
|
||||
}
|
||||
|
||||
prev_label = install_label;
|
||||
prev_progress = install_progress;
|
||||
|
||||
@ -502,11 +512,21 @@ redraw(string label) {
|
||||
}
|
||||
XClearArea(_display, _window, 10, _height - 20, _width - 20, 10, false);
|
||||
}
|
||||
|
||||
// Draw the rest - the label and the progress bar outline.
|
||||
XDrawString(_display, _window, _graphics_context, _width / 2 - label.size() * 3,
|
||||
_height - 30, label.c_str(), label.size());
|
||||
XDrawRectangle(_display, _window, _graphics_context, 10, _height - 20, _width - 20, 10);
|
||||
|
||||
if (!label.empty()) {
|
||||
// Draw the rest - the label and the progress bar outline.
|
||||
int text_width = label.size() * 6;
|
||||
int text_height = 10;
|
||||
int text_x = (_width - text_width) / 2;
|
||||
int text_y = _height - 30;
|
||||
|
||||
XClearArea(_display, _window,
|
||||
text_x - 2, text_y - text_height - 2,
|
||||
text_width + 4, text_height + 4, false);
|
||||
XDrawString(_display, _window, _graphics_context, text_x, text_y,
|
||||
label.c_str(), label.size());
|
||||
XDrawRectangle(_display, _window, _graphics_context, 10, _height - 20, _width - 20, 10);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -855,8 +855,6 @@ class Packager:
|
||||
not already been included. Returns the new name within the
|
||||
package tree. """
|
||||
|
||||
assert not filename.isLocal()
|
||||
|
||||
filename = Filename(filename)
|
||||
filename.makeCanonical()
|
||||
|
||||
@ -1370,6 +1368,32 @@ class Packager:
|
||||
version = args.get('version', None)
|
||||
self.require(packageName, version = version)
|
||||
|
||||
def parse_model_path(self, words):
|
||||
"""
|
||||
model_path directory
|
||||
"""
|
||||
newName = None
|
||||
|
||||
try:
|
||||
command, dirName = words
|
||||
except ValueError:
|
||||
raise ArgumentError
|
||||
|
||||
getModelPath().appendDirectory(Filename.fromOsSpecific(dirName))
|
||||
|
||||
def parse_reset_model_path(self, words):
|
||||
"""
|
||||
reset_model_path
|
||||
"""
|
||||
newName = None
|
||||
|
||||
try:
|
||||
(command,) = words
|
||||
except ValueError:
|
||||
raise ArgumentError
|
||||
|
||||
getModelPath().clear()
|
||||
|
||||
def parse_module(self, words):
|
||||
"""
|
||||
module moduleName [newName]
|
||||
|
@ -116,6 +116,7 @@ def makePackedApp(args):
|
||||
mainModule = main.cStr().replace('/', '.')
|
||||
|
||||
packager.installDir = appDir
|
||||
getModelPath().appendDirectory(root)
|
||||
|
||||
packager.setup()
|
||||
packager.beginPackage(appBase, p3dApplication = True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user