Skip to content

Commit

Permalink
Merge pull request #8
Browse files Browse the repository at this point in the history
  • Loading branch information
matzman666 committed Dec 19, 2015
2 parents b8c8596 + 5e87f0a commit eaf1df5
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 6 deletions.
7 changes: 6 additions & 1 deletion pypipboyapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import importlib
import traceback
import logging.config
from PyQt5 import QtWidgets, QtCore, uic
from PyQt5 import QtGui, QtWidgets, QtCore, uic
from pypipboy.network import NetworkChannel
from pypipboy.datamanager import PipboyDataManager
from dialogs.selecthostdialog import SelectHostDialog
Expand Down Expand Up @@ -102,6 +102,11 @@ def __init__(self, args):
self._connectHostThread = None
self._iwcEndpoints = dict()
self._logger = logging.getLogger('pypipboyapp.main')

pipboyAppIcon = QtGui.QIcon()
pipboyAppIcon.addFile('ui\\res\\PyPipBoyApp-Launcher.ico')
self.setWindowIcon(pipboyAppIcon)



# run the application
Expand Down
Binary file added ui/res/PyPipBoyApp-Launcher.ico
Binary file not shown.
3 changes: 2 additions & 1 deletion widgets/hotkeys/hotkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,15 @@ def equipApparelFromSlot(self, slotIndex):
return

def toggleRadio(self):

if (self.currentRadioStation):
self._logger.debug('toggleRadio: currentstation: ' + self.currentRadioStation.child('text').value())
self.dataManager.rpcToggleRadioStation(self.currentRadioStation)
else:
self._logger.debug('toggleRadio: no current, trying station 0')
numStations = len(self.availableRadioStations)
if numStations > 0:
self.dataManager.rpcToggleRadioStation(self.availableRadioStations[0])
self._logger.debug('toggleRadio: currentstation: ' + self.currentRadioStation.child('text').value())

return

Expand Down
13 changes: 11 additions & 2 deletions widgets/map/globalmapwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,12 @@ def init(self, app, datamanager):
self.widget.mapFileComboBox.currentIndexChanged.connect(self._slotMapFileComboTriggered)
# Init color controls
self.widget.mapColorButton.clicked.connect(self._slotMapColorSelectionTriggered)
self.widget.mapColorAutoToggle.setChecked(bool(int(self._app.settings.value('globalmapwidget/autoColour', 0))))
try:
self.widget.mapColorAutoToggle.setChecked(bool(int(self._app.settings.value('globalmapwidget/autoColour', 0))))
except ValueError:
self.widget.mapColorAutoToggle.setChecked(bool(self._app.settings.value('globalmapwidget/autoColour', False)))
#self.widget.mapColorAutoToggle.setChecked(False)

self.widget.mapColorAutoToggle.stateChanged.connect(self._slotMapColorAutoModeTriggered)
# Init stickyLabels Checkbox
self.stickyLabelsEnabled = False
Expand Down Expand Up @@ -776,7 +781,11 @@ def _slotMapColorAutoModeTriggered(self, value):
self._onPipColorChanged(None, None, None)
elif self.pipColor:
self.pipColor.unregisterValueUpdatedListener(self._onPipColorChanged)
self.signalSetColor.emit(self.pipColor)
r = self.pipColor.child(0).value() * 255
g = self.pipColor.child(1).value() * 255
b = self.pipColor.child(2).value() * 255
pipColor = QtGui.QColor.fromRgb(r,g,b)
self.signalSetColor.emit(pipColor)


@QtCore.pyqtSlot()
Expand Down
16 changes: 14 additions & 2 deletions widgets/smallplayerinfo/smallplayerinfowidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self, handle, parent):
self.pipPlayerInfo = None
self.pipCurrWorldspace = None
self.pipStats = None
self.pipRadioInfo = None
self.maxHP = 0
self.curHP = 0
self.maxAP = 0
Expand Down Expand Up @@ -48,6 +49,10 @@ def _onPipRootObjectEvent(self, rootObject):
if (self.pipStats):
self.pipStats.registerValueUpdatedListener(self._onPipPlayerInfoUpdate, 1)

self.pipRadioInfo = rootObject.child('Radio')
if self.pipRadioInfo:
self.pipRadioInfo.registerValueUpdatedListener(self._onPipPlayerInfoUpdate, 2)

self._signalInfoUpdated.emit()


Expand Down Expand Up @@ -100,15 +105,22 @@ def _slotInfoUpdated(self):
if (effect.child('Name').value() == 'Rads'):
radChange += effect.child('Value').value()


radChangePrefix = ''
if (radChange > 0):
radChangePrefix = '+'

self.widget.radChangeLabel.setText(radChangePrefix + str(round(radChange)))
self.widget.lblActiveEffects.setText(listEffectsSeperator.join(listEffects))


currentRadioStationName = 'Radio off'
if(self.pipRadioInfo):
for i in range(0, self.pipRadioInfo.childCount()):
station = self.pipRadioInfo.child(i)
if station.child('active').value():
currentRadioStationName = station.child('text').value()

self.widget.lblRadio.setText(currentRadioStationName)

maxHP = self.pipPlayerInfo.child('MaxHP')
if maxHP:
self.maxHP = maxHP.value()
Expand Down
21 changes: 21 additions & 0 deletions widgets/smallplayerinfo/ui/smallplayerinfowidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,27 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="lblRadio">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Off</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
Expand Down

0 comments on commit eaf1df5

Please sign in to comment.