Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

One or the other... vote once for #1 and once for #2.

#1: Put the Alarm Siren in the Military Garrison, it fits and is one buildings less.
#1: Keep the Alarm Siren seperate, I want to have it near my other levers.
#2: I have traded with Gnomes, build Artificer and Weather Control Station.
#2: I have NOT traded with Gnomes, did not have the chance to build their buildings.

Pages: 1 ... 456 457 [458] 459 460 ... 749

Author Topic: ☼MASTERWORK-DF☼ V.3 - New release and old post. This will be locked later.  (Read 1855979 times)

arclance

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6855 on: September 15, 2012, 03:23:30 pm »

ick, out of curiosity, is there any way to get those .so's to be kept in the 'lib' directory? that is what it's there for after all...
I tried some things to do that but I have not had any luck yet.
I decided to figure out what I needed to put there first since I was not having any luck getting them to run from 'lib'.
There are some other cx_freeze settings to try like "bin-path-includes" and "init-script".

I think it can be done by changing the PATH environment variable with a launcher script to look in ./lib first.
I need to do research on the right way to do that if it is required.

The easiest thing to do would be to put a launch script in the root mod folder that does this.
Code: [Select]
cd GUI_FOLDER
./GUI_EXECUTABLE
so the user never sees all those files.
That is how you launch Dwarf Fortress in Linux right now anyway.

I also tested tooltip colors today and found out that I have to hardcode them in the python launch script to override the default colors.
This means that their colors are not affected by changes to mainframe.ui.
Code: [Select]
#~~~~~~~~~~~~~~~~~~~~~~~~#
"""Regardless of where it gets moved on the computer, this code will find this
script, figure out what directory it is in, and save it for future referance."""
import os, sys, inspect
cmd_folder = os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe() ))[0])
if cmd_folder not in sys.path:
    sys.path.insert(0, cmd_folder)
sys.path+=[os.path.join(cmd_folder, 'lib')]

#~~~~~~~~~~~~~~~~~~~~~~~~#
"""This is the section that should contain
everything the user/devs would want to tweak."""
##TODO proper config file support

DEBUG=False
#Valid: True False

style = "Plastique"
#Valid:Cleanlooks Plastique CDE Motif Windows Macintosh

#~~~~~~~~~~~~~~~~~~~~~~~~#
import locale
locale.setlocale(locale.LC_ALL, '')
### Load The GUI from lib/mainframe.ui ###
from PyQt4.uic import loadUiType
from PyQt4 import QtGui, QtCore
MainWindowForm, MainWindowBase = loadUiType("lib/mainframe_arclance_fonts.ui")

#~~~~~~~~~~~~~~~~~~~~~~~~#
class MainFrame(MainWindowForm, MainWindowBase):
    """Create a class for our main window"""
    def __init__(self):
        #window has been created, init it.
        QtGui.QApplication.setStyle(QtGui.QStyleFactory.create(style))
        QtGui.QApplication.setPalette(QtGui.QApplication.style().standardPalette())
        self._setupPallets() # Create And Set Pallets To Double Overide Default Color Settings (Tooltips Need This)
        MainWindowBase.__init__(self)
        self.ui=MainWindowForm()
        self.ui.setupUi(self)
        self.cmd_folder=cmd_folder
   
    def _setupPallets(self):
        tooltip_palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(10, 10, 10))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(28, 28, 28))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(203, 199, 196))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(19, 19, 19))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(184, 181, 178))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(254, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(35, 35, 35))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 23, 23))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(80, 80, 80))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(50, 50, 50))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Highlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(220, 164, 13))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.HighlightedText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 254))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Link, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 0, 254))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.LinkVisited, brush)
        brush = QtGui.QBrush(QtGui.QColor(30, 30, 30))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.NoRole, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 23, 23))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(10, 10, 10))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(28, 28, 28))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(203, 199, 196))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(19, 19, 19))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(184, 181, 178))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(254, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(35, 35, 35))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 23, 23))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(80, 80, 80))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(50, 50, 50))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Highlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(220, 164, 13))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.HighlightedText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 254))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Link, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 0, 254))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.LinkVisited, brush)
        brush = QtGui.QBrush(QtGui.QColor(30, 30, 30))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.NoRole, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 23, 23))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(10, 10, 10))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(28, 28, 28))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(203, 199, 196))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(19, 19, 19))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(184, 181, 178))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(254, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 23, 23))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 23, 23))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(80, 80, 80))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(171, 171, 171))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Highlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(220, 164, 13))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.HighlightedText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 254))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Link, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 0, 254))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.LinkVisited, brush)
        brush = QtGui.QBrush(QtGui.QColor(30, 30, 30))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.NoRole, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 23, 23))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush)
        QtGui.QToolTip.setPalette(tooltip_palette)
       
#~~~~~~~~~~~~~~~~~~~~~~~~#
def main():
    """Main program loop, initialize application"""
    app = QtGui.QApplication(sys.argv)  #create app
    #init fonts ##todo; move to better location
    fontdb=QtGui.QFontDatabase()
    fonts=[
        open("./lib/waifthin.ttf", mode='rb').read(),
        open("./lib/cosmetica.ttf", mode='rb').read()]
    fontfams=[]
    for fontdata in fonts:
        fontid=fontdb.addApplicationFontFromData(fontdata)
        for fontfam in fontdb.applicationFontFamilies(fontid):
            fontfams.append(fontfam)           
    mainframe = MainFrame()             #create window
    mainframe.fontfams=fontfams
    mainframe.show()
    sys.exit(               #terminate the program after:
             app.exec_())   #start app's mainloop

#~~~~~~~~~~~~~~~~~~~~~~~~#
"""If the file is being executed, run the main loop"""
if __name__ == '__main__':
    main()
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6856 on: September 15, 2012, 05:17:37 pm »

arclance: What you send me previously does open under windows, but it looks exactly like the old GUI, even with the buttons set out for features that dont exist anymore, like the Fortress Defense races.

The code Roses wrote does work, the only thing missing is file-replacement (for the font, arena, and similar things) and the graphical interface. With the configuration.txt and the metatags.txt I can do the entire rest myself and add all the new options for the player. Even the buttons are added automatically, the only problem is that it looks horrible (sorry Roses ^^) What I need is a nice looking, sorted graphical interface for this code. That presumably does work on Win/Linux/Mac as a self-executable.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

arclance

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6857 on: September 15, 2012, 05:33:21 pm »

^ That's what we are working on.
The "looks good" part got stopped cold when zenerbufen broke his Python install.
We need zenerbufen to finish embedding the fonts before we make the final GUI because the font you use affects where you put things in the GUI.

I decided to figure out how to make the executable while waiting to work on the rest of the GUI so I would not have to do it later.
I have the Windows and Linux self-contained executables working right now.
I posted the sample executables so I could see if they worked for other people.
The way I make the executables would not change significantly even if we just use what Roses has now.

I have not heard anything from Roses since I asked if he wanted help with adding features to his backend so I don't know how much progress there has been on that.
I could do file-replacement in about 30min if I knew how he wanted it worked into what he has already written.
He said he was going to try to make his code work with the good looking interface we are working on but I have not heard anything about that either.
« Last Edit: September 15, 2012, 05:36:20 pm by arclance »
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

arclance

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6858 on: September 15, 2012, 05:48:20 pm »

@ zenerbufen
I tried everything I could think of to move the .so files, nothing worked.
I was able to make a launcher script so users don't have to go into the folder that holds the compiled GUI.
Code: [Select]
#!/bin/sh
MW_DIR=$(dirname "$0")
cd $MW_DIR"/Masterwork_GUI"
./masterwork-launcher_arc_test
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6859 on: September 15, 2012, 06:09:42 pm »

Strictly speaking it doesnt have to be the font I use in the mod. The old GUI didnt have it either, OR I am misunderstanding the word font here.

I am using internet with a UMT-Stick, because DSL takes another 2 weeks, and wow... there was a 500mb limit on the stick. Yeah, I kind of knew that, I just didn realise that it is per month(!) What the hell people, I had 500mb after 2h. And now I have a speed of "GPRS-niveau" which is apparently ~25kbs.

I tried uploading the alpha, let the pc run for 4h, come back: Restart because of auto-update. I am now running the upload again since 1h, 29%

Please, could somebody kill me, or give me DSL now ?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

arclance

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6860 on: September 15, 2012, 06:15:16 pm »

^ When I say fonts I mean the fonts that zenerbufen wants to use for the new GUI.
You can't just use the system font in a cross platform program with fixed GUI elements because on some systems the text will be unreadable.

The script loads the new fonts so the user does not need to have them installed.
Right now zenerbufen is (hopefully) going back and changing the GUI code to use those fonts so we only have to design the layout for the new GUI once.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

zenerbufen

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6861 on: September 15, 2012, 08:45:25 pm »

Fonts are done, just need to add this one line of code to set the default font:
 QApplication.setFont(mainframe.fontfams[0])
change the 0 to select the font, 0, 1, 2(if we add more fonts later) etc...

    mainframe = MainFrame()             #create window
    mainframe.fontfams=fontfams
    QtGui.QApplication.setFont(mainframe.fontfams[0])
    mainframe.show()

also I don't like hard coding all those individual elements like you did..., I'm probably going to look for a way to make a loop and just iterate through all the tool tips and set them pragmatically. At this point all we really have to do is make it so when a button is clicked, it calls roses code, or calls the code that other guy submitted for us to toggle the options.

arclance

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6862 on: September 15, 2012, 09:07:46 pm »

^ I don't know how well that will work since fonts are different sizes at the same "font size" but we can always try it.
I think the first tab "General Settings" will need to have it's layout hardcoded but the other ones could be generated from settings/raw files just fine.

Since I have not heard anything from Roses in a while I have been working on putting his stuff (minus the gui) into a class to make it easier to build a GUI off of.
I have the raw parsing bit done if you want me to send it to you.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

Treason

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6863 on: September 15, 2012, 09:42:44 pm »

Another quick question, if anyone has the answer or a similar issue:

There have been several times when I have been fortunate enough to capture Cave Dragons within cages.  Oddly, they do not appear to be tamable, despite never having tasted dwarf blood.

A quick look at the raws and with my very limited knowledge, shows that they still have the trainable tag, but they simply do not show up on the listing to be so tamed.  Has anyone else been able to verify this same bug or was there some decision made that cave dragons would not be tamable int he Mod?
Logged

zenerbufen

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6864 on: September 15, 2012, 10:12:46 pm »

^ I don't know how well that will work since fonts are different sizes at the same "font size" but we can always try it.
I think the first tab "General Settings" will need to have it's layout hardcoded but the other ones could be generated from settings/raw files just fine.

Since I have not heard anything from Roses in a while I have been working on putting his stuff (minus the gui) into a class to make it easier to build a GUI off of.
I have the raw parsing bit done if you want me to send it to you.
arc, I don't understand, or maybe you don't understand. The fontfams variable is a list containing all the embeded fonts. The [#] selects which of the fonts to use. [0] is the first font (regular), [1] selects the second font(the handwritten one). The font sizes are all coded in the .ui file.  That line of code I posted above sets the default font for the entire application, unless it is specifically over ridden,as is the case for the !Don't Panic! text. We will need to go into the ui editor and clear out the font for all the widgets so it will use the default (embedded) font.  The same font should always be the same screen size at the same point size... because it's the same font (the embedded one)

And yes we can change the buttons... I had asked meph for an updated list not to long ago, but he told me nothing had changed since 1.9.3 (the last time I had a working copy of windows and could copy the layout from his gui) we can use sizers/grids also to handle flexible number of buttons (more work) or put them on a scrolling page, although eventually I want to make a tree based view that will allow you to go through and toggle individual entities. I think it wouldn't be to hard to make the program smart enough to actually parse through the raws and build a list of the creatures etc in memory, let people tweak individual creatures right through the gui eventually.

I want to make it so the gui will integrate with the help docs eventually to only show info for the stuff that is currently enabled, I think that would be ultra cool.

edit: I think i read your code wrong/misunderstood you... are you saying that only the tooltips need to be overriden in python? why did you put everything else in the same place? GUI layout should generally be separated from application logic code. Why put all of that brush stuff in the main function instead of leaving it in Ui_mainframe.py? I thought you meant doing that over and over for each button to set the tooltip color for each button.

edit edit: arclance, it might be easier to share code if we use the mercurial repo: http://javaforge.com/hg/mdf
peeps keeps asking me to set one up, but then no one uses it.. I havn't done anything with the code since fixing my python install because I don't know what your doing currently.
« Last Edit: September 15, 2012, 10:38:15 pm by zenerbufen »
Logged

arclance

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6865 on: September 15, 2012, 10:36:04 pm »

^ I did understand that that is what you were saying.
change the 0 to select the font, 0, 1, 2(if we add more fonts later) etc...
What I am saying is that this may not work as well as you think it will since the pixel size of a font character can be different for different fonts at the same point size.
You would need to pick fonts that don't end up small and hard to read or so large they don't fit inside the buttons unless you plan to change the point size of every text object that use that font every time you change the font.
You will have to go through and set the font you want to use on all the text elements that don't use the default font.

Look at Roses gui code it does most of what you want already it just needs to have some code written to use PyQt instead of tkinter.
It has a tree based view and could be expanded to make a list of everything in the raws.

Only the tooltips needed to be overridden in the python code everything else inherits the colors from the pallet I setup for "Main Window" in mainframe.ui correctly.
Even setting custom pallet colors for the individual buttons did not work.
What I did was set the default pallet for all tooltips to the pallet I setup in the python code.
Since it runs after mainframe.ui is read in it forces the tooltips to use the correct colors.
It is a single command that affects every single tootip in the GUI.
It is not in Ui_mainframe.py because right now there is no Ui_mainframe.py because I setup the code to just reading mainframe.ui directly without producing a output file.
« Last Edit: September 15, 2012, 10:38:52 pm by arclance »
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

zenerbufen

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6866 on: September 15, 2012, 10:49:01 pm »

then what is all that stuff about button text, window color, link colors, etc? I guess my point is why do you need 180 lines of code to set the tooltip color? that seems like overkill...

        brush = QtGui.QBrush(QtGui.QColor(23, 23, 23))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush)

should be enough? that is where my confusion is.


also there is only 2 embedded fonts. Cosmetica is for the entire app.. everything, text, buttons, tooltips, this is the default font [0]. the other font waifthin [1] is only used for the !Don't Panic! text. 18 point cosmetica should always be the same size as 18 point cosmetica, even if its on windows/mac/linux. cosmetica 18 (or whatever size we are using, i dont remember) for everything, so it should all be the same size.
« Last Edit: September 16, 2012, 01:16:45 am by zenerbufen »
Logged

arclance

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6867 on: September 15, 2012, 11:07:19 pm »

^ I had not checked if it would accept a partial pallet yet.
I just tired it and it does.
There are actually three colors for each color type depending on the window state (active, inactive, disabled) so this is the minimum you need.
Code: [Select]
tooltip_palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(23, 23, 23))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 23, 23))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 23, 23))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(238, 238, 238))
        brush.setStyle(QtCore.Qt.SolidPattern)
        tooltip_palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush)
        QtGui.QToolTip.setPalette(tooltip_palette)

I am not talking comparing cosmetica to cosmetica (apples to apples) but cosmetica to some other font you might want to use in the future (apples to oranges) as you stated here.
change the 0 to select the font, 0, 1, 2(if we add more fonts later) etc...
What I am saying is that 18 point cosmetica might not be the same sizes as another font say Waif Thin so if this feature you setup won't make is as simple as changing [0] to [3] in some cases since you will also have to change the point size where you use the default font in the GUI as well.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

zenerbufen

  • Bay Watcher
    • View Profile
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6868 on: September 16, 2012, 01:24:51 am »

Oh, I see what you are saying.. I was just using that as an example, how to specify the font in the python code. mainframe.fontfams is a list of all the embedded fonts. So you can use mainframe.fontfams[fontnumber] anywhere in the code (after fonts are loaded) to specify the font. It is that way because one font file can contain multiple fonts, such as regular, bold, italics, bold + italics, etc... the fonts I included however (cosmetica, waif) are single font files.  If the cosmetica font file had also bold included in the file, [0] would be cosmetica, and [1] would be cosmetica bold, pushing waif out to [2]

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: ☼MASTERWORK☼ Dwarf Fortress - v1.9.5 - POLLS EVERYWHERE
« Reply #6869 on: September 16, 2012, 03:23:32 am »


Unfinished Buildings:
Apothecarius => should help/cure diseases.
All 4 magic buildings => 1 magic type per race
Storage Unit => tradegoods, unpacking crates
Herbalist => Makes items directly from plants
Cloth Manufactur => sets, batches and specific types of cloth. might get scrapped.
Wood Manufactur => sets, batches and specific types of wood. might get scrapped.
Spawn Location => Spawns creatures
Machine Factory => Builds contructs and high tech stuff
Warpstone Lab => Makes warpstone grenades and throwers, mutations, warpstone metal (?)
Brewery => special drinks and/or drink upgrades
Shrine, Altar & Temple => ceremonies and sacrifices. Blessings and curses.

Entities are mosly NOT done.
Plants and Trees look good.
Stones, Minerals, Gems and Soils look good.
Creatures will be ported from old mod, with some changes, not too much work.
Special stuff liek diseases, magic, cults, special invaders, spawning of creatures... I havent even started on those yet.

I will upload the manual as well, but it will take some time. Internet via GPRS, only 25kbs...
« Last Edit: September 16, 2012, 03:27:10 am by Meph »
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::
Pages: 1 ... 456 457 [458] 459 460 ... 749