Skip to content

Commit

Permalink
Stack canvas now shows something for unnamed objects and looks a bit …
Browse files Browse the repository at this point in the history
…more 10.10 ish.
  • Loading branch information
uliwitness committed Feb 22, 2015
1 parent 4588e33 commit 6c01dd4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ -(NSPoint) distributedView: (UKDistributedView*)distributedView
NSImage* objectImage = currItem.mCard ? [NSImage imageNamed: @"CardIcon"] : (currItem.mBackground ? [NSImage imageNamed: @"BackgroundIcon"] : [NSImage imageNamed: @"StackIcon"]);
CStack* currStack = currItem.mStack;
CConcreteObject* currObject = currItem.mCard ? (CConcreteObject*)currItem.mCard : (currItem.mBackground ? (CConcreteObject*)currItem.mBackground : (CConcreteObject*)currItem.mStack);
NSString* nameStr = [NSString stringWithUTF8String: currObject->GetName().c_str()];
NSString* nameStr = (currObject->GetName().size() > 0) ? [NSString stringWithUTF8String: currObject->GetName().c_str()] : [NSString stringWithFormat: @"ID %lld", currObject->GetID()];
NSImage* img = nil;

if( currObject == currStack )
Expand Down
6 changes: 4 additions & 2 deletions Stacksmith/Portable Document/CConcreteObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <string>
#include "CMap.h"
#include "tinyxml2.h"
#include "CObjectID.h"
extern "C" {
#include "LEOInterpreter.h"
#include "LEOScript.h"
Expand Down Expand Up @@ -76,7 +77,8 @@ class CConcreteObject : public CScriptableObject
virtual std::string GetName() { return mName; };
virtual void SetName( const std::string& inStr ) { mName = inStr; IncrementChangeCount(); };
virtual std::string GetDisplayName() { return mName; };

virtual ObjectID GetID() const { return 0; };

virtual LEOContextGroup* GetScriptContextGroupObject();

virtual void SetBreakpointLines( const std::vector<size_t>& inBreakpointLines );
Expand All @@ -102,7 +104,7 @@ class CConcreteObject : public CScriptableObject
std::vector<size_t> mBreakpointLines; // Lines on which the user set breakpoints using the UI that should be applied to the script when compiled.

struct LEOScript * mScriptObject; // Compiled script, lazily created/recreated on changes.
LEOObjectID mIDForScripts; // The ID Leonie uses to refer to this object.
LEOObjectID mIDForScripts; // The ID Leonie uses to refer to this object. This is *not* the ID as Hammer understands it.
LEOObjectSeed mSeedForScripts; // The seed value to go with mIDForScripts.
struct LEOValueObject mValueForScripts; // A LEOValue so scripts can reference us (see mIDForScripts).
CDocument * mDocument; // Document that contains us.
Expand Down
4 changes: 2 additions & 2 deletions Stacksmith/Portable Document/CLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class CLayer : public CConcreteObject
CLayer( std::string inURL, ObjectID inID, const std::string& inName, const std::string& inFileName, CStack* inStack ) : mURL(inURL), mStack(inStack), mID(inID), mFileName(inFileName), mLoaded(false), mLoading(false), mShowPict(true), mDontSearch(false), mCantDelete(false), mChangeCount(0), mPartIDSeed(0) { mName = inName; };
~CLayer();

ObjectID GetID() const { return mID; };
std::string GetFileName() const { return mFileName; };
virtual ObjectID GetID() const { return mID; };
virtual std::string GetFileName() const { return mFileName; };

virtual void Load( std::function<void(CLayer*)> completionBlock ); //!< Load this layer from its XML file, asynchronously. Once successfully done, sets mLoaded.
virtual bool Save( const std::string& inPackagePath ); //!< Save this layer to the given file package (i.e. .xstk folder) as an XML file.
Expand Down
2 changes: 1 addition & 1 deletion Stacksmith/Portable Document/CPart.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class CPart : public CConcreteObject
virtual CPart* Retain();
virtual void Release();

ObjectID GetID() { return mID; };
virtual ObjectID GetID() const { return mID; };
virtual void SetID( ObjectID i ) { mID = i; };
LEOInteger GetFamily() { return mFamily; };
virtual void SetFamily( LEOInteger inFamily ) { mFamily = inFamily; };
Expand Down
2 changes: 1 addition & 1 deletion UKDistributedView

0 comments on commit 6c01dd4

Please sign in to comment.